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

Overwritten values after switching to ifix compiler - Help!

warre371
Beginner
139 Views

I'm using a program that, for years, ran without a problem with ifort. However, when I recently switched to ifx, my code began to blow up. It appears the issue is that one of the arrays in my code (I'll call it array1) is being overwritten with values from another array, as if these two arrays are being assigned to the same memory location.

 

There are dozens of arrays throughout the code, and I have yet to figure out which one is overwriting array1. Also, the memory blocks are only slightly overlapping; only the tail end of array1 is being overwritten.

 

The code never crashes. I never receive a seg error. Instead, the alien values being saved into array1 eventually cause all the values in array1 to turn into NaNs (because of the nature of the calculations I'm doing).

 

I don't know why this error would pop up as soon as I change compilers, especially since this code has been running without a problem for a decade.

0 Kudos
2 Replies
Ron_Green
Moderator
99 Views

Is this with the ifx compiler from 2024.1.0 or 2024.2.0 packages?  What does ifort from the new package do with this code?  

Is this Windows or Linux?

can. you share the code and it's input files (if any)? 

0 Kudos
jimdempseyatthecove
Honored Contributor III
24 Views

Build you code with runtime array bounds checking

jimdempseyatthecove_0-1720118118079.png

 

If your code is indexing out of bounds, this may catch it if your calls are like

call foo(Array)
...
subroutine Foo(Array)
  implicit none
  real :: Array(:) ! use the callers array size
...

It will not necessarily detect if your code is passing array size as an argument

call Foo(Array, N) ! N = size of array (but could be wrong)
...
subroutine Foo(Array, N)
  implicit none
  integer :: N
  real :: Array(N)
...

 

Jim Dempsey

 

 

0 Kudos
Reply