concurrent

Date:

01-09-2012

NAME

concurrent - indicates that no data dependence exists between array references in different iterations of the loop that follows the directive

SYNOPSIS

#pragma _CRI concurrent [safe_distance=n]
!DIR$ CONCURRENT [ SAFE_DISTANCE=n]
n

An integer that represents the number of additional consecutive loop iterations that can be executed in parallel without danger of data conflict. n must be an integral constant > 0.

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

Scope: Local

The concurrent directive indicates that no data dependence exists between array references in different iterations of the loop that follow the directive. This can be useful for vectorization optimizations.

If safe_distance=n is not specified, the distance is assumed to be infinite, and the compiler ignores all cross-iteration data dependencies.

The concurrent directive is ignored if the safe_distance clause is used and vectorization is requested on the command line.

EXAMPLES

Example 1: concurrent directive

In this C/C++ example, the concurrent directive indicates that the relationship k>3 is true. The compiler will safely load all the array references x[i-k], x[i-k+1], x[i-k+2], and x[i-k+3] during n-th loop iteration.

#pragma _CRI concurrent safe_distance=3

for (i = k + 1; i < n;i++) {
  x[i] = a[i] + x[i-k];
}

Example 2: CONCURRENT directive

In this Fortran example, the CONCURRENT directive informs the optimizer that the relationship K > 3 is true.

The compiler will safely load all the array references X(I-K), X(I-K+1), X(I-K+2), X(I-K+3) during the Ith loop iteration

!DIR$ CONCURRENT SAFE_DISTANCE=3
             DO I = K+1, N
                     X(I) = A(I) + X(I-K)
             ENDDO

SEE ALSO

intro_directives(7)