Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

4. Environment Variables 

This chapter describes the OpenMP C and C++ API environment variables (or equivalent platform-specific mechanisms) that control the execution of parallel code. The names of environment variables must be uppercase. The values assigned to them are case insensitive and may have leading and trailing white space. Modifications to the values after the program has started are ignored.

The environment variables are as follows:

  • OMP_SCHEDULE sets the run-time schedule type and chunk size.

  • OMP_NUM_THREADS sets the number of threads to use during execution.

  • OMP_DYNAMIC enables or disables dynamic adjustment of the number of threads.

  • OMP_NESTED enables or disables nested parallelism.

The examples in this chapter only demonstrate how these variables might be set in Unix C shell (csh) environments. In Korn shell and DOS environments the actions are similar, as follows:

csh:

setenv OMP_SCHEDULE "dynamic"

ksh:

export OMP_SCHEDULE="dynamic"

DOS:

set OMP_SCHEDULE="dynamic"

Community Additions

ADD
Show:
© 2015 Microsoft