To enable explicit parallelization with OpenMP directives, compile your program with the cc, CC, or f95 compiler option -xopenmp. The f95 compiler accepts both -xopenmp and -openmp as synonyms.
The -xopenmp flag accepts the keyword sub-options listed in the following table.
|
Note the following additional points:
If you do not specify -xopenmp on the command line, the compiler assumes –xopenmp=none (disable recognition of OpenMP directives) by default.
If you specify -xopenmp but without a keyword sub-option, the compiler assumes –xopenmp=parallel.
Specifying -xopenmp=parallel or -xopenmp=noopt will define the _OPENMP macro to have the decimal value 201307L in C/C++ and 201307 in Fortran, where 2013 is the year and 07 is the month of the OpenMP 4.0 specification.
When debugging OpenMP programs with dbx, compile with -xopenmp=noopt -g to enable full debugging capabilities.
To avoid compilation warning messages, specify an appropriate optimization level explicitly rather than relying on the default value, which is subject to change.
With Fortran, compiling with -xopenmp, -xopenmp=parallel, or -xopenmp=noopt implies -stackvar. See Stacks and Stack Sizes.
When compiling and linking an OpenMP program in separate steps, include -xopenmp in each of the compile and the link steps.
Use the -xvpara option with the -xopenmp option to display compiler warnings about potential OpenMP programming problems (see Scope Checking).