Skip to content

Commit

Permalink
doc: updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Jan 9, 2024
1 parent 89f3b4a commit dc215d7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 83 deletions.
136 changes: 54 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-->

# 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 Technical University of Darmstadt and Iowa State University.
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](https://github.com/tuda-parallel) and the 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,
Expand All @@ -24,86 +24,58 @@ DiscoPoP is built on top of LLVM. Therefore, DiscoPoP can perform the above-ment

A more comprehensive overview of DiscoPoP can be found on our [project website](https://www.discopop.tu-darmstadt.de/).

## Wiki
Detailed information about each execution step, the setup as well as the functionality of DiscoPoP and how to contribute can be found on the [wiki page](https://discopop-project.github.io/discopop/).

### Quick Links
- [Quickstart guide - GUI](https://discopop-project.github.io/discopop/Quickstart)
- [Quickstart guide - CMake projects](https://discopop-project.github.io/discopop/Quickstart_CMake)
- [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=TUDarmstadt-LaboratoryforParallelProgramming.discopop)

## Example
DiscoPoP creates parallelization suggestions for sequential source code.
Implementing these suggestions results in a parallel program.
A simple example for the results of the assisted parallelization on the basis of the created parallelization suggestions can be found below.

### Original Source Code
Let's assume the original source code looks as follows:

int foo(int in, int d){
return in * d;
}

int bar(int in, int d){
return in + d;
}

int delta(int in, int d){
return in -d;
}

int main( void)
{
int i;
int d=20,a=22, b=44,c=90;
for (i=0; i<100; i++) {
a = foo(i, d);
b = bar(a, d);
c = delta(b, d);
}
a = b;
return 0;
}

Applying DiscoPop to this program will result in a set of parallelization suggestions.

### Parallel Source Code
For demonstration purposes we have applied the identified and suggested [pipeline pattern](https://discopop-project.github.io/discopop/Pattern_Detection/Patterns/Pipeline/) to the original source code, which resulted in the following parallel source code.
Please refer to the [parallel patterns](https://discopop-project.github.io/discopop/Pattern_Detection/Patterns) page of the [DiscoPoP wiki](https://discopop-project.github.io/discopop/) for a complete overview of the supported parallel patterns.

int foo(int in, int d){
return in * d;
}

int bar(int in, int d){
return in + d;
}

int delta(int in, int d){
return in -d;
}

int main( void)
{
int i;
int d=20,a=22, b=44,c=90;
for (i=0; i<100; i++) {
#pragma omp task firsprivate(i) shared(d, in) depend(out:a)
a = foo(i, d);
#pragma omp task shared(d, in) depend(in:a) depend(out:b)
b = bar(a, d);
#pragma omp task private(c) shared(d, in) depend(in: b)
c = delta(b, d);
}
a = b;
return 0;
}

### Convenience
For a convenient set, configuration, management, application, and browsing of identified parallelization suggestions, please consider using our [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=TUDarmstadt-LaboratoryforParallelProgramming.discopop).



## Getting started
Follow the steps in [setup](setup/discopop.md) to install DiscoPoP.
To setup the [Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=TUDarmstadt-LaboratoryforParallelProgramming.discopop) (recommended for general use of the framework), please follow [these steps](setup/vscx.md).

For a brief introduction into the [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=TUDarmstadt-LaboratoryforParallelProgramming.discopop), please follow the [walk-through example](examples/walk_through_gui.md).
For a brief introduction into the command line tools, please refer to the [tools overview](tools/tools.md) and follow the [command-line walk-through example](examples/walk_through.md).

For detailed information on the gathered and stored data as well as the tools themselves, please refer to [data](data/data.md) and the pages of the individual tools in the [tools overview](tools/tools.md).

## 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](setup/setup.md), contact us via GitHub messages, or get in contact by mail to [[email protected]](mailto:[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
```


## Exemplary output
The following is an automatically generatred, exemplary output patch file generated and applicable as show in the provided [examples](examples/examples.md).
```
--- /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.
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,7 @@ The following is an automatically generatred, exemplary output patch file genera
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.

0 comments on commit dc215d7

Please sign in to comment.