Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

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

!$OMP PARALLEL SECTIONS [clause[[,] clause] ...]

[!$OMP SECTION]

   block

[!$OMP SECTION

   block]...

!$OMP END PARALLEL SECTIONS

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.

Example

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

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