HP aC++/HP C A.06.25 Programmer's Guide
where [clause1, clause2, ...] indicates that the clauses are optional. There
can be zero or more clauses.
clause can be one or more of the following:
• private(list)
• firstprivate(list)
• default(shared|none)
• shared(list)
• reduction(op:list)
• if (scalar-expression)
• copyin (list)
• num_threads
The parallel pragma defines a parallel region, which is a region of the program that
is executed by multiple threads in parallel. This is the fundamental construct that starts
parallel execution.
OMP PARALLEL FOR Pragma
#pragma omp parallel for [clause1, clause2, ... ]
for-loop
where [clause1, clause2, ...] indicates that the clauses are optional. There can be
zero or more clauses.
The parallel for pragma is a shortcut for a parallel region that contains a single
for pragma. parallel for admits all the allowable clauses of the parallel pragma
and the for pragma except for the nowait caluse.
OMP PARALLEL SECTIONS Pragma
#pragma omp parallel sections [clause1, clause2, ...]
{
[#pragma omp section ]
structured-block
[#pragma omp section
structured-block ]
. . .}
where [clause1, clause2, ...] indicates that the clauses are optional. There can be
zero or more clauses.
The parallel sections pragma is a shortcut for specifying a parallel clause
containing a single sections pragma. parallel sections admits all the allowable
clauses of the parallel pragma and the sections pragma except for the nowait
clause.
148 Pragma Directives and Attributes