<?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: Mixing OpenMP and Intel TBB in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872507#M3001</link>
    <description>&lt;P&gt;DidI understand it right thatyour tbb::parallel_reduce loop follows the omp parallel region (as opposed to nesting into it)? It's not clear from the pseudo-code above.&lt;/P&gt;
&lt;P&gt;If you are using Intel Compiler and its OpenMP implementation, be aware that OpenMP worker threads spin for some time after the end of a parallel region before going asleep. This spin time is controlled by the KMP_BLOCKTIME environment variable. As you run a tbb parallel loop right after that, I recommend you set the KMP_BLOCKTIME to 0, and it will make OpenMP worker threads sleeping immediately after the region. See the compiler documentation for more details about KMP_BLOCKTIME. Besides the environment variable, you could control the setting with kmp_set_blocktime() and kmp_get_blocktime() calls; you should set it to 0 before entering the omp parallel region. Again, these functions and the environment variable are Intel Compiler specific.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jun 2008 08:53:54 GMT</pubDate>
    <dc:creator>Alexey-Kukanov</dc:creator>
    <dc:date>2008-06-27T08:53:54Z</dc:date>
    <item>
      <title>Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872506#M3000</link>
      <description>Hello,
&lt;BR /&gt;
&lt;BR /&gt;I have tried to mix OpenMP and Intel TBB.
&lt;BR /&gt;
&lt;BR /&gt;I first have a loop which I precede by a
&lt;BR /&gt;
&lt;BR /&gt;#pragma omp parallel for
&lt;BR /&gt;
&lt;BR /&gt;After, I have code using tbb::parallel_reduce
&lt;BR /&gt;
&lt;BR /&gt;When OpenMP is enabled, the tbb::parallel_reduce is slower.
&lt;BR /&gt;
&lt;BR /&gt;I understand that there could be competion between OpenMP threads and TBB threads.
&lt;BR /&gt;
&lt;BR /&gt;Today my pseudo code looks like :
&lt;BR /&gt;tbb::task_scheduler_init
&lt;BR /&gt;#pragma omp parallel for
&lt;BR /&gt;tbb::parallel_reduce
&lt;BR /&gt;
&lt;BR /&gt;Should I init TBB later ? how I could shutdown OpenMP before TBB init ?
&lt;BR /&gt;
&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Mon, 16 Jun 2008 20:57:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872506#M3000</guid>
      <dc:creator>dgeld</dc:creator>
      <dc:date>2008-06-16T20:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872507#M3001</link>
      <description>&lt;P&gt;DidI understand it right thatyour tbb::parallel_reduce loop follows the omp parallel region (as opposed to nesting into it)? It's not clear from the pseudo-code above.&lt;/P&gt;
&lt;P&gt;If you are using Intel Compiler and its OpenMP implementation, be aware that OpenMP worker threads spin for some time after the end of a parallel region before going asleep. This spin time is controlled by the KMP_BLOCKTIME environment variable. As you run a tbb parallel loop right after that, I recommend you set the KMP_BLOCKTIME to 0, and it will make OpenMP worker threads sleeping immediately after the region. See the compiler documentation for more details about KMP_BLOCKTIME. Besides the environment variable, you could control the setting with kmp_set_blocktime() and kmp_get_blocktime() calls; you should set it to 0 before entering the omp parallel region. Again, these functions and the environment variable are Intel Compiler specific.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2008 08:53:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872507#M3001</guid>
      <dc:creator>Alexey-Kukanov</dc:creator>
      <dc:date>2008-06-27T08:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872508#M3002</link>
      <description>&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADakukanov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;DidI understand it right thatyour tbb::parallel_reduce loop follows the omp parallel region (as opposed to nesting into it)?&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;BR /&gt;Yes tbb::parallel_reduce follows the omp parallel region
&lt;BR /&gt;
&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADakukanov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;
&lt;BR /&gt;I recommend you set the KMP_BLOCKTIME to 0, and it will make OpenMP worker threads sleeping immediately after the region.
&lt;BR /&gt;...
&lt;BR /&gt;Again, these functions and the environment variable are Intel Compiler specific.&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;BR /&gt;OK, this works fine.
&lt;BR /&gt;
&lt;BR /&gt;But the conclusion is that TBB is more "portable" than OpenMP. 
&lt;BR /&gt;
&lt;BR /&gt;Thanks for your answer.</description>
      <pubDate>Fri, 27 Jun 2008 09:22:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872508#M3002</guid>
      <dc:creator>dgeld</dc:creator>
      <dc:date>2008-06-27T09:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872509#M3003</link>
      <description>&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADakukanov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;DidI understand it right thatyour tbb::parallel_reduce loop follows the omp parallel region (as opposed to nesting into it)?&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;BR /&gt;Yes tbb::parallel_reduce follows the omp parallel region
&lt;BR /&gt;
&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;MADakukanov:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;
&lt;BR /&gt;I recommend you set the KMP_BLOCKTIME to 0, and it will make OpenMP worker threads sleeping immediately after the region.
&lt;BR /&gt;...
&lt;BR /&gt;Again, these functions and the environment variable are Intel Compiler specific.&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;
&lt;BR /&gt;OK, this works fine.
&lt;BR /&gt;
&lt;BR /&gt;But the conclusion is that TBB is more "portable" than OpenMP. 
&lt;BR /&gt;
&lt;BR /&gt;Thanks for your answer.</description>
      <pubDate>Fri, 27 Jun 2008 09:22:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872509#M3003</guid>
      <dc:creator>dgeld</dc:creator>
      <dc:date>2008-06-27T09:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872510#M3004</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt; But the conclusion is that TBB is more "portable" than OpenMP. &lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;No, the conclusion is: one must be careful when mixing multiple threading domains in a single application.&lt;/P&gt;
&lt;P&gt;In your application, both TBB and OpentMP work under the guideline that they create and manage their own thread pools. An application could additionally contain pthreads and thus potentially have three thread domains to worry about (or ignore as the case may be).&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2008 12:03:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872510#M3004</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-06-30T12:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing OpenMP and Intel TBB</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872511#M3005</link>
      <description>Hello Jim,
&lt;BR /&gt;
&lt;BR /&gt;I just wanted to say that not all OpenMP implementation gives you a fine grained control of what is going on.
&lt;BR /&gt;
&lt;BR /&gt;TBB gives me the impression (perhaps false) of a better control of threads, synchronization, ...
&lt;BR /&gt;
&lt;BR /&gt;It is in this sense, that I found it more "portable" across compiler. With OpenMP, you will have to adapt the way you use it to your compiler's implementation.
&lt;BR /&gt;
&lt;BR /&gt;David Geldreich</description>
      <pubDate>Mon, 30 Jun 2008 12:14:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Mixing-OpenMP-and-Intel-TBB/m-p/872511#M3005</guid>
      <dc:creator>dgeld</dc:creator>
      <dc:date>2008-06-30T12:14:10Z</dc:date>
    </item>
  </channel>
</rss>

