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.
This project contains scripts build Taskminer on unix systems. It was designed to install this compiler on Ubuntu. It is possible to use those scripts on different operating systems in case the user adapts them.
This project contains scripts to install software and update your system. Please, take a look at the bash scripts before running it, case you wanna customize the installation process.
Firstly, define the TaskMiner path into your system. Notice that you need to replace
export TASKMINER_DEST=<path of taskminer>
After that, type the following commands:
git clone https://github.com/gleisonsdm/TaskMiner.git
cd TaskMiner/TaskMiner-Installer
cp install.sh TASKMINER_DEST/.
cp execute_tests.sh TASKMINER_DEST/.
cd ../../
rm -r TaskMiner
cd TASKMINER_DEST
sudo bash install.sh
Firstly, define the TaskMiner path into your system. Notice that you need to replace
export TASKMINER_DEST=<path of taskminer>
After that, type the following commands:
cd TASKMINER_DEST
sudo bash execute_tests.sh
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.
Extract LLVM 3.7 into llvm
Extract Clang into llvm/tools/clang.
Download the TaskMiner source code.
Apply the patch "llvm-patch.diff" (located at '/src/ArrayInference/llvm-patch.diff') to your LLVM source directory.
patch -p1 < "${TASKMINER_PATH}/src/ArrayInference/llvm-patch.diff"
Compile a fresh LLVM+Clang 3.7 build:
MAKEFLAG="-j8"
LLVM_SRC=<path-to-llvm-source-folder>
REPO=<path-to-taskminer-repository>
#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
${REPO}/src/ScopeFinder/setup.sh ${LLVM_SRC}
#Create build setup for LLVM+Clang using CMake
cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_SHARED_LIBS=ON ${LLVM_SRC}
#Compile LLVM+Clang (this will likely take a while)
make ${MAKEFLAG}
cd -
Build TaskMiner:
LLVM_BUILD_DIR=<path-to-llvm-build-folder>
REPO=<path-to-repository>
# 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/
make
cd -
We have written a script to run TaskMiner. To use it, adjust its flags to your environment, and then do:
./run.sh <path-to-llvm-build-bin-folder> <TaskMiner/lib> <Source_Code> <op1>
The following parameters are customizable: