Parallel Programming Guide for HP-UX Systems

OpenMP
Implementation-defined behavior
Chapter 4 89
Implementation-defined behavior
The following summarizes the behaviors that are described as implementation dependent in
this API. Each behavior is cross-referenced back to its description in the OpenMP v2.0 main
specification. HP, in conformance with the OpenMP v2.0 API, defines and documents the
following behavior.
1. SCHEDULE(GUIDED,chunk): chunk specifies the size of the smallest piece, except
possibly the last. The size of the initial piece is computed using the formula
#iterations/(num_threads*2). (Table 1, page 17)
2. When SCHEDULE(RUNTIME) is specified, the decision regarding scheduling is deferred
until run time. The schedule type and chunk size can be chosen at run time by setting the
OMP_SCHEDULE environment variable. If this environment variable is not set, the
resulting schedule defaults to STATIC scheduled with a chunk size of 1 (Table 1, page 17).
3. In the absence of the SCHEDULE clause, the default schedule is STATIC with chunksize
computed as iterations / #threads (Section 2.3.1, page 15).
4. OMP_GET_NUM_THREADS: If the number of threads has not been explicitly set by the
user, the default is the number of physical processors on the system (Section 3.1.2, page
48).
5. OMP_SET_DYNAMIC: The default for dynamic thread adjustment is FALSE (Section
3.1.7, page 51).
6. OMP_SET_NESTED: When nested parallelism is enabled, the number of threads used to
execute nested parallel regions is determined at runtime by the underlying openmp
parallel library implementation-dependent (Section 3.1.9, page 52).
7. OMP_SCHEDULE environment variable: The default value for this environment variable
is STATIC (Section 4.1, page 59).
8. OMP_NUM_THREADS environment variable: The default value is the number of
physical processors on the system (Section 4.2, page 60).
9. OMP_DYNAMIC environment variable: The default value is FALSE (Section 4.3, page
60).
10. An implementation can replace all ATOMIC directives by enclosing the statement in a
critical section (Section 2.5.4, page 27). HP implements the ATOMIC clause using a
slightly more efficient form of critical section roughly 60-70% faster than critical, although
This is still a runtime call.