Skip to content
Snippets Groups Projects
Commit 680b6688 authored by Xin Li's avatar Xin Li
Browse files

updated number of threads in exercise 4, intro_lab

parent 6aa34171
No related branches found
No related tags found
No related merge requests found
......@@ -154,7 +154,7 @@ Here we are going to implement a second and a third parallel version of the [pi.
### Tasks and questions to be addressed
1) Create two new parallel versions of the [pi.c](pi.c) / [pi.f90](pi.f90) program using the parallel construct ``#pragma omp parallel`` and a) ``#pragma omp critical`` b) ``#pragma omp atomic``.
2) Run the two new parallel codes and take the execution time with 1, 2, 4, 8, 16, 32 threads. Record the timing in a table.
2) Run the two new parallel codes and take the execution time with 1, 2, 4, 8, 16 threads. Record the timing in a table.
3) What would happen if you hadn’t used critical or atomic a shared variable?
4) How does the execution time change varying the number of threads? Is it what you expected?
5) Do the two versions of the code differ in performance? If so, what do you think is the reason?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment