|
ReadingQuestions
OpenMP.htmlReading Questions from other places
- Open MP Videos 1-7 question
Notes:
- Video 4:
- Video 6
- Download the code from the videos from
Mattson_OMP_exercises.zip.
- Unzip the file and it should have a folder called OMP_exercises.
- Copy the folder to LOKI. (If you are using MobaXTerm, you can just drag the folder to the
left side of the screen where the files are listed).
- Navigate to the foloder and edit make.def as follows:
Replace icl with gcc, /Qopenmp with -fopenmp
and obj with o.
- To compile the pi.c program, type make pi. If you get errors, make sure you made the
appropriate changes from the last step.
- To run the pi program, type ./pi (don't as me why the "./" is necessary before the "pi".
It has to do with paths and stuff.).
- Now parallelize it as suggested in the video.
- Note that the code related to omp_get_wtime has already been added, so you don't have to worry about that.
- If you get stuck on parallelizing the code, move on to video 7 and fix your code using his solution.
- FYI, as we move forward, you can compile and run the other programs the same way. Just replace pi
with whatever the other program is called. (The makefile has rules for compiling all of the programs.)
Questions
- Submit your pi.c program using
Webhandin 385-SRQ
- Open MP Videos 8-15 question
- Do the exercise at the end of video 8.
If you have trouble, fix your solution according to his solution
in video 9.
- What is a loop carry dependency?
- What is a reduction?
- Do the exercise from video 11. First, make a copy of your program
and call the new copy pi2.c.
Submit pi2.c using
Webhandin 385-SRQ
- Open MP Video 16-18 question
- In Video 17, make sure you spend some time trying to fix the mandel.c code.
before moving on to video 18.
- In video 18, I think there is a very slight error in the code presented near the end of the video (just after 7:00). What is it?
- Open MP Video 19-22 question
- At the end of video 19 he gives an exercise. Make sure you spend some time trying to
figure it out before moving on to the next video.
- Turn in your finished linked.c from video 19 using
Webhandin 385-SRQ
- Turn in your finished linked2.c (rename it before submitting it) from video 21 using
Webhandin 385-SRQ.
This one should attempt to use tasks.
|