topic problem with optimization flags in Intel® Fortran Compiler
https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-optimization-flags/m-p/1097536#M125925
<P>I am encountering a strange problem with the fortran intel 17.0.0 compiler (as obtained through “ifort –v”) when compiling with optimization flags with arrays.<BR />
After a series of tests I created the following very simple code to test what is happening.<BR />
<BR />
program matrix_define<BR />
<BR />
implicit none<BR />
<BR />
integer, parameter :: dimen = 3<BR />
real*8 :: A(2, dimen)<BR />
real*8 :: x(3,dimen)<BR />
<BR />
x(1,1) = 5.d0<BR />
x(1,2) = 2.d0<BR />
x(1,3) = 1.d0<BR />
<BR />
x(2,1) = 1.d0<BR />
x(2,2) = 2.d0<BR />
x(2,3) = 3.d0<BR />
<BR />
x(3,1) = 0.d0<BR />
x(3,2) = 0.d0<BR />
x(3,3) = 0.d0<BR />
<BR />
A(2,1:3) = x(1,1:3) - x(2,1:3)<BR />
A(1,1:3) = x(3,1:3) - x(2,1:3)<BR />
<BR />
<BR />
write(*,*) A(1,1:3)<BR />
write(*,*) A(2,1:3)<BR />
<BR />
end program matrix_define<BR />
<BR />
As you notice it is a very simple test. It mainly consists of defining the components of a two-dimensional array A(2,3). When I compile using “ifort” without any flags the program assigns the correct values for all A-array elements.<BR />
However, when compiling with “ifort –fast” the output values of A are messed up:<BR />
The element A(1,2) has the value of A(2,1) while A(2,1) and all other element values are as they should.</P>
<P>I have tested the same code with the same options with intel fortran 12.0 and 10.0 and no problem appears.<BR />
<BR />
Is it possible that there a problem in arrays with optimization flags in intel fortran 17.0?</P>
<P>Thank you very much for your time and efforts!</P>
<P> </P>Fri, 25 Nov 2016 12:22:52 GMTFoteinopoulou__Kater2016-11-25T12:22:52Zproblem with optimization flags
https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-optimization-flags/m-p/1097536#M125925
<P>I am encountering a strange problem with the fortran intel 17.0.0 compiler (as obtained through “ifort –v”) when compiling with optimization flags with arrays.<BR />
After a series of tests I created the following very simple code to test what is happening.<BR />
<BR />
program matrix_define<BR />
<BR />
implicit none<BR />
<BR />
integer, parameter :: dimen = 3<BR />
real*8 :: A(2, dimen)<BR />
real*8 :: x(3,dimen)<BR />
<BR />
x(1,1) = 5.d0<BR />
x(1,2) = 2.d0<BR />
x(1,3) = 1.d0<BR />
<BR />
x(2,1) = 1.d0<BR />
x(2,2) = 2.d0<BR />
x(2,3) = 3.d0<BR />
<BR />
x(3,1) = 0.d0<BR />
x(3,2) = 0.d0<BR />
x(3,3) = 0.d0<BR />
<BR />
A(2,1:3) = x(1,1:3) - x(2,1:3)<BR />
A(1,1:3) = x(3,1:3) - x(2,1:3)<BR />
<BR />
<BR />
write(*,*) A(1,1:3)<BR />
write(*,*) A(2,1:3)<BR />
<BR />
end program matrix_define<BR />
<BR />
As you notice it is a very simple test. It mainly consists of defining the components of a two-dimensional array A(2,3). When I compile using “ifort” without any flags the program assigns the correct values for all A-array elements.<BR />
However, when compiling with “ifort –fast” the output values of A are messed up:<BR />
The element A(1,2) has the value of A(2,1) while A(2,1) and all other element values are as they should.</P>
<P>I have tested the same code with the same options with intel fortran 12.0 and 10.0 and no problem appears.<BR />
<BR />
Is it possible that there a problem in arrays with optimization flags in intel fortran 17.0?</P>
<P>Thank you very much for your time and efforts!</P>
<P> </P>Fri, 25 Nov 2016 12:22:52 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-optimization-flags/m-p/1097536#M125925Foteinopoulou__Kater2016-11-25T12:22:52ZWith my copy of 17.0.1 64-bit
https://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-optimization-flags/m-p/1097537#M125926
<P>With my copy of 17.0.1 64-bit, I get the same result with or without -fast. It does emphasize that you are right not to set -fast blindly.</P>
<P>I have frequently got bad results in recent compilers with combinations of options which are set by -fast, although I don't like to use the entire group. I had an IPS problem report on the subject which was removed from my view recently without notice, so perhaps the compiler team believes it has been corrected.</P>Fri, 25 Nov 2016 22:45:49 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/problem-with-optimization-flags/m-p/1097537#M125926TimP2016-11-25T22:45:49Z