Intel® Fortran Compiler 18.0 Developer Guide and Reference

DEPEND Clause

Parallel Directive Clause: Enforces additional constraints on the scheduling of a task by enabling dependences between sibling tasks in the task region.

It takes one of the following forms:

In Offload Target Control Directives !$OMP TARGET, etc., and TASKING Directive !$OMP TASK:

DEPEND (dependence-type : list)

In Synchronization Directive !$OMP ORDERED

DEPEND (SOURCE) -or-

DEPEND (SINK:vec)

dependence-type

Can be any one of the following clauses: IN, OUT, or INOUT.

For IN, the generated task will be a dependent task of all previously generated sibling tasks that reference at least one of the list items in an OUT or INOUT clause.

For OUT and INOUT, the generated task will be a dependent task of all previously generated sibling tasks that reference at least one of the list items in an IN, OUT, or INOUT clause.

list

Is one or more variables or non-zero length array sections. Any list items used in a DEPEND clause of the same task or sibling tasks must indicate identical storage or disjoint storage. The list items that appear in the DEPEND clause may include array sections.

Note that this enforced task dependence establishes a synchronization of accesses to each list item performed by a dependent task, with respect to accesses to the same list item performed by any previous tasks. You must properly synchronize access with respect to other concurrent accesses to each list item.

SOURCE

Specifies the satisfaction of cross-iteration dependences that arise from the current iteration.

SINK

Specifies a cross-iteration dependence, where the iteration vector vec indicates the iteration that satisfies the dependence.

vec

Is the iteration vector. It has the form:

where n is the value specified by the ORDERED clause in the DO loop directive, xi denotes the loop iteration variable of the i-th nested loop associated with the loop directive, and di is a non-negative integer scalar constant.

If vec does not occur in the iteration space, the DEPEND clause is ignored. Note that if vec does not indicate a lexicographically earlier iteration, it can cause a deadlock.

For a vec element form of xi + di or xi - di, the expression xi + di or xi - di for any value of the integer loop iteration variable xi that can encounter the ordered construct must be computable in the loop iteration variable's type without overflow.

If a DEPEND clause appears in a TARGET or TARGET UPDATE directive, it is treated as if it had appeared on the implicit task construct that encloses the TARGET construct.