Module 10: Open Multi-Processing
Lecture 20: The “omp sections” Directive
The “single” Directive
The single directive specifies that the enclosed section is to be executed by only one thread in team
Format
#pragma omp single [clause[[,] clause] ...]
{
< code − block >
}
Clauses Supported: Single Directive
Private(list)
Firstprivate(list)
Nowait
There is no implied barrier on entry or exit
Work-Sharing Constructs: WORKSHARE Directive
FORTRAN only
This directive divides the execution of the enclosed structured block into separate units of work, each of which is executed
only once.
Format
The structured block must consist of only the following:
Array assignments
Scalar assignment
FORALL statement
FORALL constructs
WHERE statements
WHERE constructs
Atomic constructs
Critical constructs
Parallel constructs