Parallel Programming Guide for HP-UX Systems

Data privatization
Directives and pragmas for data privatization
Chapter 6 109
Directives and pragmas for data privatization
This section describes the various directives and pragmas that are
implemented to achieve data privatization. These directives and
pragmas are discussed in Table 6-1.
These directives and pragmas allow you to easily and temporarily
privatize parallel loop, task, or region data. When used with
prefer_parallel, these directives and pragmas do not inhibit
automatic compiler optimizations. This facilitates increased performance
of your shared-memory program. It occurs with less work than is
required when using the standard memory classes for manual
parallelization and synchronization.
The data privatization directives and pragmas are used on local
variables and arrays of any type, but they should not be used on data
assigned to thread_private.
Table 6-1 Data Privatization Directives and Pragmas
Directive / Pragma Description
Level of
parallelism
loop_private
(namelist)
Declares a list of variables and/or
arrays private to the following loop.
Loop
parallel_private
(namelist)
Declares a list of variables and/or
arrays private to the following
parallel region.
Region
save_last[(list)] Specifies that the variables in the
comma-delimited list (also named in
an associated
loop_private(namelist) directive
or pragma) must have their values
saved into the shared variable of the
same name at loop termination.
Loop
task_private
(namelist)
Privatizes the variables and arrays
specified in namelist for each task
specified in the following
begin_tasks/end_tasks block.
Task