HP aC++/HP C A.06.25 Programmer's Guide
• OMP_SCHEDULE environment variable: The default value for this environment
variable is STATIC.
• OMP_NUM_THREADS environment variable: The default value is the number of
physical processors on the system.
• OMP_DYNAMIC environment variable: The default value is FALSE.
OpenMP Header File
Every C++ program that contains OpenMP pragmas is to be compiled for the current
version of HP-UX and must include the header file <omp.h>. If it does not, the OpenMP
pragmas are ignored. The default path for <omp.h> is /usr/include.
OpenMP Library
The OpenMP APIs are defined in the library libomp.
+O[no]openmp Command Line Option
The +Oopenmp option is accepted at all optimization levels. The +Oopenmp option
enables the recognition of OpenMP pragmas. Using the +Onoopenmp option will ignore
all OpenMP directives silently.
See Chapter 3: “Pragma Directives and Attributes” (page 127) for more information on
OpenMP pragmas.
_OPENMP Macro
The _OPENMP macro name is defined by OpenMP compliant implementation as the
decimal constant 200203. This macro must not be the subject of #define or #undef
preprocessing directive. Following is an example of conditional compilation:
#ifdef _OPENMP
iam = omp_get_thread_num() + index;
#endif
Environment Variables in OpenMP
The OpenMP environment variables recognized by HP aC++ compiler control the
execution of parallel code. Note that the environment variable names are case sensitive
and they must be in uppercase.
The following environment variables are available in HP aC++ compiler:
• OMP_SCHEDULE
• OMP_NUM_THREADS
• OMP_DYNAMIC
• OMP_NESTED
OMP_SCHEDULE
export OMP_SCHEDULE="kind[,chunk_size]"
Parallel Programming Using OpenMP 221