- OpenMP
- GCC
cd $PROJECT_PATH
mkdir bin -p
gcc -std=c99 headers/randomgraph.c -o bin/randomgraph
gcc -std=c99 graph-diameter.c -o bin/graph-diameter-sequential
gcc -std=c99 -fopenmp onePunch.c -o bin/graph-diameter-parallel
Generate graph,
./bin/randomgraph 2000 0.343 1000 7 > simple.in
Use sequential algorithm,
user@machine $ ./bin/graph-diameter-sequential < simple.in
Diameter 42
Time: 55691460 us
Use parallel algorithm,
user@machine $ ./bin/graph-diameter-parallel < simple.in
Diameter 42
Time: 34230955 us