English
Topic 10. OpenMP: parallel regions and loops, reductions, tasks; thread affinity and NUMA
Goal: become familiar with the fork–join model and OpenMP directives; learn to parallelize loops with different kinds of iteration scheduling, use reductions (including user-defined ones), synchronization, and tasks for recursive algorithms, and vectorize loops with the simd directive; master first-touch data initialization, thread binding with the OMP_PLACES and OMP_PROC_BIND variables, and measuring the speedup of C++ programs.
Lecture contents
- The fork–join model and parallel regions — The fork–join model and building OpenMP programs · The parallel region
- Variables, loops, and reductions — Variable scope · Parallel loops · Reductions
- Synchronization, tasks, and simd — Synchronization · Sections and tasks · simd vectorization
- Performance, NUMA, and thread affinity — Performance and scalability · The NUMA architecture · Thread affinity
- Examples and common mistakes — Program examples · Common mistakes