<?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 &amp;gt;&amp;gt;For example, if VOLCHECK is in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173184#M146558</link>
    <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;EM&gt;For example, if VOLCHECK is a scalar real, the optimizer may keep the variable entirely in a register, with no copy in memory, or may update/copy to memory only intermittently.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Also, with optimizations /O2 and above, if VOLCHECK is not used, the generated code will remove the statement (but the Debug symbols still remain).&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2020 15:09:24 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2020-04-28T15:09:24Z</dc:date>
    <item>
      <title>ifort optimizations causing unexpected floating point results</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173180#M146554</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I recently upgraded our FORTRAN&amp;nbsp;application (a finite element code) from Intel 14.0 to Intel 19.0. I also upgraded from Visual Studio 2008 to Visual Studio 2017. After the upgrade, I noticed some unexpected results from floating point operations.&lt;/P&gt;&lt;P&gt;I was able to narrow it down to FORTRAN optimizations. Our application uses "Maximize Speed plus Higher Level Optimizations (/O3)", where I see the problem. I didn't see the problem after disabling optimizations and didn't see these upto "Maximize Speed (/O2)". However, O3 shows the issue with Intel 19.0. This was not a problem with Intel 14.0. Here's a code snippet describing the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;module vol&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;real*8, dimension(:), allocatable::tl_vol&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;end module vol&lt;/P&gt;&lt;P&gt;&amp;nbsp;if (allocated(tl_vol))then&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; deallocate(tl_vol)&lt;BR /&gt;&amp;nbsp;endif&lt;BR /&gt;&amp;nbsp;allocate(tl_vol(1:num_),STAT=IALLOC_ERR)&lt;/P&gt;&lt;P&gt;do n = 1,num_&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;!!num_ is 100000 for this case&lt;BR /&gt;&amp;nbsp; &amp;nbsp; call calc_vol(tl_vol(n))&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;!!This subroutine calculates tl_vol(n)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; write(6,*) 'tl_vol(n)', tl_vol(n)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;!!Output is okay here, tl_vol is small ~E-14&lt;BR /&gt;&amp;nbsp; &amp;nbsp; volcheck = tl_vol(n)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; !!volcheck is 0.0 (why??) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;enddo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me understand what might be going on? Again, this is only a problem when I use O3 for FORTRAN optimization.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Syed&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 22:50:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173180#M146554</guid>
      <dc:creator>Wasif__Syed</dc:creator>
      <dc:date>2020-04-27T22:50:02Z</dc:date>
    </item>
    <item>
      <title>When you combine higher</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173181#M146555</link>
      <description>&lt;P&gt;When you combine higher levels of optimization with&amp;nbsp;symbolic debugging enabled, you may expect only loose synchronization between variables and the values shown for them in the VS debugger. Similarly, you may see the highlighting of the current source line to be jumping back and forth in an annoying manner.&lt;/P&gt;&lt;P&gt;For example, if VOLCHECK is a scalar real, the optimizer may keep the variable entirely in a register, with no copy in memory, or may update/copy to memory only intermittently. The value shown for it (in the locals list&amp;nbsp;or by hovering on the variable in the code panel) may be stale or not yet available.&lt;/P&gt;&lt;P&gt;If there is a compiler bug associated with /O3, you will need to run the debugger at the assembly level to establish that the bug exists.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 11:36:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173181#M146555</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2020-04-28T11:36:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for the reply. I don't</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173182#M146556</link>
      <description>&lt;P&gt;Thanks for the reply. I don't only see the problem in the debugger but while running the actual application as well (x64 release executable). I confirmed this by printing out the value of VOLCHECK. VOLCHECK is used for calculations downstream, which become NaN due to it being zero.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 12:02:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173182#M146556</guid>
      <dc:creator>Wasif__Syed</dc:creator>
      <dc:date>2020-04-28T12:02:25Z</dc:date>
    </item>
    <item>
      <title>Not much can be done until</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173183#M146557</link>
      <description>&lt;P&gt;Not much can be done until you are able to provide a "reproducer" -- a program that demonstrates the claimed/suspected optimization bug, while being as short as possible and can be obtained with a reasonable amount of work.&lt;/P&gt;&lt;P&gt;A question&amp;nbsp;that surfaces with reports of optimizer bugs is: how can we be sure that the cause of the bug is the optimizer rather than an error in the source code or program logic?&lt;/P&gt;&lt;P&gt;Adding print statements often inhibits optimization. If your printing occurs far away from the place in the code where the bug was generated, however, such inhibition may not have occurred.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 12:28:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173183#M146557</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2020-04-28T12:28:03Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;For example, if VOLCHECK is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173184#M146558</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;EM&gt;For example, if VOLCHECK is a scalar real, the optimizer may keep the variable entirely in a register, with no copy in memory, or may update/copy to memory only intermittently.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Also, with optimizations /O2 and above, if VOLCHECK is not used, the generated code will remove the statement (but the Debug symbols still remain).&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:09:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-optimizations-causing-unexpected-floating-point-results/m-p/1173184#M146558</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2020-04-28T15:09:24Z</dc:date>
    </item>
  </channel>
</rss>

