<?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: OpenMP with libs:static cause memory leak in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293341#M156510</link>
    <description>&lt;P&gt;Linking to DLL libraries saves space, reduces memory load, and allows for DLLs to be updated without requiring a relink. Microsoft changed its defaults many years back to default to DLL linking. In the case of OpenMP, I recall a claim that there were run-time issues caused by use of a static library for OpenMP. I don't recall the details, and note that a static OMP library is still provided on Linux, but that is a different environment.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 16:23:01 GMT</pubDate>
    <dc:creator>Steve_Lionel</dc:creator>
    <dc:date>2021-06-25T16:23:01Z</dc:date>
    <item>
      <title>OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1292756#M156478</link>
      <description>&lt;H1&gt;Here is the code:&lt;/H1&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;
    program main

    implicit none
    integer                         :: i
    
    type Element
        real(8),allocatable         :: eForce(:)                
    end type Element
    
    type (Element),allocatable      :: elems(:)
   
    
    allocate(elems(100))
    
    !$omp parallel do private (i) schedule (guided)
    do i=1,100
        allocate(elems(i)%eForce(1000000))
        elems(i)%eForce=1.
    end do
    !$omp end parallel do
    
    write(*,*) "befor clean..."
    do while (.true.)
        write(*,fmt='(a,\)') "input 1 to continue："
        read(*,*) i
        if(i.eq.1) exit
    end do    
    
    deallocate(elems)
    
    write(*,*) "clean finished..."
    do while (.true.)
        write(*,fmt='(a,\)') "input 1 to continue："
        read(*,*) i
        if(i.eq.1) exit
    end do  
    
    end program main
    
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I choose "Debug Multithreaded (/libs:static /threads /dbglibs)" in project property, after clean the allocated memory, the memory usage is still near 1GB&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EruditePig_0-1624506761075.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/17753i0FD66046EE85E317/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="EruditePig_0-1624506761075.png" alt="EruditePig_0-1624506761075.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EruditePig_1-1624506806727.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/17754iE59F85A2C5A90EE1/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="EruditePig_1-1624506806727.png" alt="EruditePig_1-1624506806727.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, If I choose "Debug Multithread DLL (/libs:dll /threads /dbglibs)", deallocate will perform right.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EruditePig_2-1624506872552.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/17755iDE82195905364FDC/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="EruditePig_2-1624506872552.png" alt="EruditePig_2-1624506872552.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EruditePig_3-1624506911177.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/17756i61084C94E4A38EBC/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="EruditePig_3-1624506911177.png" alt="EruditePig_3-1624506911177.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I notice that IVF stop support for static link of OpenMP (&lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-Static-Library-with-OpenMP-enabled/td-p/1014804)，Is" target="_blank" rel="noopener"&gt;https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-Static-Library-with-OpenMP-enabled/td-p/1014804)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to the thread, Am i wrong to choose the libs:static option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Intel Fortran version I used is&amp;nbsp;19.1.0.166&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 03:58:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1292756#M156478</guid>
      <dc:creator>EruditePig</dc:creator>
      <dc:date>2021-06-24T03:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1292945#M156488</link>
      <description>&lt;P&gt;/libs:static doesn't affect the OpenMP library, which is DLL-only. Have you tried a more recent compiler and runtime library?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:40:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1292945#M156488</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-06-24T14:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293099#M156503</link>
      <description>&lt;P&gt;the attachment is the solution,&amp;nbsp;&lt;SPAN&gt;The Intel Fortran version I used is&amp;nbsp;19.1.0.166 , the VisualStudio version is 16.9.0&lt;BR /&gt;Both are recent updated software&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 00:27:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293099#M156503</guid>
      <dc:creator>EruditePig</dc:creator>
      <dc:date>2021-06-25T00:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293301#M156506</link>
      <description>&lt;P&gt;I can reproduce the difference using the 2021.0.2 compiler and libraries. What causes it, I don't know., but I do know that there can sometimes be issues mixing DLL and static linked code. If you have paid support I suggest you report this through the &lt;A href="https://supporttickets.intel.com/?lang=en-US" target="_self"&gt;Intel Online Service Center&lt;/A&gt;. But the most pragmatic approach would be to use DLL linking, which is the default.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 14:24:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293301#M156506</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-06-25T14:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293312#M156507</link>
      <description>&lt;P&gt;Why is the default dll, it makes a lot more sense to bind in the lib.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 14:58:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293312#M156507</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2021-06-25T14:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293341#M156510</link>
      <description>&lt;P&gt;Linking to DLL libraries saves space, reduces memory load, and allows for DLLs to be updated without requiring a relink. Microsoft changed its defaults many years back to default to DLL linking. In the case of OpenMP, I recall a claim that there were run-time issues caused by use of a static library for OpenMP. I don't recall the details, and note that a static OMP library is still provided on Linux, but that is a different environment.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:23:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293341#M156510</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2021-06-25T16:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: OpenMP with libs:static cause memory leak</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293349#M156511</link>
      <description>&lt;P&gt;but in the days of Microsoft Fortran you created a single file that sat on a floppy and just ran, now it is a convoluted set of dlls.&amp;nbsp; Bring back MS Fortran V 3.03 and twin floppy drives, the modern youth are spoiled.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 16:48:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-with-libs-static-cause-memory-leak/m-p/1293349#M156511</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2021-06-25T16:48:45Z</dc:date>
    </item>
  </channel>
</rss>

