MASKED

OpenMP* Fortran Compiler Directive: Specifies a block of code to be executed by the primary thread of the team. This feature is only available for ifx.

Syntax

!$OMP MASKED

   loosely-structured-block

!$OMP END MASKED

-or-

!$OMP MASKED

   strictly-structured-block

!$OMP END MASKED

loosely-structured-block

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

strictly-structured-block

Is a Fortran BLOCK construct. You cannot branch into or out of the BLOCK construct.

The binding thread set for a MASKED construct is the current team. A master region binds to the innermost enclosing parallel region.

When the MASKED directive is specified, the other threads in the team skip the enclosed block (section) of code and continue execution. There is no implied barrier, either on entry to or exit from the masked section.

Example

The following example forces the primary thread to execute the routines OUTPUT and INPUT:

  !$OMP PARALLEL DEFAULT(SHARED)
        CALL WORK(X)
  !$OMP MASKED
        CALL OUTPUT(X)
        CALL INPUT(Y)
  !$OMP END MASKED
        CALL WORK(Y)
  !$OMP END PARALLEL

See Also