Giter Site home page Giter Site logo

discopop-project / discopop Goto Github PK

View Code? Open in Web Editor NEW
33.0 5.0 18.0 9.2 MB

DiscoPoP - Discovery of Potential Parallelism

Home Page: http://www.discopop.org

License: BSD 3-Clause "New" or "Revised" License

CMake 0.63% C++ 22.92% Shell 1.54% C 0.32% Python 73.96% Makefile 0.55% Dockerfile 0.06% JavaScript 0.02%
parallelization llvm-pass instrumentation parallel-patterns llvm openmp-parallelization parallel-programming parallelism automatic-parallelization semi-automatic-parallelization

discopop's Introduction

DiscoPoP - Discovery of Potential Parallelism

DiscoPoP is an open-source tool that helps software developers parallelize their programs with threads. It is a joint project of the Laboratory for Parallel Programming @ TU Darmstadt and the Software Analytics and Pervasive Parallelism Lab at Iowa State University.

In a nutshell, DiscoPoP performs the following steps:

  • detect parts of the code (computational units or CUs) with little to no internal parallelization potential,
  • find data dependences among them,
  • identify parallel patterns that can be used to parallelize a code region,
  • and finally, suggest corresponding OpenMP parallelization constructs and clauses to programmers.

DiscoPoP is built on top of LLVM. Therefore, DiscoPoP can perform the above-mentioned steps on any source code that can be transferred into the LLVM IR.

A more comprehensive overview of DiscoPoP can be found on our project website.

Getting started

Follow the steps in setup to install DiscoPoP. To setup the Visual Studio Code Extension (recommended for general use of the framework), please follow these steps.

For a brief introduction to the VSCode Extension, please follow the walk-through example. For a brief introduction to the command line tools, please refer to the tools overview and follow the command-line walk-through example.

For detailed information on the gathered and stored data as well as the tools themselves, please refer to data and the pages of the individual tools in the tools overview.

TL;DR

This example installs DiscoPoP, instruments and builds the provided example, analyzes the results, and prints the identified parallelization suggestions to the console. In case any issues arise during the process, please refer to the detailed setup instructions, contact us via GitHub messages, or get in contact by mail to [email protected].

# setup DiscoPoP
git clone [email protected]:discopop-project/discopop.git
cd discopop
mkdir build && cd build
DP_BUILD=$(pwd)
cmake .. && make
# instrument and build the example code
cd ../example
mkdir build && cd build && cmake -DCMAKE_CXX_COMPILER=${DP_BUILD}/scripts/CXX_wrapper.sh .. && make
# execute instrumented code
./cmake_example
# identify parallel patterns
cd .discopop
discopop_explorer
# create applicable patches from patterns
discopop_patch_generator
# print patches to the console
for f in $(find patch_generator -maxdepth 1 -type d); do
    echo "SUGGESTION: $f"
    cat $f/1.patch
    echo ""
done
# apply patch with id 1
discopop_patch_applicator -a 1
# reset code to the original state
discopop_patch_applicator -C

Exemplary output

The following is an automatically generated, exemplary output patch file generated and applicable as shown in the provided examples.

 --- /home/lukas/temp/discopop_tmp/discopop/example/example.cpp	2024-01-09 10:11:50.369555235 +0100
+++ /home/lukas/temp/discopop_tmp/discopop/example/example.cpp.discopop_patch_generator.temp	2024-01-09 11:14:20.904823624 +0100
@@ -20,6 +20,7 @@
         Arr[i] = i % 13;
     }

+    #pragma omp parallel for shared(Arr,N) reduction(+:sum)
     for(int i = 0; i < N; i++){
         sum += Arr[i];
     }

License

© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.

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.