depend(source/sink)

Comments and discussion of the 4.1 OpenMP Draft specifications. Comment period ends September 30, 2015. See http://openmp.org/wp/openmp-specifications/ to download the specifications. (Read Only)
Locked
fewl9012
Posts: 73
Joined: Mon Jul 27, 2015 4:50 pm

depend(source/sink)

Post by fewl9012 »

Example 1:
#pragma omp for ordered(2)
for( i=0;i<n;++i ){
for( j=0;j<m;++j ){
... do something
#pragma omp ordered depend(sink:i-2,j-2)
... do something else
#pragma omp ordered depend(source)
}
}
page 167 line 10: If the iteration vector vec indicates an invalid iteration, the ordered construct with the depend clause is ignored.
Here, i-2,j-2 is invalid when i or j are 0 or 1. Do I have to put a condition around this?

Example 2:
#pragma omp for ordered(2)
for( i=0;i<n; i+=2){
for( j=0;j<m;j+=2 ){
... do something
#pragma omp ordered depend(sink:i-2,j-2)
... do something else
#pragma omp ordered depend(source)
}
}
Are the offsets in the iteration vector trip counts (number of iterations) or index variable values?
In this loop, would depend(sink:i-1,j-1) be invalid (because it indicates an invalid iteration)? If invalid, the construct is supposed to be ignored, but can an implementation always determine that it should be ignored?

Locked