Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

OpenMP bug when combining IF and DEPEND clauses in a TASK construct

$
0
0

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


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>