Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The OMP_NUM_THREADS environment variable sets the default number of threads to use during execution, unless that number is explicitly changed by calling the omp_set_num_threads library routine or by an explicit num_threads clause on a parallel directive.
The value of the OMP_NUM_THREADS environment variable must be a positive integer. Its effect depends upon whether dynamic adjustment of the number of threads is enabled. For a comprehensive set of rules about the interaction between the OMP_NUM_THREADS environment variable and dynamic adjustment of threads, see Section 2.3 on page 8.
If no value is specified for the OMP_NUM_THREADS environment variable, or if the value specified is not a positive integer, or if the value is greater than the maximum number of threads the system can support, the number of threads to use is implementation-defined.
Example:
setenv OMP_NUM_THREADS 16
Cross References:
num_threads clause, see Section 2.3 on page 8.
omp_set_num_threads function, see Section 3.1.1 on page 36.
omp_set_dynamic function, see Section 3.1.7 on page 39.