<?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 ippSetNumThreads in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848740#M6330</link>
    <description>Dear Forum Members,
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;one way recommended to control the number of threads inan application using Intel IPP is to use&lt;I&gt;ippSetNumThreads&lt;/I&gt;. Actually I did this at the beginning of my main function and set the number of threads to 1. However, when the application is running on our hpc-cluster with Quadcore or Octocore Nodes, the application creates 4 Threads instead of one. Due to the fact, that my code itself creates no threads at all, I was wondering why the Intel Ipp Library is creating more than one thread. (The cluster is running under SLES 10.1 in combination with Intel Ipp 6.0). Has anyone else observed this behaviour. Are there any restrictions or requirements where&lt;I&gt;ippSetNumThreads&lt;/I&gt; has to be called or is it not sufficient to call ippSetNumThreads once?&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thomas&lt;/DIV&gt;</description>
    <pubDate>Mon, 12 Oct 2009 12:00:57 GMT</pubDate>
    <dc:creator>Thomas_Gloe</dc:creator>
    <dc:date>2009-10-12T12:00:57Z</dc:date>
    <item>
      <title>ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848740#M6330</link>
      <description>Dear Forum Members,
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;one way recommended to control the number of threads inan application using Intel IPP is to use&lt;I&gt;ippSetNumThreads&lt;/I&gt;. Actually I did this at the beginning of my main function and set the number of threads to 1. However, when the application is running on our hpc-cluster with Quadcore or Octocore Nodes, the application creates 4 Threads instead of one. Due to the fact, that my code itself creates no threads at all, I was wondering why the Intel Ipp Library is creating more than one thread. (The cluster is running under SLES 10.1 in combination with Intel Ipp 6.0). Has anyone else observed this behaviour. Are there any restrictions or requirements where&lt;I&gt;ippSetNumThreads&lt;/I&gt; has to be called or is it not sufficient to call ippSetNumThreads once?&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thomas&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Oct 2009 12:00:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848740#M6330</guid>
      <dc:creator>Thomas_Gloe</dc:creator>
      <dc:date>2009-10-12T12:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848741#M6331</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Hi Thomas,&lt;BR /&gt;&lt;BR /&gt;Intel IPP is threaded using OpenMP API. The OpenMP run time will create number of threads equal to number of cores on your system. How much threads will do real work for IPP depends on value you set with ippSetNumThreads function. In your case these additional threads are always in sleep state and do not require any cpu cycles.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Mon, 12 Oct 2009 13:23:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848741#M6331</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-10-12T13:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848742#M6332</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336498"&gt;Vladimir Dudnik (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; Hi Thomas,&lt;BR /&gt;&lt;BR /&gt;Intel IPP is threaded using OpenMP API. The OpenMP run time will create number of threads equal to number of cores on your system. How much threads will do real work for IPP depends on value you set with ippSetNumThreads function. In your case these additional threads are always in sleep state and do not require any cpu cycles.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;Hi Vladimir,&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;thanks for your interesting answer, but I think I do not really understand the behaviour of IPP in this case. According to your argumentation, a call of&lt;SPAN style="font-style: italic;"&gt;ippGetNumThreads &lt;/SPAN&gt;previously to&lt;SPAN style="font-style: italic;"&gt;ippSetNumThreads &lt;/SPAN&gt;should be equal to the number of threads after calling&lt;SPAN style="font-style: italic;"&gt;ippSetNumThreads&lt;SPAN style="font-style: normal;"&gt;. However in my case, the number of threads returned by&lt;SPAN style="font-style: italic;"&gt;ippGetNumThreads &lt;SPAN style="font-style: normal;"&gt;is larger (NThreads=8) than the observed number of threads after setting ippSetNumThreads (NThreads=4). Does this mean, that some of the Threads are switched in sleep state and others are destroyed?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Thomas&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Oct 2009 14:42:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848742#M6332</guid>
      <dc:creator>Thomas_Gloe</dc:creator>
      <dc:date>2009-10-12T14:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848743#M6333</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;GetNumThreads should return default number which is equal to number of cores on your system if you did not call SetNumThreads before. But after you set some particular number of threads with SetNumThreads call, then GetNumThreads should return this number.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Oct 2009 15:07:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848743#M6333</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-10-12T15:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848744#M6334</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336498"&gt;Vladimir Dudnik (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;GetNumThreads should return default number which is equal to number of cores on your system if you did not call SetNumThreads before. But after you set some particular number of threads with SetNumThreads call, then GetNumThreads should return this number.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I absolutely agree, but my question was pointing on another issue. According to your comment, Open MP in the Intel IPP starts a number of threads according to the number of cores in the system? These threads are switched to sleep state, if &lt;EM&gt;ippSetNumThreads &lt;/EM&gt;was called with a number less than the available number of cores.&lt;SPAN style="font-family: verdana, sans-serif;"&gt;Furthermore, the IPP manual says that the initial number of threads returned by &lt;EM&gt;ippGetNumThreads &lt;/EM&gt;(previously to any call of ippSetNumThreads)is equal to the number of cores in a system. &lt;/SPAN&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-family: verdana, sans-serif;"&gt;So my question is, why is the number of threads returned by ippGetNumThreads (directly after starting the program and without calling ippSetNumThreads) different to the number of observable threads when the program is running? In my case the number of 'possible' threads returned by ippGetNumThreads (without calling ippSetNumThreads before) is 8 and the number of observable threads running in the system after calling ippSetNumThreads( 1 ) is 4. I'm not sure, but considering your post, I think, there should be 8 threads again (7 threads in the sleep state and one thread working)?&lt;/SPAN&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Maybe this is due to some internals of the library and there are always 4 threads independent of the number of available cores in the system, or some of the threads are destroyed?&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;SPAN style="font-size: 9px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;SPAN style="font-size: 9px;"&gt;ippGetNumThreads in the manual:&lt;SPAN style="font-family: mceinline;"&gt;This function&lt;/SPAN&gt;&lt;SPAN style="font: 9.0px Courier;"&gt;&lt;SPAN style="font-family: mceinline;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: mceinline;"&gt;returns &lt;SPAN style="font-size: small;"&gt;&lt;SPAN style="font-size: 11px;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;the number of OMP threads specified by the user previously. If it has not been specified,the function returns the initial number of threads that depends on the number of logical processors.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;SPAN style="font-size: 9px;"&gt;&lt;SPAN style="font-family: __;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN style="font-size: xx-small;"&gt;&lt;SPAN class="sectionbodytext" style="font-size: 9px;"&gt;&lt;SPAN style="font-family: __;"&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Thomas&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Oct 2009 15:50:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848744#M6334</guid>
      <dc:creator>Thomas_Gloe</dc:creator>
      <dc:date>2009-10-12T15:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: ippSetNumThreads</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848745#M6335</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Thomas,&lt;BR /&gt;&lt;BR /&gt;I think it is specific for OpenMP run time how many threads it will create by default. But you may be sure that with ippSetNumThreads(N) you direct IPP (and underlaying OpenMP run time) to only useN threads.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Oct 2009 16:02:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippSetNumThreads/m-p/848745#M6335</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-10-12T16:02:27Z</dc:date>
    </item>
  </channel>
</rss>

