HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

21  Environment Variables

This chapter describes the OpenMP environment variables that specify the settings of the ICVs that affect the execution of OpenMP programs (see Chapter 2). The names of the environment variables must be upper case. Unless otherwise specified, the values assigned to the environment variables are case insensitive and may have leading and trailing white space. Modifications to the environment variables after the program has started, even if modified by the program itself, are ignored by the OpenMP implementation. However, the settings of some of the ICVs can be modified during the execution of the OpenMP program by the use of the appropriate directive clauses or OpenMP API routines.

The following examples demonstrate how the OpenMP environment variables can be set in different environments:

 
setenv OMP_SCHEDULE "dynamic"  
 
export OMP_SCHEDULE="dynamic"  
 
set OMP_SCHEDULE=dynamic  

As defined following Section 2.2 in Section 2.2, device-specific environment variables extend many of the environment variables defined in this chapter. If the corresponding environment variable for a specific device number, including the host device, is set, then the setting for that environment variable is used to set the value of the associated ICV of the device with the corresponding device number. If the corresponding environment variable that includes the _DEV suffix but no device number is set, then the setting of that environment variable is used to set the value of the associated ICV of any non-host device for which the device-number-specific corresponding environment variable is not set. In all cases the setting of an environment variable for which a device number is specified takes precedence.

Restrictions

Restrictions to device-specific environment variables are as follows:

 21.2  Program Execution Environment Variables
  21.2.1  OMP_SCHEDULE
  21.2.2  OMP_STACKSIZE
  21.2.3  OMP_WAIT_POLICY
  21.2.4  OMP_DISPLAY_AFFINITY
  21.2.5  OMP_AFFINITY_FORMAT
  21.2.6  OMP_CANCELLATION
  21.2.7  OMP_DEFAULT_DEVICE
  21.2.8  OMP_TARGET_OFFLOAD
  21.2.9  OMP_MAX_TASK_PRIORITY
 21.3  OMPT Environment Variables
  21.3.1  OMP_TOOL
  21.3.2  OMP_TOOL_LIBRARIES
  21.3.3  OMP_TOOL_VERBOSE_INIT
 21.4  OMPD Environment Variables
  21.4.1  OMP_DEBUG
 21.5  Memory Allocation Environment Variables
  21.5.1  OMP_ALLOCATOR
 21.6  Teams Environment Variables
  21.6.1  OMP_NUM_TEAMS
  21.6.2  OMP_TEAMS_THREAD_LIMIT
 21.7  OMP_DISPLAY_ENV