<?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 problem with data share about calling dll in openmp in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787343#M326</link>
    <description>If your DLL function is using "local" arrays .AND. if the function is not declared with RECURSIVE (or with -openpm) then the local arrays are attributed withSAVE. IOW&lt;BR /&gt;&lt;BR /&gt; real:: vec(3)&lt;BR /&gt;&lt;BR /&gt;is a SAVE'e (shared)array.&lt;BR /&gt;&lt;BR /&gt;Your DLL function has to be compiled either a) with RECURSIVE or b) with -openmp option (eventhough it is not using !$OMP... code.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Jul 2011 22:30:49 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2011-07-19T22:30:49Z</dc:date>
    <item>
      <title>problem with data share about calling dll in openmp</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787342#M325</link>
      <description>Hi, guys, long time no see.&lt;BR /&gt;&lt;BR /&gt;Recently, I am busy with some numerical computation. In the work, I have to call a Fortran function from a dynamic link library in my c++ code. The Fortran dynamic link library was made with old syntax-F77, having many COMMON statements. The Fortran function is called many times in a loop for some purpose with different input parameters. To speed up, I parallel the loop like this:&lt;BR /&gt;&lt;BR /&gt;#pragma omp paralle for schedule(static)&lt;BR /&gt;for(int i=0;i&amp;lt;1000;i++)&lt;BR /&gt;{&lt;BR /&gt; ....&lt;BR /&gt;Fortran_function(parameter_1,parameter_2);&lt;BR /&gt;.....&lt;BR /&gt;}&lt;BR /&gt;when debuging the code with Intel Parallel Debugger Extension, I found some data race. But, after fixed the bugs, the results from parallel is rather different from sequential results. In the loopall variabls are defined as local, so I doubt whether the reason is from the Fortran DLL. Is the COMMON statement in Fortran DLL causing share conflict? How to fix it?</description>
      <pubDate>Mon, 18 Jul 2011 06:49:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787342#M325</guid>
      <dc:creator>ollehyas</dc:creator>
      <dc:date>2011-07-18T06:49:29Z</dc:date>
    </item>
    <item>
      <title>problem with data share about calling dll in openmp</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787343#M326</link>
      <description>If your DLL function is using "local" arrays .AND. if the function is not declared with RECURSIVE (or with -openpm) then the local arrays are attributed withSAVE. IOW&lt;BR /&gt;&lt;BR /&gt; real:: vec(3)&lt;BR /&gt;&lt;BR /&gt;is a SAVE'e (shared)array.&lt;BR /&gt;&lt;BR /&gt;Your DLL function has to be compiled either a) with RECURSIVE or b) with -openmp option (eventhough it is not using !$OMP... code.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2011 22:30:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787343#M326</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-07-19T22:30:49Z</dc:date>
    </item>
    <item>
      <title>problem with data share about calling dll in openmp</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787344#M327</link>
      <description>Jim's comment is correct for Intel Fortran. A subroutine which is to be active in a parallel region should have the RECURSIVE attribute, or be compiled with a non-default thread safety option e.g. -auto -openmp .....&lt;BR /&gt;A C compiler with default auto definition of an array within a parallel region will make the array private automatically. You would have trouble if a shared array (as when defined outside the parallel region, including a static) is updated by more than one thread.</description>
      <pubDate>Wed, 20 Jul 2011 18:28:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/problem-with-data-share-about-calling-dll-in-openmp/m-p/787344#M327</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-07-20T18:28:45Z</dc:date>
    </item>
  </channel>
</rss>

