OpenMP

OpenMP (Open Multi-Processing) is an API that supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran, on most processor architectures and operating systems. To enable omp directives the appropriate option must be used.

OpenMP Flags

Option GNU Option Intel Option PGI Description
-fopenmp -openmp -mp Enable omp directives
-floop-parallelize-all -parallel -Mconcur Performs shared-memory auto-parallelization.

OpenMP Envirnment Variables

Variable Default Description
OMP_NUM_THREADS Number of processors (20) Max num. threads
OMP_SCHEDULE {INTEL} STATIC, no chunk size specified, {GNU} DYNAMIC, chunk size =1 run-time schedule
OMP_DYNAMIC FALSE dynamic adjustment of number of threads
OMP_NESTED FALSE nested parallelism
OMP_MAX_ACTIVE_LEVELS unlimited maximum number of nested parallel region
OMP_STACKSIZE {INTEL 4M} {GNU System dependent} number of bytes to allocate for each OpenMP thread
OMP_THREAD_LIMIT NO Limits the number of simultaneously executing threads in an OpenMP program
GNU
GOMP_CPU_AFFINITY system dependent Bind threads to specific CPUs
OMP_WAIT_POLICY threads wait actively for a short time before waiting passively How waiting threads are handled
GOMP_DEBUG Enable debugging output
GOMP_STACKSIZE System dependent Set default thread stack size
OMP_PROC_BIND True Whether theads may be moved between CPUs
INTEL
KMP_ALL_THREADS No enforced limit
KMP_BLOCKTIME 200 milliseconds
KMP_LIBRARY throughput
KMP_STACKSIZE 4m
KMP_AFFINITY noverbose,respect,granularity=core

GNU libgomp

INTEL openmp