2. Compiling and Running OpenMP Programs
2.2 OpenMP Environment Variables
2.2.1 Common OpenMP Environment Variables
2.2.2 Solaris Studio Specific Environment Variables
2.3.3 Interpreting the Value Specified for SUNW_MP_PROCBIND
2.3.4 Interaction with OS Processor Sets
2.5 Checking and Analyzing OpenMP Programs
3. Implementation-Defined Behaviors
6. Automatic Scoping of Variables
To enable explicit parallelization with OpenMP directives, compile your program with the cc, CC, or f95 option flag -xopenmp. (The f95 compiler accepts both -xopenmp and -openmp as synonyms.)
The -xopenmp flag accepts the following keyword sub-options.
|
Additional Notes:
If you do not specify —xopenmp on the command line, the compiler assumes —xopenmp=none (disabling recognition of OpenMP pragmas).
If you specify —xopenmp but without a keyword sub-option, the compiler assumes —xopenmp=parallel.
Specifying -xopenmp=parallel or noopt will define the _OPENMP preprocessor token to be YYYYMM (specifically 200805L for C/C++ and 200805 for Fortran 95).
When debugging OpenMP programs with dbx, compile with -xopenmp=noopt -g
The default optimization level for -xopenmp might change in future releases. Compilation warning messages can be avoided by specifying an appropriate optimization level explicitly.
With Fortran 95, -xopenmp , -xopenmp=parallel, -xopenmp=noopt will add -stackvar automatically.
When compiling and linking an OpenMP program in separate steps, include -xopenmp on each of the compile and the link steps.
Use the -xvpara C/C++ option or the —vpara Fortran 95 option to display compiler parallelization messages.
For best performance and functionality on Solaris platforms, make sure that the latest OpenMP runtime library, libmtsk.so, is installed on the running system.