User and Reference Guide for the Intel® C++ Compiler 14.0

Supported Environment Variables

You can customize your system environment by specifying paths where the Intel® C++ Compiler searches for certain files such as libraries, include files, and configuration files, and certain settings.

Compiler Environment Variables

The Intel® C++ Compiler supports the following environment variables on Linux* and, unless otherwise stated, OS X*:

Environment
Variable

Description

CILK_NWORKERS (Linux*)

Specifies the number of worker threads to use in an Intel® Cilk™ Plus program.

See Set Worker Count.

DYLD_LIBRARY_PATH (OS X*)

Specifies the location for shared objects.

GCCROOT

Specifies the location of the gcc binaries. Set this variable only when the compiler cannot locate the gcc binaries when using the -gcc-name option.

GXX_INCLUDE

Specifies the location of the gcc headers. Set this variable to specify the locations of the GCC installed files when the compiler does not find the needed values as specified by the use of the -gcc-name=<directory-name>/gcc option.

GXX_ROOT

Specifies the location of the gcc binaries. Set this variable to specify the locations of the GCC installed files when the compiler does not find the needed values as specified by the use of the -gcc-name=<directory-name>/gcc option.

IA32ROOT (IA-32 architecture and Intel® 64 architecture)

Points to the directories containing the include and library files for a non-standard installation structure.

ICCCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icc.

ICPCCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icpc.

INTEL_PRE_CFLAGS

INTEL_POST_CFLAGS

Specifies to add a set of Intel® C++ Compiler command line options onto the end of the compile line.

This is an extension to the facility already provided in the compiler configuration file icl.cfg. Command line options can be inserted in the “prefix” position using the __INTEL_PRE_CFLAGS environment variable or in the postfix position using the __INTEL_POST_CFLAGS environment variable. The command line will be built as follows:

Syntax: icl <PRE flags> <flags from configuration file> <flags from the compiler invocation> <POST flags>

Note

The Driver will warn (via Remark) that we are overriding an option because of an environment variable, but only at option -w3 (Linux* and OS X*).

INTEL_CHKP_REPORT_MODE (Linux*)

Changes the pointer checker reporting mode at runtime.

See Finding and Reporting Out-of-Bounds Errors.

INTEL_LICENSE_FILE

Specifies the location for the Intel license file.

LD_LIBRARY_PATH (Linux*)

Specifies the location for shared objects.

PATH

Specifies the directories the system searches for binary executable files.

PROF_DIR

Specifies the directory where profiling files (files with extensions .dyn, .dpi, .spi and so forth) are stored. The default is to store the .dyn files in the source directory of the file containing the first executed instrumented routine in the binary compiled with the prof-gen option.

PROF_DPI

Name for the .dpi file. The default is pgopti.dpi.

TMP

TMPDIR

TEMP

Specifies the location for temporary files. If none of these are specified, the compiler stores temporary files in /tmp.

Intel® MIC Architecture Environment Variables

MIC_ENV_PREFIX

Used to control environment variables passed to the target.

By default, all environment variables set on the host are passed to the target. Setting MIC_ENV_PREFIX passes only environment variables that have a prefix of the value of this variable. For example, setting MIC_ENV_PREFIX=ABC passes only environment variables that have a prefix of ABC.

Note

The MIC_LD_LIBRARY_PATH variable is not stripped and passed to the target, so you cannot use MIC_ENV_PREFIX=ABC to change the LD_LIBRARY_PATH on the target.

For information on passing environment variables to a particular coprocessor, and on passing multiple environment variables to one or all coprocessors, see Setting Environment Variables on the CPU to Modify the Coprocessor's Execution Environment.

MIC_HOST_LOG

A string containing the file name to output traces from the host.

Default: None

Example: MIC_HOST_LOG=/home/user/app/host.log

MIC_LD_LIBRARY_PATH

Specifies the location for target shared objects. LD_LIBRARY_PATH specifies the location for host objects.

MIC_LIBRARY_PATH

Specifies the location for target static libraries. LIBRARY_PATH specifies the location for host static libraries.

MIC_PROXY_IO

Enables (1) or disables (0) the proxy of stderr and stdout, and specifies whether the process wants I/O proxy support between the host and target.

Default: 1

Example: MIC_PROXY_IO=0

MIC_SEP_MONITOR

