<?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:ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1559306#M170243</link>
    <description>&lt;P&gt;I have an update for you on this issue. There is a fix for it in the ifx compiler 2024.1.0 that will be released in a couple of months. &lt;/P&gt;&lt;P&gt;Since ifort is deprecated and will no longer be available by the end of 2024, I recommend that you use ifx when the next release is available.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 02 Jan 2024 23:51:32 GMT</pubDate>
    <dc:creator>Barbara_P_Intel</dc:creator>
    <dc:date>2024-01-02T23:51:32Z</dc:date>
    <item>
      <title>ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508048#M167378</link>
      <description>&lt;H2&gt;Description&lt;/H2&gt;&lt;P&gt;Hello, Intel Fortran compiler developers,&lt;/P&gt;&lt;P&gt;I recently had a piece of code that was supposed to be &lt;STRONG&gt;parallel&lt;/STRONG&gt; and got the correct result using `gfortran`, but `ifort/ifx` gave unexpected results. After checking, it should be clear that &lt;STRONG&gt;an `ifort/ifx` bug&lt;/STRONG&gt; was triggered.&lt;/P&gt;&lt;P&gt;My environment is (for this purpose, I upgraded to&lt;STRONG&gt; the latest oneAPI 2023.2.0&amp;nbsp;&lt;/STRONG&gt;) :&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;Windows-10 OS, AMD R5 2500U;
ifort (Intel(R) 64, Version 2021.10.0 Build 20230609_000000)
ifx (Intel(R) 64, Version 2023.2.0 Build 20230627)&lt;/LI-CODE&gt;&lt;H2&gt;Serial code with `/Qopenmp`&lt;/H2&gt;&lt;P&gt;The serial code is &lt;U&gt;`serial.f90`&lt;/U&gt; in the attachments, note that the above is &lt;STRONG&gt;serial code&lt;/STRONG&gt; without any `OpenMP` syntax, and &lt;STRONG&gt;compiling it using `ifort/ifx` with `/Qopenmp` causes problems (wrong results) when run&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;&amp;gt; ifort /Qopenmp serial.f90; ./serial
&amp;gt; ifx /Qopenmp serial.f90; ./serial
indexing...
searching...
i,j,k= 1 9 118 index= 0
index out of range, bug occurred, using `/libs:dll` option would solve this problem&lt;/LI-CODE&gt;&lt;P&gt;Run this normally with the following command &lt;STRONG&gt;(note `/libs:dll`)&lt;/STRONG&gt; :&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;&amp;gt; ifort serial.f90; ./serial
&amp;gt; ifx serial.f90; ./serial
&amp;gt; ifort /Qopenmp /libs:dll serial.f90; ./serial
&amp;gt; ifx /Qopenmp /libs:dll serial.f90; ./serial
indexing...
searching...&lt;/LI-CODE&gt;&lt;H2&gt;Parallel code with `/Qopenmp`&lt;/H2&gt;&lt;P&gt;Add `OpenMP` syntax to the main program (line 228), the parallel code is &lt;U&gt;`openmp.f90`&lt;/U&gt; in the attachments.&lt;/P&gt;&lt;P&gt;After adding the `OpenMP` syntax, using the corresponding command-line compilation is consistent with the serial code, and using `ifort/ifx` with `/Qopenmp` runs into problems:&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;&amp;gt; ifort /Qopenmp openmp.f90; ./openmp
&amp;gt; ifx /Qopenmp openmp.f90; ./openmp
 indexing...
 searching...
 (key)i,j,k=         255         115         155 (value)index=           0
