Intel® Fortran Compiler

Developer Guide and Reference

ID 767251
Date 10/15/2026
Public
Document Table of Contents

TRANSPARENT clause

Parallel Directive Clause:Controls the visibility/propagation of dependencies across construct boundaries.

Syntax

TRANSPARENT[(visibility-modifier)]

visibility-modifer

Is an integer scalar expression with kind type OMP_IMPEX_T that evaluates to a value of one of these named constants:

  • OMP_NOT_IMPEX has the value zero. It indicates that dependencies are neither exported from a construct or imported into a construct.

  • OMP_IMPORT has the value one. It indicates that dependencies of surrounding or enclosing constructs are imported into a construct.

  • OMP_EXPORT has the value two. It indicates that dependencies are exported from a construct making them visible in successor or enclosing constructs.

  • OMP_IMPEX has the value three. It indicates that dependencies are both exported out of a construct and imported into it.

The TRANSPARENT clause is a construct dependence propagation mechanism, allowing dependencies of a construct to be visible outside the construct, or for dependencies of a enclosing or surrounding construct to be visible inside the construct.

visibility-modifier controls the direction that the dependency information flows. OMP_EXPORT makes a constructs dependencies visible outside the construct. OMP_IMPORT makes enclosing and surrounding construct dependencies visible inside the construct. OMP_IMPEX both exports dependencies from a construct and imports dependencies into a construct. OMP_NOT_IMPEX neither makes dependencies of the construct visible outside the construct nor makes dependencies outside the construct visible within the construct.

If visibility-modifier is not specified, it is as if OMP_IMPEX had been specified.

Example

The OMP_IMPORT modifier causes dependencies from outside the transparent task to be made visible inside enclosed tasks.


SUBROUTINE example1 ()
  USE omp_lib
  IMPLICIT NONE
  INTEGER :: i

  !$OMP PARALLEL 
  !$OMP SINGLE
    !$OMP TASK DEPEND (OUT : i)
      ! Task 1
      i = 42
    !$OMP END TASK

    !$OMP TASK (TRANSPARENT (OMP_IMPORT) DEPEND (IN : i)
      ! Task 2
      ! Task 2 imports the dependency established by Task 1
      ! Task 1's dependency is therefor visible to tasks enclosed by Task 2
      
      !$OMP TASK 
        PRINT *, "Child of task 2 sees i = ", i
      !$OMP END TASK
    !$OMP END TASK
  
  !$OMP END SINGLE
  !$OMP END PARALLEL

END SUBROUTINE example

In the following example, the inner task's dependence DEPEND (OUT : i) will be exported outward. Thus, the successor task with DEPEND (IN : i) can establish its dependence on the inner task.


SUBROUTINE example2 ()
  USE omp_lib
  IMPLICIT NONE
  INTEGER :: i

  !$OMP PARALLEL
  !$OMP SINGLE
  
    !$OMP TASK TRANSPARENT (OMP_EXPORT)
      !$OMP TASK DEPEND (OUT : i)
        i = 42
      !$OMP END TASK
    !$OMP END TASK

    !$OMP TASK DEPEND (IN : i)
      PRINT *, "Subsequent/successor task sees the value i = ", i
    !$OMP END TASK

  !$OMP END SINGLE
  !$OMP END PARALLEL

END SUBROUITNE example2