OpenMP* Environment Variables

This topic lists the supported OpenMP* environment variables (with the OMP_ prefix) and Intel-specific environment variables (with the KMP_ prefix) that are Intel extensions.

Standard Environment Variables

Variable

Default

Description

OMP_SCHEDULE

STATIC, no chunk size specified

Sets the run-time schedule type and chunk size.

OMP_NUM_THREADS

Number of processors visible to the operating systems on the system the application is being run.

Sets the maximum number of threads to use for OpenMP* parallel regions if no other value is specified in the application.

OMP_DYNAMIC

.FALSE.

Enables (.TRUE.) or disables (.FALSE.) the dynamic adjustment of the number of threads.

OMP_NESTED

.FALSE.

Enables (.TRUE.) or disables (.FALSE.)nested parallelism.

Intel Extension Environment Variables

Environment Variable

Default

Description

KMP_ALL_THREADS

No enforced limit

Limits the number of simultaneously executing threads in an OpenMP* program.  

If this limit is reached and another native operating system thread encounters OpenMP* API calls or constructs, the program can abort with an error message. If this limit is reached when an OpenMP parallel region begins, a one-time warning message might be generated indicating that the number of threads in the team was reduced, but the program will continue.  

This environment variable is only used for programs compiled with the following options: -openmp or -openmp-profile (Linux and Mac OS) and /Qopenmp or /Qopenmp-profile (Windows).

KMP_BLOCKTIME

200

Sets the time, in milliseconds, that a thread should wait, after completing the execution of a parallel region, before sleeping.

Use the optional character suffixes: s (seconds), m (minutes), h (hours), or d (days) to specify the units.

See also the throughput execution mode and the KMP_LIBRARY environment variable.

KMP_LIBRARY

throughput

Selects the OpenMP run-time library execution mode.  The options for the variable value are throughput (execution mode) or turnaround.

KMP_MONITOR_STACKSIZE

max (32k, system minimum thread stack size)

Sets the number of bytes to allocate for the monitor thread, which is used for book-keeping during program execution.

Use the optional suffixes: b (bytes), k (kilobytes), m (megabytes), g (gigabytes), or t (terabytes) to specify the units.

KMP_STACKSIZE

IA-32 architecture: 2m

Intel(R) 64  and IA-64 architecture: 4m

Sets the number of bytes to allocate for each OpenMP* thread to use as its private stack.

Use the optional suffixes: b (bytes), k (kilobytes), m (megabytes), g (gigabytes), or t (terabytes) to specify the units.

This variable does not affect the native operating system threads created by the user program nor the thread executing the sequential part of an OpenMP* program.

KMP_VERSION

.FALSE.

Enables (.TRUE.) or disables (.FALSE.) the printing of OpenMP run-time library version information during program execution.

KMP_AFFINITY

 

Enables run-time library to bind threads to physical processing units.

See Thread Affinity Interface for more information.