Intel® Fortran Compiler 18.0 Developer Guide and Reference

IN_REDUCTION

Specifies that a task participates in a reduction. The IN_REDUCTION clause is a reduction participating clause.

IN_REDUCTION (operator | intrinsic: list)

Arguments operator, intrinsic, and list are defined in REDUCTION clause. All the common restrictions for the REDUCTION clause apply to this clause.

A list item that appears in an IN_REDUCTION clause of a TASK construct must appear in a TASK_REDUCTION clause of a construct associated with a TASKGROUP region that includes the participating task in its taskgroup set. The construct associated with the innermost region that meets this condition must specify the same operator or intrinsic as the IN_REDUCTION clause.

In the following example, the IN_REDUCTION clause at (3) must name the same operator (+) and variable (a) as in the TASK_REDUCTION clause in (2). The IN_REDUCTION clause at (4) must name the same operator (*) and variable (a) as in the TASK_REDUCTION clause in (1).

!$omp taskgroup task_reduction(*:a)       ! (1) *:a
    ...
!$omp taskgroup task_reduction(+:a)       ! (2) +:a
!$omp task in_reduction(+:a)              ! (3) +:a matches (2)
    a = a + x
!$omp end task                            ! ends (3) +:a
    ...
!$omp end taskgroup                          ! ends (2) +:a
    ...
!$omp task in_reduction(*:a)              ! (4) *:a matches (1)
    a = a * y
!$omp end task                            ! ends (4) *:a
!$omp end taskgroup                          ! ends (1) *:a

See Also