Enables (1) or disables (0) SEP at offload regions.

Default: 0

Example: MIC_SEP_MONITOR=1

MIC_STACKSIZE

Specifies the stack size of the main thread for the offload. This value is typically much larger than the stack size for individual threads. It corresponds to what you would set with ulimit -s (BASH shell) or limit stacksize (C shell) if you were running natively on either the target or the host.

Set this variable to integerB|K|M|G|T, where:

  • B = bytes

  • K = kilobytes

  • M = megabytes

  • G = gigabytes

  • T = terabytes

Default: 12M

Example: MIC_STACKSIZE=16M

MIC_USE_2MB_BUFFERS

Use 2M pages for (size > MIC_USE_2MB_BUFFERS). Pointer-based variables whose runtime length exceeds the value of this variable will be allocated in large pages.

Set this variable to integerB|K|M|G|T, where:

  • B = bytes

  • K = kilobytes

  • M = megabytes

  • G = gigabytes

  • T = terabytes

Example: MIC_USE_2MB_BUFFERS=64K

OFFLOAD_DEVICES

Restricts the offload process to use only the coprocessors specified as the value of the variable.

Set this variable to a comma separated list of target device numbers in the range 0 to number_of_devices_in_the_system-1, where 0 is the first coprocessor in the system, and number_of_devices_in_the_system-1 is the last coprocessor in the system.

Coprocessors available for offloading are numbered logically. The function _Offload_number_of_devices() returns the number of available coprocessors. Coprocessor indices that you use in the target specifier of the offload pragmas are in the range 0 to number_of_devices_in_the_system-1.

Default: The offload process uses all devices.

Example: OFFLOAD_DEVICES = 1,2

On a system with more than two coprocessors installed, this setting enables the application to use only coprocessors 1 and 2. Offloads to coprocessors 0 or 1 are performed on the first and second physical coprocessors. Offloads to target numbers higher than 1 wrap-around so that all offloads remain within coprocessors 0 and 1. The function _Offload_number_of_devices() executed on a coprocessor return 0 or 1, when the offload is running on the first or second coprocessor.

OFFLOAD_INIT

Specifies a hint to the offload runtime when to initialize targets.

Supported values:

  • on_start: All available coprocessors are initialized before entering main.

  • on_offload: The target is initialized immediately before the first offload to it. Initialization is done only on the target that handles the offload.

  • on_offload_all: All available targets are initialized immediately before the first offload in an application.

Default: on_offload_all

Example: OFFLOAD_INIT=on_start

OFFLOAD_REPORT

Controls printing offload execution time, in seconds, and the amount of data transferred, in bytes. This environment variable is equivalent to using the __Offload_report API.

Supported values:

  • 1: Prints the offload computation time, in seconds.

  • 2: In addition to the information produced at value 1, adds the amount of data transferred between the CPU and the target, in bytes.

  • 3: In addition to the information produced at value 2, gives additional details on offload activity, including device initialization, and individual variable transfers.

Default: None

Example: OFFLOAD_REPORT=1

OpenMP* Environment Variables (OMP_) and Extensions (KMP_)

KMP_AFFINITY

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

Default: scatter, granularity=fine

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

KMP_ALL_THREADS

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, then the program may abort with an error message. If this limit is reached at the time an OpenMP* parallel region begins, a one-time warning message may be generated indicating that the number of threads in the team was reduced, but the program will continue execution.

This environment variable is only used for programs compiled with openmp option .

Default: No enforced limit

KMP_BLOCKTIME

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.

Default: 200 milliseconds

KMP_CPUINFO_FILE

Specifies an alternate file name for file containing machine topology description. The file must be in the same format as /proc/cpuinfo.

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

Default: None

KMP_DETERMINISTIC_REDUCTION

Enables (1) or disables (0) the use of a specific ordering of the reduction operations for implementing the reduction clause for an OpenMP* parallel region. This has the effect that, for a given number of threads, in a given parallel region, for a given data set and reduction operation, a floating point reduction done for an OpenMP* reduction clause will have a consistent floating point result from run to run, since round-off errors will be identical.

Default: 0

KMP_DYNAMIC_MODE

Selects the method used to determine the number of threads to use for a parallel region when OMP_DYNAMIC=true.

