Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

bug in ifort highly suspected

lacek
Beginner
681 Views

I wrote an ultra-simple fortran program which gives different outputs depending on compiler (ifort or gfortran). In additional I believe the ifort's output to be fraud.

the program is:

program A
integer :: alfa, i,levels
levels=60
!$omp parallel do collapse(2) private(alfa,i) default(shared)
do alfa=1,10
do i=(-levels),levels
print *,i,alfa,levels
end do
end do
!$omp end parallel do
end program A


This should produce (60*2+1)*10 output lines, however the output when using ifort compiler is just:

-60 1 60
-59 1 60
-58 1 60
-57 1 60
-56 1 60
-55 1 60
-54 1 60
-53 1 60
-52 1 60
-51 1 60


Compilation using gfortran returns all 1210 lines.

Is there something extremely easy that I am missing? I noticed that
changing
do i=(-levels),levels
into
do i=-levels,levels

makes ifort-compiled version return 1210 lines as well.

Both 12.0.1.107 and 12.1.??? have been tried.

Regards,
Mateusz cki

0 Kudos
6 Replies
TimP
Honored Contributor III
681 Views
I note that the combination of OpenMP collapse with the parentheses exhibits this bug. collapse seems not well supported.
0 Kudos
lacek
Beginner
681 Views
I suppose that "(Intel)" means you are Intel's employee - it is true?

Did you confirm that the described phenomenon really exists (ie it is not merely a result of corrupted library path etc/ different compiler versions conflict?) and it really is a bug?

Regards,
Mateusz cki
0 Kudos
TimP
Honored Contributor III
681 Views
Yes, I work for Intel, and I saw the problem you pointed out in the corresponding Windows compiler as well.
0 Kudos
oleglebedev
New Contributor I
681 Views
Good day,
I got stange output with the ifort 12.0.3 and 12.1.2 if I type (-levels).
In this case alfa is wrong on output.
I compiled with
FC := ifort -g -traceback -check all -std08 -parallel -openmp
Best, Oleg.
0 Kudos
Steven_L_Intel1
Employee
681 Views
Tim does work for Intel, but is not part of the support team. He is a valuable contributor to these forums.

I can reproduce the problem - it seems related to the use of the COLLAPSE clause. I will report this to the developers. Issue ID is DPD200178142.
0 Kudos
Anonymous66
Valued Contributor I
681 Views

A fix has been found for this issue. We are planning to include it in the next update which is currently scheduled for mid-July.

0 Kudos
Reply