HP aC++/HP C A.06.25 Programmer's Guide
firstprivate
firstprivate(list)
The firstprivate clause provides a superset of the functionality provided by the
private clause. Variables specified in the list have private clause semantics described
earlier. The new private object is initialized, as if there is an implied declaration inside
the structured block and the initializer is the value of the original object.
lastprivate
lastprivate(list)
When lastprivate clause is specified in a loop or section, the value of the lastprivate
variable from either the sequentially last iteration of the associated loop, or the lexically
last section directive is assigned to the variable’s original object. The lastprivate
clause provides a superset of the functionality provided by the private clause.
Variables specified in the list have private clause semantics described earlier.
copyprivate
copyprivate(list)
The copyprivate clause can be used to broadcast values acquired by a single thread
directly to all instances of the private variables in the other threads.
NOTE: The copyprivate clause can only appear on the single directive.
if
if(scalar-expression)
The associated block of code will be executed in parallel if the scalar-expression
evaluates to a non-zero value. Otherwise no parallelization happens and it is executed
sequentially.
Example:
#pragma omp parallel private(x) if (a>b) reduction(+:p)
{
// code to be parallelized only when a is greater than b
}
default
default(shared|none)
Specifying default(shared) clause is equivalent to explicitly listing each currently
visible variable in a shared clause unless it is threadprivate or const-qualified.
A variable referenced in the scope of default(none) should be explicitly qualified
by a private or shared clause.
OpenMP Clauses 151