Possible values: (asat | load_balance | thread_limit ), where,

  • asat: estimates number of threads based on parallel start time;

  • load_balance: tries to avoid using more threads than available execution units on the machine;

  • thread_limit: tries to avoid using more threads than total execution units on the machine.

Default (IA-32 architecture): load_balance (on all supported OSes)

Default (Intel® 64 architecture): load_balance (on all supported OSes)

Default (Intel® MIC architecture):thread_limit (on supported OSes)

KMP_INHERIT_FP_CONTROL

Enables (1) or disables (0) the copying of the floating point control settings of the master thread to the floating point control settings of the OpenMP* worker threads at the start of each parallel region.

Default: 1

KMP_LIBRARY

Selects the OpenMP* run-time library execution mode. The values for this variable are serial, turnaround, or throughput .

Default: throughput

KMP_MONITOR_STACKSIZE

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.

Default: max (32k, system minimum thread stack size)

KMP_SETTINGS

Enables (1) or disables (0) the printing of OpenMP* run-time library environment variables during program execution. Two lists of variables are printed: user-defined environment variables settings and effective values of variables used by OpenMP* run-time library.

Default: 0

KMP_STACKSIZE

Sets the number of bytes to allocate for each OpenMP* thread to use as its private stack. Recommended size is 16m. Use the optional suffix b (bytes), k (kilobytes), m (megabytes), g (gigabytes), or t (terabytes) to specify the allocation. 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 or parallel programs created using [Q]parallel .

Default (IA-32 architecture): 2M

Default Intel® 64 architecture): 4M

Default (Intel® MIC architecture):4M (on supported OSes)

KMP_VERSION

Enables (1) or disables (0) the printing of OpenMP* run-time library version information during program execution.

Default: disabled.

OMP_DYNAMIC

Enables (1) or disables (0) the dynamic adjustment of the number of threads.

Default: 0

Example syntax: export OMP_DYNAMIC=value

OMP_MAX_ACTIVE_LEVELS

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: [Q]openmp or [Q]parallel .

omp_get_thread_limit() routine returns the value of the limit.

Default: No enforced limit

Related environment variable: KMP_ALL_THREADS. OMP_THREAD_LIMIT overrides KMP_ALL_THREADS.

Example syntax: export OMP_MAX_ACTIVE_LEVELS=value

OMP_PLACES

An explicit ordered list of places specified as either an abstract name describing a set of places or an explicit list of places described by nonnegative numbers. An exclusion operator “!” can also be used to exclude the number or place immediately following the operator.

For explicit lists, the meaning of the numbers and how the numbering is done for a list of nonnegative numbers are implementation defined. Generally, the numbers represent the smallest unit of execution exposed by the execution environment, typically a hardware thread.

Intervals can be specified using the <lower-bound> : <length> : <stride> notation to represent the following list of numbers:

“<lower-bound>, 
<lower-bound> + <stride>, 
..., 
<lower-bound> +(<length>-1)*<stride>.”
When <stride> is omitted, a unit stride is assumed. Intervals can specify numbers within a place as well as sequences of places.
# EXPLICIT LIST EXAMPLE
setenv OMP_PLACES "{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}"
setenv OMP_PLACES "{0:4},{4:4},{8:4},{12:4}"
setenv OMP_PLACES "{0:4}:4:4"

The abstract names listed below should be understood by the execution and runtime environment:

  • threads: Each place corresponds to a single hardware thread on the target machine.
  • cores: Each place corresponds to a single core (having one or more hardware threads) on the target machine.
  • sockets: Each place corresponds to a single socket (consisting of one or more cores) on the target machine.

When requesting fewer places or more resources than available on the system, the determination of which resources of type abstract_name are to be included in the place list is implementation defined. The precise definitions of the abstract names are implementation defined. An implementation may also add abstract names as appropriate for the target platform. The abstract name may be appended by a positive number in parentheses to denote the length of the place list to be created, that is: abstract_name(num-places).

# ABSTRACT NAMES EXAMPLE
setenv OMP_PLACES threads
setenv OMP_PLACES threads(4)

Note

OMP_PLACES environment variable: if any numerical values cannot be mapped to a processor on the target platform the behavior is implementation defined. The behavior is also implementation defined when the OMP_PLACES environment variable is defined using an abstract name.

OMP_NESTED

