- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Build you code with runtime array bounds checking
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page