Unit 4.2.2 Basics¶
OpenMP is a standardized API (Application Programming Interface) for creating multiple threads of execution from a single program. For our purposes, you need to know very little:
There is a header file to include in the file(s):
Directives to the compiler (pragmas):
#pragma omp parallel #pragma omp parallel for
A library of routines that can, for example, be used to inquire about the execution environment:
omp_get_max_threads() omp_get_num_threads() omp_get_thread_num()
Environment parameters that can be set before executing the program:
export OMP_NUM_THREADS=4If you want to see what the value of this environment parameter is, execute
Search for "OpenMP" on Wikipedia.
Tim Mattson’s (Intel) “Introduction to OpenMP” (2013) on YouTube.
We suggest you investigate OpenMP more after completing this week.