Hello,
I believe the following code produces an incorrect result:
program main !$ use omp_lib integer a,i !$omp parallel !$omp master do i=1,10 !$omp task firstprivate(i) if(i>5) depend(inout:a) write(*,*) '--->',i !$omp end task enddo !$omp end master !$omp end parallel end program
What happens is the undeferred tasks (those for which the IF clause evaluates to false) are not executed at all, i.e., the code prints:
---> 6
---> 7
---> 8
---> 9
---> 10
The problem disappears if either the IF or DEPEND clause are removed.
I have observed this problem with ifort 15.0.2 and 16.0.1. gfortran 4.9.3 produces the correct result.
Can the developers confirm this is a bug?
Thanks,
Theo