HP aC++/HP C A.06.28 Programmer's Guide Integrity servers (769150-001, March 2014)

bit process, the stack space for each thread is allocated from the heap. The heap defaults 1
gigabyte, and the default stack size is 8 megabytes. See the linker option-N for increasing
data area size to 2 gigabytes.
If the dynamic threads mechanism is disabled, requests for additional threads will result in no
additional threads being created. Programs should not assume that a request will result in
additional threads for all requests. If the dynamic threads mechanism is enabled, requests for
more threads than an implementation can support are satisfied by creating additional pthreads
which are then scheduled by the HP-UX scheduler using a smaller number of threads.
Number of processors: The number of physical processors actually hosting the threads at any
time is the lesser of the number of threads or the number of physical processors on the system.
Creating teams of threads: The number of threads in a team that executes a nested parallel
region is dependent on the number of threads created when the application is started and the
number of threads already in use. The number of threads created at application startup defaults
to the number of processors on the system, but may be increased or decreased using the
OMP_NUM_THREADS environment variable. If all threads are already in use when a nested
parallel region is encountered, the number of threads in the team that executes the parallel
region is one. If all threads are not already in use when a nested parallel region is encountered,
the number of threads in the team used to execute the parallel region will be the lesser of the
number of threads requested by a num_threads clause or the most omp_set_num_threads
call, if any, or the number of threads not already in use. (Section 2.3, page 10 of OpenMP
C/C++ specs).
When schedule(runtime) clause 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 schedule with a chunk size of 1.
In the absence of the schedule clause, the default schedule is static with chunksize computed
as iterations.
An implementation can replace all ATOMIC directives by enclosing the statement in a critical
section. HP implements the ATOMIC clause using a slightly more efficient form of critical section
roughly 60-70% faster than critical, although there is still a runtime call.
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.
omp_set_dynamic: The default for dynamic thread adjustment is 0 (disabled).
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.
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.
168 Exception Handling