Efficient OpenMP
CMPSC 450
Homework 2 Notes
• Check your work
• Loop unrolling done right • UnrollsizevsN
• Efficient Look-up tables
• Integer math
• Performance increase reporting • Speedup vs wall-time
• Which improvement was the most significant? Why? • Math removal vs memory access
• Threading/Parallelization • Random()
• Names on source code
CMPSC 450
Profiling
• Not much freely available (for OpenMP) • Intel’s Thread Profiler?
CMPSC 450
OpenMP Scheduling
• Five different scheduling types:
• static (default)
• schedule(static,
• Dynamic
• schedule(dynamic,
• Guided
• Schedule(guided,
• auto
• Runtime
• OMP_SCHEDULEenvironmentvariable • omp_set_schedule()
CMPSC 450
Others
• IF clause
• #pragma omp parallel if(N > 1000)
• Nowait
• Single / master vs independent parallel structured blocks
CMPSC 450
Sources:
• http://jakascorner.com/blog/2016/06/omp-for-scheduling.html
CMPSC 450