<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Overwritten values after switching to ifix compiler - Help! in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615252#M172947</link>
    <description>&lt;P&gt;This checks out with the way the code is formatted. I definitely believe the problem to be something along these lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, do you know of any efficient way for me to figure out which two arrays are overwriting each other (e.g. is there a debugger that I could use for this?). I'm working with a massive legacy code, only the surface of which I've ever interacted with. I've been trying to find the problem by brute force for several weeks and have yet to be successful.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2024 01:37:32 GMT</pubDate>
    <dc:creator>warre371</dc:creator>
    <dc:date>2024-07-16T01:37:32Z</dc:date>
    <item>
      <title>Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1611940#M172839</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 20:11:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1611940#M172839</guid>
      <dc:creator>warre371</dc:creator>
      <dc:date>2024-07-03T20:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1611985#M172846</link>
      <description>&lt;P&gt;Is this with the ifx compiler from 2024.1.0 or 2024.2.0 packages?&amp;nbsp; What does ifort from the new package do with this code?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this Windows or Linux?&lt;/P&gt;
&lt;P&gt;can. you share the code and it's input files (if any)?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 23:31:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1611985#M172846</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2024-07-03T23:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1612302#M172859</link>
      <description>&lt;P&gt;Build you code with runtime array bounds checking&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimdempseyatthecove_0-1720118118079.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/56594i6D710F67219577D3/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="jimdempseyatthecove_0-1720118118079.png" alt="jimdempseyatthecove_0-1720118118079.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your code is indexing out of bounds, this may catch it if your calls are like&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;call foo(Array)
...
subroutine Foo(Array)
  implicit none
  real :: Array(:) ! use the callers array size
...&lt;/LI-CODE&gt;&lt;P&gt;It will not necessarily detect if your code is passing array size as an argument&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;call Foo(Array, N) ! N = size of array (but could be wrong)
...
subroutine Foo(Array, N)
  implicit none
  integer :: N
  real :: Array(N)
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 18:42:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1612302#M172859</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2024-07-04T18:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615251#M172946</link>
      <description>&lt;P&gt;I'm running it with 2024.0.2 ifx on a linux system. I haven't tried compiling the code with the new package's ifort; intel is discontinuing ifort in late 2024, which is the reason I have to switch to ifx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately the code isn't public, so I can't share it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any thoughts!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 01:34:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615251#M172946</guid>
      <dc:creator>warre371</dc:creator>
      <dc:date>2024-07-16T01:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615252#M172947</link>
      <description>&lt;P&gt;This checks out with the way the code is formatted. I definitely believe the problem to be something along these lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, do you know of any efficient way for me to figure out which two arrays are overwriting each other (e.g. is there a debugger that I could use for this?). I'm working with a massive legacy code, only the surface of which I've ever interacted with. I've been trying to find the problem by brute force for several weeks and have yet to be successful.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 01:37:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615252#M172947</guid>
      <dc:creator>warre371</dc:creator>
      <dc:date>2024-07-16T01:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Overwritten values after switching to ifix compiler - Help!</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615511#M172949</link>
      <description>&lt;P&gt;MS VS&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimdempseyatthecove_0-1721148845996.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/57011iBB7FC40842C05622/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="jimdempseyatthecove_0-1721148845996.png" alt="jimdempseyatthecove_0-1721148845996.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Data Breakpoint&lt;/P&gt;&lt;P&gt;Then use loc function to get the address of the cell of interest&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimdempseyatthecove_1-1721149003526.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/57012i4CA8113CF7144988/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="jimdempseyatthecove_1-1721149003526.png" alt="jimdempseyatthecove_1-1721149003526.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This will require you to identify the cell being erroneously overwritten (before it is overwritten).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternate Scenario&lt;/P&gt;&lt;P&gt;If you know a point in your code where you know the array that gets clobbered is built and not modified, snapshot the array into a new array. Then, as you transition from procedure to procedure, you can compare the contents of the array that gets clobbered with the snapshot taken of that array. In this manner you can discover the procedure causing the problem. Place the code in a module&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;module FindMyBug
real, allocatable :: Snapshot(:) ! change for your array type and rank
contains
subroutine Snapshot(YourArray)
  implicit none
  real :: YourArray(:) ! change for your array type and rank
  Snapshot = YourArray
end subroutine Snapshot
subroutine CheckSnapshot(YourArray)
  implicit none
  real :: YourArray(:) ! change for your array type and rank
  integer :: i
  do i=1,size(Snapshot)
    if(Snapshot(i) /= YourArray(i)) then
     print *,"Bug, place breakpoint here"
    endif
  end do
end subroutine CheckSnapshot
end module FindMyBug
...
subroutine foo(args here)
  use FindMyBug
  ...
  ! build your array
  call Snapshot(YourArray)
  ...
  call CheckSnapshot(YourArray)
  call aProcedure(args)
  call CheckSnapshot(YourArray)
  call anotherProcedure(args)
  call CheckSnapshot(YourArray)
  ...&lt;/LI-CODE&gt;&lt;P&gt;The above is sketch code and untested.&lt;/P&gt;&lt;P&gt;As indicated, you will have to modify it for your array type and rank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 17:14:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Overwritten-values-after-switching-to-ifix-compiler-Help/m-p/1615511#M172949</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2024-07-16T17:14:46Z</dc:date>
    </item>
  </channel>
</rss>

