Giter VIP home page Giter VIP logo

taskminer's Introduction

TaskMiner - Automatic Annotation of C with OpenMP

Description

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.

Installating

Automatic Installating

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.

Warning

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.

How to install TaskMiner using the scripts

Firstly, define the TaskMiner path into your system. Notice that you need to replace with the directory you want to install TaskMiner.

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

How to use TaskMiner test framework to annotate programs:

Firstly, define the TaskMiner path into your system. Notice that you need to replace with the directory you want to install TaskMiner.

export TASKMINER_DEST=<path of taskminer>

After that, type the following commands:

cd TASKMINER_DEST
sudo bash execute_tests.sh

Manual Installating

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 '/src/ArrayInference/llvm-patch.diff') to your LLVM source directory.

     patch -p1 < "${TASKMINER_PATH}/src/ArrayInference/llvm-patch.diff"
    
  5. 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 -
    
  6. 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 -
    

Running

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:

  • 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.