Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Wrong code when using OpenMP collapse

Vladimir_F_1
초급자
444 조회수

Hello,
 i encountered a behavior I believe is a bug in ifort 14.0.2 which took me quite a lot of time to find.

  implicit integer(a-z)
  nx = 10
  ny = 10
  nz = 10
  tnx = 2
  tny = 2
  tnz = 2


  !$omp parallel do collapse(3)
  do bk = 1, nz, tnz
   do bj = 1, ny, tny
    do bi = 1, nx, tnx
     do k = bk, min(bk+tnz-1,nz)
      do j = bj, min(bj+tny-1,ny)
       do i = bi, min(bi+tnx-1,nx)
        if (i==1.and.j==1.and.k==1) print *,"*"
       end do
      end do
     end do
    end do
   end do
  end do
  !$omp end parallel do
end

This should print just one "*", but prints more of them

lada@meop37:~/f/testy/errors> ifort -openmp collapse.f90 
lada@meop37:~/f/testy/errors> ./a.out 
 *
 *
 *
 *
 *
lada@meop37:~/f/testy/errors> OMP_NUM_THREADS=1 ./a.out 
 *
 *
 *
 *
 *
lada@meop37:~/f/testy/errors> OMP_NUM_THREADS=10 ./a.out 
 *
 *
 *
 *
 *
lada@meop37:~/f/testy/errors> f90 -openmp collapse.f90 
f90: Warning: Optimizer level changed from 0 to 3 to support parallelized code.
lada@meop37:~/f/testy/errors> ./a.out 
 *

 

 

 

 

 

0 포인트
5 응답
Vladimir_F_1
초급자
444 조회수

Obviously, "private(i,j,k,bi,bj,bk)" is missing there, but that doesn't change the behavior.

0 포인트
pbkenned1
직원
444 조회수

Hello Vladimir,

Thanks for reporting this. I'll investigate and follow up.

Patrick

0 포인트
pbkenned1
직원
444 조회수

Straightforward defect, reported to compiler engineering with tracking ID DPD200255773.  I'll keep this thread updated with any news.

Patrick

0 포인트
Vladimir_F_1
초급자
444 조회수
Are there any news about this problem? I still can reproduce it in intel/15.0.2.164 on the Archer supercomputer. It is very annoying.
0 포인트
Kevin_D_Intel
직원
444 조회수

Unfortunately there is no progress to report. The issue is unchanged with our latest 16.0 compiler release also. I pinged Development for some status.

0 포인트
응답