<?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 Jonh, please don't pay in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825267#M5095</link>
    <description>Jonh, please don't pay attention with regard to my statement about '...the for loop was optimized out...'. I'll also take a look at the test project.</description>
    <pubDate>Wed, 05 Jun 2013 13:43:06 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2013-06-05T13:43:06Z</dc:date>
    <item>
      <title>Static Linking of a program with MKL and OpenMp's schedule()</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825264#M5092</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;We have a program that we for various reasons we on rare occasion need to link statically. When we do, we encounter the following problem with a parallel for loop. The conditions are&lt;BR /&gt;&lt;BR /&gt;A. Program linked statically with libiomp5mt.lib&lt;BR /&gt;B. The number of threads are set different than the default number of threads, i.e., the number of threads that would be used if OMP_NUM_THREADS is not set or omp_set_num_threads() is not used.&lt;BR /&gt;C. The schedule(dynamic), schedule(dynamic,X) or schedule(static,X) is used in the for loop. 'schedule(static)' or no schedule does not exhibit the problem.&lt;BR /&gt;&lt;BR /&gt;Under these conditions, the for loop will only execute the first loop of the iteration and then exit. &lt;BR /&gt;&lt;BR /&gt;Our platform is MS Vista 64, MS Visual Studio 2008, MS C++ compiler, Intel MKL 10.0.5.025. I have attached a visual studio project that exhibits the problem.&lt;BR /&gt;&lt;BR /&gt;If VCOMP is used instead of libiomp, the problem does not occur.&lt;BR /&gt;&lt;BR /&gt;We are wondering if this is an MKL problem or a MS VS problem, or possibly something we are unaware of with OpenMP?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2010 13:15:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825264#M5092</guid>
      <dc:creator>John_Young</dc:creator>
      <dc:date>2010-05-06T13:15:41Z</dc:date>
    </item>
    <item>
      <title>Hi Jonh,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825265#M5093</link>
      <description>&lt;P&gt;Hi Jonh,&lt;/P&gt;
&lt;P&gt;Not sure if it is still intrested.&amp;nbsp;The libiomp5 is Intel OpenMP runtime library, which is from Intel Compiler.&amp;nbsp; MKL&amp;nbsp;use it.&amp;nbsp;&amp;nbsp;I just try the library from MKL 10.1.0.018 (the old version installed on my machine, the latest one is MKL 11.0 update 4) .. The problem does not exhibited.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example, the code is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;int imax = 50;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; omp_set_num_threads(2);&lt;/P&gt;
&lt;P&gt;#ifdef _OPENMP&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma omp parallel for schedule(dynamic)&amp;nbsp; // this does not work for threads != default&lt;BR /&gt;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pragma omp parallel for&amp;nbsp; // this works properly for threads != default&lt;BR /&gt;#endif&lt;/P&gt;
&lt;P&gt;&amp;nbsp;link libiomp5mt.lib.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the result is like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42&amp;nbsp;&amp;nbsp; -0.105245&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 44&amp;nbsp;&amp;nbsp; 0.894755&lt;BR /&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp; -0.105245&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 46&amp;nbsp;&amp;nbsp; 0.894755&lt;BR /&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp; 47&amp;nbsp;&amp;nbsp; -0.105245&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; 48&amp;nbsp;&amp;nbsp; 0.894755&lt;BR /&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp; 49&amp;nbsp;&amp;nbsp; -0.105245.&lt;/P&gt;
&lt;P&gt;It starts 2 threads.&lt;/P&gt;
&lt;P&gt;On the other hands, Intel Compiler have removed the libiomp5mt.lib because some reason. please see &lt;A href="http://software.intel.com/en-us/articles/openmp-support-change"&gt;http://software.intel.com/en-us/articles/openmp-support-change&lt;/A&gt;&amp;nbsp; and &lt;A href="http://software.intel.com/en-us/forums/topic/328168"&gt;http://software.intel.com/en-us/forums/topic/328168&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So I guess it may be a bug of libiomp5, but have been fixed in later version.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2013 08:07:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825265#M5093</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2013-06-05T08:07:26Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...Under these conditions,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825266#M5094</link>
      <description>&amp;gt;&amp;gt;...Under these conditions, the for loop will only execute the first loop of the iteration and then exit. 

Did you use option /O2 of the Microsoft C++ compiler?

If Yes, it looks like the for loop was optimized out and in order to resolve that issue a volatile variable ( with some initialization / assignment ) of any type needs to be added.

A verification with Intel C++ compiler would also help to understand what is wrong.</description>
      <pubDate>Wed, 05 Jun 2013 13:38:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825266#M5094</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-05T13:38:06Z</dc:date>
    </item>
    <item>
      <title>Jonh, please don't pay</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825267#M5095</link>
      <description>Jonh, please don't pay attention with regard to my statement about '...the for loop was optimized out...'. I'll also take a look at the test project.</description>
      <pubDate>Wed, 05 Jun 2013 13:43:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Static-Linking-of-a-program-with-MKL-and-OpenMp-s-schedule/m-p/825267#M5095</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-05T13:43:06Z</dc:date>
    </item>
  </channel>
</rss>