Enables (1) or disables (0)nested parallelism.

Default: 0

Example syntax: export OMP_NESTED=value

OMP_NUM_THREADS

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

This environment variable applies to both [Q]parallel and [Q]openmp.

Default: Number of processors visible to the operating system.

Example syntax: export OMP_NUM_THREADS=value

OMP_PROC_BIND

Sets the thread affinity policy to be used for parallel regions at the corresponding nested level. Acceptable values are true, false, or a comma separated list, each element of which is one of the following values: master, close, spread.

If set to false, the execution environment may move OpenMP* threads between OpenMP* places, thread affinity is disabled, and proc_bind clauses on parallel constructs are ignored.

Otherwise, the execution environment should not move OpenMP* threads between OpenMP* places, thread affinity is enabled, and the initial thread is bound to the first place in the OpenMP* place list.

If set to master, all threads are bound to the same place as the master thread. If set to close, threads will be bound to successive places, close to where the master thread is bound. If set to spread, the master thread's partition is sub-divided and threads are bound to successive sub-partitions.

If enabled, this is the same as specifying KMP_AFFINITY=scatter. If disabled, this is the same as specifying KMP_AFFINITY=none.

If both OMP_PROC_BIND and KMP_AFFINITY are specified, KMP_AFFINITY settings take precedence. GOMP_CPU_AFFINITY also takes precedence over OMP_PROC_BIND.

Default: false

Note

This environment variable is not supported on the OS X* operating system.

OMP_SCHEDULE

Sets the run-time schedule type and an optional chunk size.

Default: STATIC, no chunk size specified

Example syntax: export OMP_SCHEDULE="kind[,chunk_size]"

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

OMP_STACKSIZE

Sets the number of bytes to allocate for each OpenMP* thread to use as the private stack for the thread. Recommended size is 16M.

Use the optional suffixes: B (bytes), K (Kilobytes), M (Megabytes), G (Gigabytes), or T (Terabytes) to specify the units. If value is specified without suffix, the size is assumed to be K (Kilobytes).

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 or parallel programs created using [Q]parallel.

kmp_{set,get}_stacksize_s() routines set/retrieve the value. kmp_set_stacksize_s() routine must be called from sequential part, before first parallel region is created. Otherwise, calling kmp_set_stacksize_s() has no effect.

Default (IA-32 architecture): 2M

Default (Intel® MIC architecture):4M (on supported OSes)

Default (Intel® 64 architecture): 4M

Related environment variables: KMP_STACKSIZE (overrides OMP_STACKSIZE).

Example syntax: export OMP_STACKSIZE=value

OMP_THREAD_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: [Q]openmp or [Q]parallel .

omp_get_thread_limit() routine returns the value of the limit.

Default: No enforced limit

Related environment variable: KMP_ALL_THREADS (overrides OMP_THREAD_LIMIT).

Example syntax: export OMP_THREAD_LIMIT=value

OMP_WAIT_POLICY

Decides whether threads spin (active) or sleep (passive) while they are waiting.

Default: Passive

Example syntax: export OMP_WAIT_POLICY=value

GNU* Environment Variables and Extensions

CPATH

Specifies path to include directory for C/C++ compilations.

C_INCLUDE_PATH

Specifies path to include directory for C compilations.

CPLUS_INCLUDE_PATH

Specifies path to include directory for C++ compilations.

DEPENDENCIES_OUTPUT

Specifies how to output dependencies for make based on the non-system header files processed by the compiler. System header files are ignored in the dependency output.

GCC_EXEC_PREFIX

Specifies alternative names for the linker (ld) and assembler (as).

GOMP_CPU_AFFINITY

Specifies a list of OS processor IDs.

Default: Affinity is disabled

GOMP_STACKSIZE

This environment variable is a GNU extension recognized by the Intel® OpenMP* compatibility library.

OMP_STACKSIZE overrides GOMP_STACKSIZE. KMP_STACKSIZE overrides OMP_STACKSIZE and GOMP_STACKSIZE.

LIBRARY_PATH

Specifies a colon-separated list of directories, much like PATH.

SUNPRO_DEPENDENCIES

This variable is the same as DEPENDENCIES_OUTPUT, except that system header files are not ignored.

PGO Environment Variables

INTEL_PROF_DUMP_CUMULATIVE