index out of range, bug occurred, using `/libs:dll` option would solve this problem, output file is `debug.txt`&lt;/LI-CODE&gt;&lt;P&gt;Run this normally with the following command &lt;STRONG&gt;(note `/libs:dll`)&lt;/STRONG&gt; :&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;&amp;gt; ifort openmp.f90; ./openmp
&amp;gt; ifx openmp.f90; ./openmp
&amp;gt; ifort /Qopenmp /libs:dll openmp.f90; ./openmp
&amp;gt; ifx /Qopenmp /libs:dll openmp.f90; ./openmp
indexing...
searching...&lt;/LI-CODE&gt;&lt;P&gt;This code is the smallest replicated example I could find, and it's still 254 lines of code &lt;LI-EMOJI id="lia_confused-face" title=":confused_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I believe that code compiled without `openmp` syntax should behave the same with and without `/Qopenmp`, &lt;STRONG&gt;I think this bug is related to the `/Qopenmp` option&lt;/STRONG&gt;;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Using `/Qopenmp` and `/libs:dll` seems to work, indicating either static linking or incorrect calls to system APIs;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;This is a hash table program. When you run the program, it generates `&lt;STRONG&gt;debug.txt `, which stores the `key/value` pairs output by the program when it runs.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;serial.f90 runs online see link:&amp;nbsp;&lt;A href="https://godbolt.org/z/Tbq6f79bG" target="_self"&gt;https://godbolt.org/z/Tbq6f79bG&lt;/A&gt;.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 15:26:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508048#M167378</guid>
      <dc:creator>zoziha</dc:creator>
      <dc:date>2023-07-25T15:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508551#M167405</link>
      <description>&lt;P&gt;There was a recent discussion about what happens when you compile with -qopenmp (/Qopenmp). There is more than meets the eye. You can read it &lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Qopenmp-when-not-using-OpenMP/m-p/1500340" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 22:32:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508551#M167405</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-07-26T22:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508644#M167413</link>
      <description>&lt;P&gt;Thank you for your reply &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/44501"&gt;@Barbara_P_Intel&lt;/a&gt;&amp;nbsp;, the question in &lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Qopenmp-when-not-using-OpenMP/m-p/1500340" target="_self"&gt;your link&lt;/A&gt; may be an OpenMP-biased discussion of that issue, but the question in this issue may go beyond the basic linking issue with OpenMP, and it may be that OpenMP triggers a related bug about `allocatable` variables in types (maybe it has something to do with heap or stack allocation).&lt;/P&gt;&lt;P&gt;Enabling `/Qopenmp` causes links to change, I can't comment on that.&lt;/P&gt;&lt;P&gt;But for specific code, I enable `/Qopenmp` and the code is good, error-free logic and parallelizable, I store data like `key=1,9,118;value=1` into a hash container, but when I go to access the value with `key=1,9,118`, &lt;STRONG&gt;surprisingly, I find that its value is missing!&lt;/STRONG&gt; Instead of `value=1`, it could be an arbitrary value determined by memory! This behavior that results in a missing value should be unacceptable.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 06:58:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508644#M167413</guid>
      <dc:creator>zoziha</dc:creator>
      <dc:date>2023-07-27T06:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508778#M167418</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/240822"&gt;@zoziha&lt;/a&gt;,&amp;nbsp;you are correct about the link discussion. There is one detail buried in there that could be relevant to you.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;/Qopenmp sets /Qauto automatically making all variables into stack variables by default, instead of declaring them essentially on the heap.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 15:20:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508778#M167418</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-07-27T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508815#M167420</link>
      <description>&lt;P&gt;Sorry for this, I have only the most superficial knowledge of computers, I'm just a student of mechanics.&lt;BR /&gt;What I mean is that whether the compiler's compilation options `/Qopenmp` cause &lt;EM&gt;variables to be placed on the heap or the stack &lt;STRONG&gt;should not affect&lt;/STRONG&gt; the result&lt;/EM&gt; of the computer's calculations, is it right?&lt;BR /&gt;The result of the calculation in this post is weird, &lt;STRONG&gt;implying some kind of bug&lt;/STRONG&gt;? I would actually &lt;STRONG&gt;want to get confirmation&lt;/STRONG&gt; from the compiler developers as to whether there is indeed a bug here :), thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 16:30:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1508815#M167420</guid>
      <dc:creator>zoziha</dc:creator>
      <dc:date>2023-07-27T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509239#M167433</link>
      <description>&lt;P&gt;I compiled the serial.F90 like this, &lt;SPAN&gt;ifx -what -g -O0 -check all serial.F90. &lt;/SPAN&gt;The output indicates there's an uninitialized variable. That could be a reason for the run failure.&lt;/P&gt;
