24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(<strong>for</strong> example, loops <strong>for</strong> which you specified the<br />

PARALLEL DO directive).<br />

OpenMP Environment Variables<br />

The following environment variables, which are included in the OpenMP standard,<br />

allow you to control the execution of parallel code.<br />

Note: If you specify both the <strong>XL</strong>SMPOPTS environment variable and an OpenMP<br />

environment variable, the OpenMP environment variable takes precedence.<br />

OMP_DYNAMIC Environment Variable<br />

The OMP_DYNAMIC environment variable enables or disables dynamic<br />

adjustment of the number of threads available <strong>for</strong> the execution of parallel regions.<br />

The syntax is as follows:<br />

►► OMP_DYNAMIC= TRUE<br />

FALSE<br />

►◄<br />

If you set this environment variable to TRUE, the run-time environment can adjust<br />

the number of threads it uses <strong>for</strong> executing parallel regions so that it makes the<br />

most efficient use of system resources. If you set this environment variable to<br />

FALSE, dynamic adjustment is disabled.<br />

The default value <strong>for</strong> OMP_DYNAMIC is TRUE. There<strong>for</strong>e, if your code needs to<br />

use a specific number of threads to run correctly, you should disable dynamic<br />

thread adjustment.<br />

The omp_set_dynamic subroutine takes precedence over the OMP_DYNAMIC<br />

environment variable.<br />

OMP_NESTED Environment Variable<br />

The OMP_NESTED environment variable enables or disables nested parallelism.<br />

The syntax is as follows:<br />

►► OMP_NESTED= TRUE<br />

FALSE<br />

►◄<br />

If you set this environment variable to TRUE, nested parallelism is enabled. This<br />

means that the run-time environment might deploy extra threads to <strong>for</strong>m the team<br />

of threads <strong>for</strong> the nested parallel region. If you set this environment variable to<br />

FALSE, nested parallelism is disabled.<br />

The default value <strong>for</strong> OMP_NESTED is FALSE.<br />

The omp_set_nested subroutine takes precedence over the OMP_NESTED<br />

environment variable.<br />

OMP_NUM_THREADS Environment Variable<br />

The OMP_NUM_THREADS environment variable sets the number of threads that<br />

a program will use when it runs. The syntax is as follows:<br />

►► OMP_NUM_THREADS= num ►◄<br />

64 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!