HOME
| OPENMP API Specification: Version 5.1 November 2020

2.16.1  Parallel Worksharing-Loop Construct

Summary The parallel worksharing-loop construct is a shortcut for specifying a parallel construct containing a worksharing-loop construct with a canonical loop nest and no other statements.

Syntax

SVG-Viewer needed.

The syntax of the parallel worksharing-loop construct is as follows:  

 
#pragma omp parallel for [clause[ [,] clause] ... ] new-line 
   loop-nest  

where loop-nest is a canonical loop nest and clause can be any of the clauses accepted by the parallel or for directives, except the nowait clause, with identical meanings and restrictions.

SVG-Viewer needed.

SVG-Viewer needed.

The syntax of the parallel worksharing-loop construct is as follows:  

 
!$omp parallel do [clause[ [,] clause] ... ] 
   loop-nest 
[!$omp end parallel do]  

where loop-nest is a canonical loop nest and clause can be any of the clauses accepted by the parallel or do directives, with identical meanings and restrictions.

If an end parallel do directive is not specified, an end parallel do directive is assumed at the end of the loop-nest.

SVG-Viewer needed.

Description The semantics are identical to explicitly specifying a parallel directive immediately followed by a worksharing-loop directive.

Restrictions The restrictions for the parallel construct and the worksharing-loop construct apply.

Cross References