No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

TaskMiner - Automatic Annotation of C with OpenMP


TaskMiner is a tool that annotates C programs with OpenMP directives to support task parallelism. Details are available in the paper Automatic Identification of Tasks in Structured Programs. This tool is implemented in C++, on top of LLVM 3.7, and it is publicly available through an on-line interface.


The project is structured as a set of dynamically loaded libraries/passes for LLVM. These libraries can be built separately from the main compiler. However, an existing LLVM build (compiled using cmake) is necessary to build our code.

  1. Extract LLVM 3.7 into llvm

  2. Extract Clang into llvm/tools/clang.

  3. Download the TaskMiner source code.

  4. Apply the patch "llvm-patch.diff" (located at 'taskminer/ArrayInference/llvm-patch.diff') to your LLVM source directory.

  5. Compile a fresh LLVM+Clang 3.7 build:

     #Build a debug version of LLVM+Clang under ${LLVM_SRC}/../llvm-build
     mkdir ${LLVM_SRC}/../llvm-build
     cd ${LLVM_SRC}/../llvm-build
     #Setup clang plugins to be compiled alongside LLVM and Clang
     #Create build setup for LLVM+Clang using CMake
     #Compile LLVM+Clang (this will likely take a while)
     make ${MAKEFLAG}
     cd -
  6. Build TaskMiner:

     # Build the shared libraries under ${REPO}/lib
     # build under ${LLVM_BUILD_DIR}
     mkdir ${REPO}/lib
     cd ${REPO}/lib
     cmake -DLLVM_DIR=${LLVM_BUILD_DIR}/share/llvm/cmake ../src/
     cd -


We have written a script to run TaskMiner. To use it, adjust its flags to your environment, and then do:

./ <path-to-llvm-build-bin-folder> <TaskMiner/lib> <Source_Code> <op1> <op2> <op3>

The following parameters are customizable:

  • path-to-llvm-build-bin-folder: location of the llvm-3.7 binaries.
  • TaskMiner/lib: location of the TaskMiner libraries (.so files).
  • Source-Code: input files that will be analyzed.
  • op1: integer specifying the acceptable runtime cost.
  • op2: flag "-debug-only=print-tasks", used to print tasks (optional).
  • op3: flag "-stats", used to debug the analysis (optional).