&lt;P&gt;This is a bit of the output. I admit the output is AWEFUL to understand. The first place to look is line 114 in serial.F90,&amp;nbsp;the push_back routine.&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;  #7 0x49b3fe in nnps_key_value_mp_push_back_ /nfs/site/home/b/quad/05928696/serial.F90:114:13
  #8 0x4a7186 in nnps_spatial_hashing_mp_set_ /nfs/site/home/b/quad/05928696/serial.F90:185:14
  #9 0x4af17d in MAIN__ /nfs/site/home/b/quad/05928696/serial.F90:217:14&lt;/LI-CODE&gt;
&lt;P&gt;Yes, ifort does not report this uninitialized variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 19:58:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509239#M167433</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-07-28T19:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509299#M167437</link>
      <description>&lt;P&gt;The `serial.f90` behaves normally without `/Qopenmp`, and only when `/Qopenmp` is enabled I get a runtime error (missing values). I've checked that the values are stored deterministically when pushing values into the hash table, but after storing a large number of values, querying the hash table key-value reveals that values are missing for almost &lt;STRONG&gt;all keys&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Line 114 is the following code, where adding a key-value pair to the end of an `allocatable` array uses the constructor, which should be a &lt;STRONG&gt;false positive warning&lt;/STRONG&gt; here.&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;self%items = [self%items, key_value_constructor(key, value)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The main thing is that the code &lt;STRONG&gt;works fine&lt;/STRONG&gt; with `gfortran` and special `ifort/fix` compilation options (e.g. `/Qopenmp /libs:dll`), whereas the hash table values &lt;STRONG&gt;are lost when using `/Qopenmp` alone&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 03:05:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509299#M167437</guid>
      <dc:creator>zoziha</dc:creator>
      <dc:date>2023-07-29T03:05:37Z</dc:date>
    </item>
    <item>
      <title>Re:ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509698#M167443</link>
      <description>&lt;P&gt;Thank you for taking the time to look at the uninitialized variable reported.&lt;/P&gt;&lt;P&gt;I filed a bug report, CMPLRLLVM-49983. I'll let you know when there's a fix.&lt;/P&gt;&lt;P&gt;This fails the same way on Linux.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jul 2023 16:39:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1509698#M167443</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-07-31T16:39:53Z</dc:date>
    </item>
    <item>
      <title>Re:ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1510554#M167492</link>
      <description>&lt;P&gt;The compiler team continues the triage of this issue using valgrind. Have you used that? It's used to detect memory mismanagement. serial.f90 compiled without /Qopenmp is showing issues with the memory management. We are investigating to find the source of the problem.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2023 18:53:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1510554#M167492</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-08-02T18:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1511098#M167537</link>
      <description>&lt;P&gt;Sorry, I have relatively average performance needs, I use Fortran mostly under Windows, I haven't used valgrind, but I have heard of it.&lt;BR /&gt;My impression of Fortran's semantic environment is that memory problems generally only occur at allocatables and pointers, and this code I think has a high probability of not having memory problems, although I can't 100% guarantee it.&lt;BR /&gt;Since the code runs normally with `gfortran` and `ifort` without `openmp`, the stored data won't and shouldn't be lost, but I'm surprised that you talk about memory management problems in code (`serial.f90`) without `/Qopenmp`.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even with `ifort` enabled `/Qopenmp`, by inserting `print` statements locally, it is possible to see that &lt;STRONG&gt;the data is stored&lt;/STRONG&gt; in the data container, but after returning from the storage action and waiting for the next access, the target data is missing.&lt;/P&gt;&lt;P&gt;(The root cause of this problem here could be very well hidden &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt; )&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 06:00:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1511098#M167537</guid>
      <dc:creator>zoziha</dc:creator>
      <dc:date>2023-08-04T06:00:47Z</dc:date>
    </item>
    <item>
      <title>Re:ifort/ifx BUG: A serial code compiled using `/Qopenmp` runs with an error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1559306#M170243</link>
      <description>&lt;P&gt;I have an update for you on this issue. There is a fix for it in the ifx compiler 2024.1.0 that will be released in a couple of months. &lt;/P&gt;&lt;P&gt;Since ifort is deprecated and will no longer be available by the end of 2024, I recommend that you use ifx when the next release is available.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Jan 2024 23:51:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/ifort-ifx-BUG-A-serial-code-compiled-using-Qopenmp-runs-with-an/m-p/1559306#M170243</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2024-01-02T23:51:32Z</dc:date>
    </item>
  </channel>
</rss>

