Lecture 21
Learning objectives
After this class, you should be able to:
- Use the following OpenMP features to write parallel code:
for
directive andreduction
andprivate
clauses.
Reading assignment
- Section 5.4 - 5.5.
- Lecture 21 slides.
- Lecture 21 example code.
- Page 238.
Exercises and review questions
- Questions on current lecture's material
- Write code to estimate pi using numerical integration, and parallelize it using OpenMP.
- Questions on next lecture's material
- How will you use the
schedule
clauses to perform cyclic distribution of loop indices to the threads (that is, thread t gets iterations t, t+P, t+2P, ... with P threads)?