Issue with optimized compilation with ifort?

Issue with optimized compilation with ifort?

Dear expert,

I've been staring on this issue all day, and believe the compiler has an bug when compiling with flags "-O3 -fast". I've tried to distil the code into the simplest case displaying the issue. Compiling as

   ifort  -O3 -fast  numeric_aux.f90 test.f90

gives faulty code (stdout below) whereas

   ifort   numeric_aux.f90 test.f90

produces code giving the intended output. The former (faulty code) produces the output:

 x0    =   2.00000000000000     
 x1    =   8.00000000000000     
 x     =   2.12246204830937        2.51984209978975        2.82842712474619     
   3.17480210393640        3.56359487256136        4.00000000000000     
   4.48984819323749        5.03968419957949        5.65685424949238     
   6.34960420787280        7.12718974512271        8.00000000000000     
 walls =   2.00000000000000        2.24492409661875        2.51984209978975     
   2.82842712474619        3.17480210393640        3.56359487256136     
   4.00000000000000        4.48984819323749        5.03968419957949     
   5.65685424949238        6.34960420787280        7.12718974512271     
   8.00000000000000     
 dx    =  0.244924096618746       0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000
  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000

i.e. the output array dx is not set. The pattern is fragile, i.e. it (may) disappear if I change array dimension n or for instance uncomments the write statement in subroutine setup_exponential_grid. I use the following configuration

ifort version 17.0.2
OS       == Ubuntu 16.04.5 LTS
Hardware == HP ZBook 15G3

I've removed the stack limit with "ulimit -s unlimited", as I previously had problems with automatic fortran variables

AdjuntoTamaño
Descargarapplication/octet-stream numeric_aux.f901.44 KB
Descargarapplication/octet-stream test.f90427 bytes
publicaciones de 4 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Do you have the same results with 19.0.2 compiler? I do not see it with 19.0.2.

Devorah - Intel® Developer Support

Indeed, the issue is there with 17.0.8, but neither 18.0.5 nor 19.0.2.

Thank you for prompt answers - it seems like time to upgrade my ifort compiler.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya