PARALLEL SECTIONS

OpenMP* Fortran Compiler Directive: Provides an abbreviated way to specify a parallel region containing a single SECTIONS directive. The semantics are identical to explicitly specifying a PARALLEL directive immediately followed by a SECTIONS directive.

Syntax

c$OMP PARALLEL SECTIONS [clause[[,] clause] ...]
[c$OMP SECTION]
     block
[c$OMP SECTION
     block] ...
c$OMP END PARALLEL SECTIONS


c
Is one of the following: C (or c), !, or * (see Syntax Rules for Compiler Directives).


clause
Can be any of the clauses accepted by the PARALLEL or SECTIONS directives.


block
Is a structured block (section) of statements or constructs. You cannot branch into or out of the block.

The last section ends at the END PARALLEL SECTIONS directive.

See Also

OpenMP Fortran Compiler Directives, Optimizing Applications: Combined Parallel and Worksharing Constructs, Optimizing Applications: COPYIN Clause, Optimizing Applications: DEFAULT Clause, Optimizing Applications: OpenMP* Directives and Clauses Summary, Optimizing Applications: PRIVATE, FIRSTPRIVATE, and LASTPRIVATE Clauses, Optimizing Applications: REDUCTION Clause, Optimizing Applications: SHARED Clause, Optimizing Applications: Synchronization Constructs

Example

In the following example, subroutines XAXIS, YAXIS, and ZAXIS can be executed concurrently:

  c$OMP PARALLEL SECTIONS
  c$OMP SECTION
        CALL XAXIS
  c$OMP SECTION
        CALL YAXIS
  c$OMP SECTION
        CALL ZAXIS
  c$OMP END PARALLEL SECTIONS