When using interval profile dumping (initiated by INTEL_PROF_DUMP_INTERVAL or the function _PGOPTI_Set_Interval_Prof_Dump) during the execution of an instrumented user application, allows creation of a single .dyn file to contain profiling information instead of multiple .dyn files. If not set, executing an instrumented user application creates a new .dyn file for each interval. Setting this environment variable is useful for applications that do not terminate or those that terminate abnormally (bypass the normal exit code).

INTEL_PROF_DUMP_INTERVAL

Initiates interval profile dumping in an instrumented user application. This environment variable may be used to initiate Interval Profile Dumping in an instrumented application.

PROF_DIR

Specifies the directory in which dynamic information files are created. This variable applies to all three phases of the profiling process.

PROF_DUMP_INTERVAL

Deprecated; use INTEL_PROF_DUMP_INTERVAL instead.

PROF_NO_CLOBBER

Alters the feedback compilation phase slightly. By default, during the feedback compilation phase, the compiler merges data from all dynamic information files and creates a new pgopti.dpi file if the .dyn files are newer than an existing pgopti.dpi file.

When this variable is set the compiler does not overwrite the existing pgopti.dpi file. Instead, the compiler issues a warning. You must remove the pgopti.dpi file if you want to use additional dynamic information files.

Compiler Environment Variables

The Intel® C++ Compiler supports the following environment variables on Windows*:

Environment
Variable

Description

CILK_NWORKERS

Specifies the number of worker threads to use in an Intel® Cilk™ Plus program.

CL

_CL_

