Sei sulla pagina 1di 6

Sergei Nemnyugin

Lab 7 Task decomposition with OpenMP 3.0

2011

Activity 1 Serial implementation of the Dijkstra all-pairs shortest paths algorithm


Time Required Objective Ten minutes

Measure performance of serial implementation of the Dijkstra all-pairs shortest paths algorithm.

Setting Up
1) Copy file of the serial program Dijkstra_serial.cpp from directory classfiles\Lab07\Templates to directory classfiles\Lab07\Dijkstra_serial. 2) Add Intel compiler to the PATH environment variable: export PATH=$PATH:/opt/intel/compilers/bin

Build and Run Dijkstra Serial Application


1) Navigate to the classfiles\Lab07\Dijkstra_serial directory and start make to build the application: cd classfiles\Lab07\Dijkstra_serial nmake

2) Run the application (Dijkstra_serial.exe). Record elapsed time:____________________________________________________. Repeat 2) at least 5 times and find average:_________________________________. 3) Repeat with different graphs sizes (up to 5000). To do this open source file (Dijkstra_serial.cpp) with notepad text editor and change line: const int N = 500;

Activity 2 OpenMP parallel solution of the Dijkstra all-pairs shortest paths algorithm
Time Required Objective Fifteen minutes

Measure performance of OpenMP parallel implementation of the Dijkstra all-pairs shortest paths algorithm.

Setting Up
Copy file of the OpenMP parallel program Dijkstra_tasks.cpp from classfiles\Lab07\Templates to directory classfiles\Lab07\Dijkstra_tasks. directory

Build and Run OpenMP Parallel Dijkstra Application


1) Navigate to the classfiles\Lab07\Dijkstra_tasks directory and start make to build the application: cd classfiles\Lab07\Dijkstra_tasks nmake

2) Run the application (Dijkstra_tasks.exe). Record elapsed time:____________________________________________________. Repeat 2) at least 5 times and find average:_________________________________. 3) Change number of threads to 2. Repeat 2) at least 5 times and find average:_________________________________. 4) Repeat 3) for a set of numbers of threads. 5) Plot data on the diagram speedup vs. number of threads.

6) Repeat with different graphs sizes (up to 5000). To do this open source file (Dijkstra_tasks.cpp) with notepad text editor and change line: 7) Compare results of Activities 1 and 2. Make a conclusion about efficiency of both versions.

Activity 3 Serial implementation of the Floyds allpairs shortest paths algorithm


Time Required Objective Ten minutes

Measure performance of serial implementation of the Floyds all-pairs shortest paths algorithm.

Setting Up
Copy file of the serial program Floyd_serial.cpp from classfiles\Lab07\Templates to directory classfiles\Lab07\Floyd_serial. directory

Build and Run Floyds Serial Application


1) Navigate to the classfiles\Lab07\Floyd_serial directory and start make to build the application: cd classfiles\Lab07\Floyd_serial nmake

2) Run the application (Floyd_serial.exe). Record elapsed time:____________________________________________________. Repeat 2) at least 5 times and find average:_________________________________. 3) Repeat with different graphs sizes (up to 5000). To do this open source file (Floyd_serial.cpp) with notepad text editor and change line: const int N = 500;

Activity 4 OpenMP parallel solution of the Floyds all-pairs shortest paths algorithm
Time Required Objective Fifteen minutes

Measure performance of OpenMP parallel implementation of the Floyds all-pairs shortest paths algorithm.

Setting Up
Copy file of the OpenMP parallel program Floyd_tasks.cpp from classfiles\Lab07\Templates to directory classfiles\Lab07\Floyd_tasks. directory

Build and Run OpenMP Parallel Floyd Application


1) Navigate to the classfiles\Lab07\Floyd_tasks directory and start make to build the application: cd classfiles\Lab07\Floyd_tasks nmake

2) Run the application (Floyd_tasks.exe). Record elapsed time:____________________________________________________. Repeat 2) at least 5 times and find average:_________________________________. 3) Change number of threads to 2. Repeat 2) at least 5 times and find average:_________________________________. 4) Repeat 3) for a set of numbers of threads. 5) Plot data on the diagram speedup vs. number of threads.

6) Repeat with different graphs sizes (up to 5000). To do this open source file (Floyd_tasks.cpp) with notepad text editor and change line: const int N = 500;

7) Compare results of Activities 1 and 2. Make a conclusion about efficiency of both versions.

Potrebbero piacerti anche