HP aC++/HP C A.06.20 Programmer's Guide
NOTE: vector::clear does not free all of the memory. The storage is put back
into a free pool for that one container.
This does not happen if a thread is canceled. In such cases, use thread specific data or
thread local storage support along with pthread_cleanup_[push|pop] utilities.
pthread_cancel is not supported.
Function Scoping
Theset_terminate, set_unexpected, and set_new_handler, functions apply
to all threads in the process. For information on specific functions, refer to the
appropriate library documentation.
Performance Options
You can use the-D__HPACC_FIXED_REFCNT_MUTEX flag to reduce the amount of
space used for string mutexes and thereby increase performance when using either
-AA or -AP strings. Instead of having one mutex per string, there will be a fixed array
of mutexes shared among all strings. This feature requires C++ runtime version A.05.61
or newer. For additional information refer to the -mt option.
The number of string mutexes defaults to 64 and can be configured by:
export aCC_MUTEX_ARRAY_SIZE=##
You can mix code compiled with and without -D__HPACC_FIXED_REFCNT_MUTEX.
Parallel Programming Using OpenMP
OpenMP is an industry-standard parallel programming model that implements a
fork-join model of parallel execution. The HP C++ OpenMP pragmas are based on the
OpenMP Standard for C/C++, version 2.5.
To view the details about the standard and details about usage, syntax and values,
please go to http://www.openmp.org/drupal/node/view/8.
OpenMP Implementation
This section summarizes some of the OpenMP directives behavior that are described
as implementation-dependent in the OpenMP v2.5 API. Each behavior is
cross-referenced back to its description in the OpenMP v2.5 main specification. HP, in
conformance with the OpenMP v2.5 API, define and document the following behavior.
• Due to resource constraints, it is not possible for an implementation to document
the maximum number of threads that can be created successfully during a
program’s execution. This number is dependent upon the load on the system, the
amount of memory allocated by the program, and the amount of implementation
dependent stack space allocated to each thread. For a 32 bit process, the stack space
Function Scoping 217