Specifies file locations for the Microsoft compiler. Define the files and options you use most often with the CL variable. Note: You cannot set the CL environment variable to a string that contains an equal sign. You can use the pound sign instead. In the following example, the pound sign (#) is used as a substitute for an equal sign in the assigned string: SET CL=/Dtest#100

COV_DIR

Same as PROF_DIR .

COV_DPI

Same as PROF_DPI .

ICLCFG

Specifies a configuration file, which the compiler should use instead of the default configuration file.

INCLUDE

Specifies the directories for the source header files (include files).

INTEL_CHKP_REPORT_MODE

Changes the pointer checker reporting mode at runtime.

INTEL_LICENSE_FILE

Specifies the location for Intel license file

LIB

Specifies the directories for all libraries used by the compiler and linker.

PATH

Specifies the directories the system searches for binary executable files.

INTEL_PRE_CFLAGS

INTEL_POST_CFLAGS

Specifies to add a set of Intel® C++ Compiler command line options onto the end of the compile line.

This is an extension to the facility already provided in the compiler configuration file icl.cfg. Command line options can be inserted in the “prefix” position using the __INTEL_PRE_CFLAGS environment variable or in the postfix position using the __INTEL_POST_CFLAGS environment variable. The command line will be built as follows:

Syntax: icl <PRE flags> <flags from configuration file> <flags from the compiler invocation> <POST flags>

Note

The Driver will warn (via Remark) that we are overriding an option because of an environment variable, but only at option /W5 (Windows*).

PROF_DIR

Specifies the directory where profiling files (files with extensions .dyn, .dpi, .spi and so forth) are stored. The default is to store the .dyn files in the source directory of the file containing the first executed instrumented routine in the binary compiled with [Q]prof-gen option.

PROF_DPI

Name for the .dpi file.

Default: pgopti.dpi

TMP

TMPDIR

TEMP

Several environment variables are supported to specify the location for temporary files. The compiler searches for the following variables in the order specified: TMP, TMPDIR, and TEMP. If none of these variables are found, temporary files are stored in the current directory.

Intel® Graphics Technology Environment Variables (GFX_)

GFX_CPU_BACKUP

Controls whether heterogeneous code is executed on the host when the target is not available.

If the if clause of the offload pragma evaluates to false then the code is executed on the host regardless of the target's availability.

If the if clause of the offload pragma is not provided or evaluates to true and the target and the Intel® Graphics Technology driver supporting offload are available and correctly initialized, then the code is executed on the target. Otherwise, back-up execution on the host depends on the value of GFX_CPU_BACKUP.

To prevent execution from occurring on the host, which causes the application to fail when the target is not available, set GFX_CPU_BACKUP to 0.

To execute on the host when the target is not available, set GFX_CPU_BACKUP to 1. By default, this variable is set to 1, so the code is executed on the host.

Default: 1

GFX_MAX_THREAD_COUNT

Controls the maximum number of target threads to parallelize loop nests annotated with #pragma loop_nest, set before a heterogeneous application is started. Use to override the default maximum value, for example: set GFX_MAX_THREAD_COUNT=32.

Scheduling many threads (e.g. 512) helps hide the latency of some operations, but a large number of threads can increase the cost of offload or negatively affect performance. By default, the runtime automatically determines the maximum thread count.

The real thread count for a particular offload execution can be lower than the maximum, and is determined by the offload runtime, depending on the real iteration space for that execution. See also Fully Using Parallelism Specific to Intel® Graphics Technology.

Default: -1

Example: GFX_MAX_THREAD_COUNT=32

GFX_OFFLOAD_TIMEOUT

By default, the system will not allow for an offload task to execute longer than system recovery timeout period (usually two seconds). The task appear to hang and abnormally terminate after another timeout (defined by this variable). To enable longer execution of your offload tasks, disable recovery on timeout in the system registry (refer to Microsoft documentation for instructions) and set GFX_OFFLOAD_TIMEOUT to a higher value, if 32 seconds are insufficient.

Default: 32 seconds.

GFX_LOG_OFFLOAD

Enables or disables logging of the offload process by setting this to the desirable logging level, from 1 to 3, where 3 has the greatest amount of detail. Enables you to monitor the real thread count as well as distribution of the parallel loop nest’s iteration space using (when set to 2) set GFX_LOG_OFFLOAD=2. To disable logging, set GFX_LOG_OFFLOAD to either an empty string or '0'.

Note

Enabling logging significantly increases the overhead of offload, so it is recommended only for debugging.

GFX_SHOW_TIME

Enables or disables printing timing information at the end of execution.

To disable timer printing, set GFX_SHOW_TIME to either an empty string or 0.

See Offload Timers for GFX.

OpenMP* Environment Variables (OMP_) and Extensions (KMP_)

KMP_AFFINITY

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

Default: noverbose

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

KMP_ALL_THREADS

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, then the program may abort with an error message. If this limit is reached at the time an OpenMP* parallel region begins, a one-time warning message may be generated indicating that the number of threads in the team was reduced, but the program will continue execution.

This environment variable is only used for programs compiled with the following option: [Q]openmp.

Default: No enforced limit.

KMP_BLOCKTIME

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.

Specify infinite for an unlimited wait time.

Default: 200 milliseconds

See also the KMP_LIBRARY environment variable.

KMP_CPUINFO_FILE

Specifies an alternate file name for file containing machine topology description. The file must be in the same format as /proc/cpuinfo.

Default: None

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

KMP_DETERMINISTIC_REDUCTION

Enables (1) or disables (0) the use of a specific ordering of the reduction operations for implementing the reduction clause for an OpenMP* parallel region. This has the effect that, for a given number of threads, in a given parallel region, for a given data set and reduction operation, a floating point reduction done for an OpenMP* reduction clause will have a consistent floating point result from run to run, since round-off errors will be identical.

Default: 0

KMP_DYNAMIC_MODE

Selects the method used to determine the number of threads to use for a parallel region when OMP_DYNAMIC=true. Possible values: (asat | load_balance | thread_limit), where,

  • asat: estimates number of threads based on parallel start time;

  • load_balance: tries to avoid using more threads than available execution units on the machine;

  • thread_limit: tries to avoid using more threads than total execution units on the machine.

Default (IA-32 architecture): load_balance (on all supported OSes)

Default (Intel® 64 architecture): load_balance (on all supported OSes)

Default (Intel® MIC architecture):thread_limit (on supported OSes)

KMP_INHERIT_FP_CONTROL

Enables (1) or disables (0) the copying of the floating point control settings of the master thread to the floating point control settings of the OpenMP* worker threads at the start of each parallel region.

Default: 1

KMP_LIBRARY

Selects the OpenMP* run-time library execution mode. The values for this variable are serial, turnaround, or throughput.

Default: throughput

KMP_MONITOR_STACKSIZE

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.

Default: max (32k, system minimum thread stack size)

KMP_PLACE_THREADS

This environment variable only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Specifies the number of cores, with optional offset value and number of threads per core to use with an OpenMP application, as an alternative to writing explicit affinity settings or a process affinity mask.

value = (  int [ "C" | "T" ] [ delim ] | delim ) 
[ int [ "T" ] [ delim ] ] 
[ int [ "O" ] ];


delim = "," | "x";

"C" indicates cores, "T" indicates threads, "O" indicates an offset.

Note

Specify either cores or threads.

Default: If omitted, the default value is the available number of cores (threads).

Examples:

  • 5C,3T,1O: use 5 cores with offset 1, 3 threads per core.

  • 5,3,1: same as above.

  • 24: use first 24 cores, all available threads per core.

  • 2T: use all cores, 2 threads per core.

  • ,2: same as above.

  • 3x2: use 3 cores, 2 threads per core

  • 4C12O: use 4 cores with offset 12, all available threads per core.

KMP_SETTINGS

Enables (1) or disables (0) the printing of OpenMP* run-time library environment variables during program execution. Two lists of variables are printed: user-defined environment variables settings and effective values of variables used by OpenMP* run-time library.

Default: 0

KMP_STACKSIZE

Sets the number of bytes to allocate for each 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 have any effect on native operating system threads created by the user program or the thread executing the sequential part of an OpenMP* or parallel program using [Q]parallel .

Default (IA-32 architecture): 2M

Default (Intel® 64 architecture): 4M

Default (Intel® MIC architecture):4M (on supported OSes)

KMP_VERSION

Enables (1) or disables (0) the printing of OpenMP* run-time library version information during program execution.

Default: disabled

OMP_DYNAMIC

Enables (1) or disables (0) the dynamic adjustment of the number of threads.

Default: 0

Example syntax: set OMP_DYNAMIC=value

OMP_MAX_ACTIVE_LEVELS

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: [Q]openmp or [Q]parallel .

Default: No enforced limit

omp_get_thread_limit() routine returns the value of the limit.

Related environment variable: KMP_ALL_THREADS (OMP_THREAD_LIMIT overrides KMP_ALL_THREADS.

Example syntax: set OMP_MAX_ACTIVE_LEVELS=value

OMP_NESTED

Enables (1) or disables (0) nested parallelism.

Default: 0

Example syntax: set OMP_NESTED=value

OMP_NUM_THREADS

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

This environment variable applies to both [Q]openmp or [Q]parallel .

Default: Number of processors visible to the operating system on which the program is executed.

Example syntax: set OMP_NUM_THREADS=value

OMP_PLACES

An explicit ordered list of places specified as either an abstract name describing a set of places or an explicit list of places described by nonnegative numbers. An exclusion operator “!” can also be used to exclude the number or place immediately following the operator.

For explicit lists, the meaning of the numbers and how the numbering is done for a list of nonnegative numbers are implementation defined. Generally, the numbers represent the smallest unit of execution exposed by the execution environment, typically a hardware thread.

Intervals can be specified using the <lower-bound> : <length> : <stride> notation to represent the following list of numbers:

“<lower-bound>, 
<lower-bound> + <stride>, 
..., 
<lower-bound> +(<length>-1)*<stride>.”

When <stride> is omitted, a unit stride is assumed. Intervals can specify numbers within a place as well as sequences of places.

# EXPLICIT LIST EXAMPLE
setenv OMP_PLACES "{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}"
setenv OMP_PLACES "{0:4},{4:4},{8:4},{12:4}"
setenv OMP_PLACES "{0:4}:4:4"

The abstract names listed below should be understood by the execution and runtime environment:

  • threads: Each place corresponds to a single hardware thread on the target machine.
  • cores: Each place corresponds to a single core (having one or more hardware threads) on the target machine.
  • sockets: Each place corresponds to a single socket (consisting of one or more cores) on the target machine.

When requesting fewer places or more resources than available on the system, the determination of which resources of type abstract_name are to be included in the place list is implementation defined. The precise definitions of the abstract names are implementation defined. An implementation may also add abstract names as appropriate for the target platform. The abstract name may be appended by a positive number in parentheses to denote the length of the place list to be created, that is: abstract_name(num-places).

# ABSTRACT NAMES EXAMPLE
setenv OMP_PLACES threads
setenv OMP_PLACES threads(4)

Note

OMP_PLACES environment variable: if any numerical values cannot be mapped to a processor on the target platform the behavior is implementation defined. The behavior is also implementation defined when the OMP_PLACES environment variable is defined using an abstract name.

OMP_PROC_BIND

Sets the thread affinity policy to be used for parallel regions at the corresponding nested level. Enables (true) or disables (false) the binding of threads to processor contexts. If enabled, this is the same as specifying KMP_AFFINITY=scatter. If disabled, this is the same as specifying KMP_AFFINITY=none.

Acceptable values: true, false, or a comma separated list, each element of which is one of the following values: master, close, spread.

Default: false

If set to false, the execution environment may move OpenMP* threads between OpenMP* places, thread affinity is disabled, and proc_bind clauses on parallel constructs are ignored. Otherwise, the execution environment should not move OpenMP* threads between OpenMP* places, thread affinity is enabled, and the initial thread is bound to the first place in the OpenMP* place list.

If set to master, all threads are bound to the same place as the master thread. If set to close, threads will be bound to successive places, close to where the master thread is bound. If set to spread, the master thread's partition is subdivided and threads are bound to a single place successive sub-partitions.

Note

KMP_AFFINITY takes precedence over GOMP_CPU_AFFINITY and OMP_PROC_BIND. GOMP_CPU_AFFINITY takes precedence over OMP_PROC_BIND.

OMP_SCHEDULE

Sets the run-time schedule type and an optional chunk size.

Default: STATIC, no chunk size specified

Example syntax: set OMP_SCHEDULE="kind[,chunk_size]"

Note

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.

OMP_STACKSIZE

Sets the number of bytes to allocate for each OpenMP* thread to use as the private stack for the thread. Recommended size is 16M. Use the optional suffixes: B (bytes), K (Kilobytes), M (Megabytes), G (Gigabytes), or T (Terabytes) to specify the units. If value is specified without a suffix, the size is assumed to be K (Kilobytes).

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 or parallel programs created using [Q]parallel.

kmp_{set,get}_stacksize_s() routines set/retrieve the value. kmp_set_stacksize_s() routine must be called from sequential part, before first parallel region is created. Otherwise, calling kmp_set_stacksize_s() has no effect.

Default (IA-32 architecture): 2M

Default (Intel® 64 architecture): 4M

Default (Intel® MIC architecture):4M (on supported OSes)

Related environment variables: KMP_STACKSIZE (overrides OMP_STACKSIZE).

Example syntax: set OMP_STACKSIZE=value

OMP_THREAD_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: [Q]openmp or [Q]parallel .

Default: No enforced limit

omp_get_thread_limit() routine returns the value of the limit.

Related environment variable: KMP_ALL_THREADS (overrides OMP_THREAD_LIMIT).

Example syntax: set OMP_THREAD_LIMIT=value

OMP_WAIT_POLICY

Decides whether threads spin (active) or sleep (passive) while they are waiting.

Default: Passive

Example syntax: set OMP_WAIT_POLICY=value

PGO Environment Variables

INTEL_PROF_DUMP_CUMULATIVE

When using interval profile dumping (initiated by INTEL_PROF_DUMP_INTERVAL or the function _PGOPTI_Set_Interval_Prof_Dump) during the execution of an instrumented user application, allows creation of a single .dyn file to contain profiling information instead of multiple .dyn files. If not set, executing an instrumented user application creates a new .dyn file for each interval. Setting this environment variable is useful for applications that do not terminate or those that terminate abnormally (bypass the normal exit code).

INTEL_PROF_DUMP_INTERVAL

Initiates interval profile dumping in an instrumented user application. This environment variable may be used to initiate Interval Profile Dumping in an instrumented application.

PROF_DIR

Specifies the directory in which dynamic information files are created. This variable applies to all three phases of the profiling process.

PROF_DUMP_INTERVAL

Deprecated; use INTEL_PROF_DUMP_INTERVAL instead.

PROF_NO_CLOBBER

Alters the feedback compilation phase slightly. By default, during the feedback compilation phase, the compiler merges data from all dynamic information files and creates a new pgopti.dpi file if the .dyn files are newer than an existing pgopti.dpi file.

When this variable is set the compiler does not overwrite the existing pgopti.dpi file. Instead, the compiler issues a warning. You must remove the pgopti.dpi file if you want to use additional dynamic information files.

See Also


Submit feedback on this help topic