<?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 &amp;gt;&amp;gt;...search for a related in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983659#M5787</link>
    <description>&amp;gt;&amp;gt;...search for a related thread on the forum for more details...

Take a look at:

Forum Topic: &lt;STRONG&gt;Stress testing of Intel OpenMP library - More than 18,600 OpenMP threads created in a parallel region&lt;/STRONG&gt;
Web-link: software.intel.com/en-us/forums/topic/278302</description>
    <pubDate>Sun, 31 Mar 2013 04:44:27 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2013-03-31T04:44:27Z</dc:date>
    <item>
      <title>OpenMP Intel Implementation for Determining Number of Threads in a Parallel Region</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983656#M5784</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The OMP standard gives an algorithm for determining the number of threads in a parallel region&amp;nbsp;(page 36, algorithm 2.1 here:&amp;nbsp;&lt;A href="http://www.openmp.org/mp-documents/OpenMP3.1.pdf"&gt;http://www.openmp.org/mp-documents/OpenMP3.1.pdf&lt;/A&gt;). The last two lines of the algorithm are reproduced here:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;else if (dyn-var = false) and (ThreadsRequested &amp;gt; ThreadsAvailable)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp;then behavior is implementation defined;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Do we know what the Intel implementation is for the last line ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 16:09:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983656#M5784</guid>
      <dc:creator>BlueSky</dc:creator>
      <dc:date>2013-03-28T16:09:25Z</dc:date>
    </item>
    <item>
      <title>The number of threads is only</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983657#M5785</link>
      <description>&lt;P&gt;The number of threads is only guaranteed to be uncertain. What you observe today may be different tomorrow. What you see in one entry may be different in different entry. Therefore if your code is written (for the affected section) to&amp;nbsp;assume&amp;nbsp;(require)&amp;nbsp;the number of threads requested is the number of threads provided, then you have a coding error or at lease with unreasonable expectations. Note, the affected code would not run with compilation without -openmp as well as with stubs.&lt;/P&gt;
&lt;P&gt;In this circumstance, to grant&amp;nbsp;the number of threads requested would require either: a) increase the thread-limit-var, or b) have reduced team members perform missing thread team member's work by proxy (uses other team members thread number to do work). Note, b) would muck up thread local storage. a) could cause over subscription and in highly recursive situation could consume all resources.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2013 13:02:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983657#M5785</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2013-03-29T13:02:14Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...Do we know what the</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983658#M5786</link>
      <description>&amp;gt;&amp;gt;...Do we know what the Intel implementation is for the last line?..

No we don't know because Intel will never release C/C++ source codes for its OpenMP library. Regarding Jim's comment:

&amp;gt;&amp;gt;...The number of threads is only guaranteed to be uncertain...

Try the following code and you will see that &lt;STRONG&gt;omp_set_num_threads&lt;/STRONG&gt; and &lt;STRONG&gt;OMP_STACKSIZE&lt;/STRONG&gt; environment variable define everything. However, a significant over subscription will be created if the number of created OpenMP threads is greater than actual number of hardware threads supported by a CPU.
...
	RTint iRetCode = CrtSetEnv( RTU("OMP_STACKSIZE=32K") );
	if( iRetCode == 0 )
		CrtPrintf( RTU("OMP_STACKSIZE=%s\n"), CrtGetEnv( RTU("OMP_STACKSIZE") ) );
	else
		CrtPrintf( RTU("Error: Failed to Set Environment Variable OMP_STACKSIZE\n") );

	RTuint uiNumThreads = 0;

//	uiNumThreads =    64;
//	uiNumThreads =   512;
//	uiNumThreads =  1024;
//	uiNumThreads =  2048;
//	uiNumThreads =  4096;
//	uiNumThreads =  8192;
	uiNumThreads = 16384;
//	uiNumThreads = 32768;

	&lt;STRONG&gt;omp_set_num_threads&lt;/STRONG&gt;( uiNumThreads );

	&lt;STRONG&gt;#pragma omp parallel for&lt;/STRONG&gt;
	for( int i = 0; i &amp;lt; 32768; i++ )
	{
		volatile int iValue = 2;
		CrtPrintf( RTU("Iteration: %5ld - Thread %5ld out of %5ld\n"),
			   ( RTint )i, ( RTint )omp_get_thread_num() + 1, ( RTint )uiNumThreads );
	}
...

Also, the following numbers are based on my tests for &lt;STRONG&gt;#pragma omp parallel&lt;/STRONG&gt; directive ( completed in 2012 / search for a related thread on the forum for more details ):
...
//	#define _DEFAULT_NUMBER_OF_THREADS		   64	// Maximum number of OpenMP threads for Microsoft C++ compiler
...
//	#define _DEFAULT_NUMBER_OF_THREADS		16384	// Maximum number of OpenMP threads for Intel C++ compiler ( XE v12.1.3 )
...

&lt;STRONG&gt;Note:&lt;/STRONG&gt; Please take into account that &lt;STRONG&gt;OMP_STACKSIZE&lt;/STRONG&gt; has to be set to &lt;STRONG&gt;32KB&lt;/STRONG&gt; (!).</description>
      <pubDate>Sun, 31 Mar 2013 00:41:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983658#M5786</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-03-31T00:41:00Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...search for a related</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983659#M5787</link>
      <description>&amp;gt;&amp;gt;...search for a related thread on the forum for more details...

Take a look at:

Forum Topic: &lt;STRONG&gt;Stress testing of Intel OpenMP library - More than 18,600 OpenMP threads created in a parallel region&lt;/STRONG&gt;
Web-link: software.intel.com/en-us/forums/topic/278302</description>
      <pubDate>Sun, 31 Mar 2013 04:44:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983659#M5787</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-03-31T04:44:27Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983660#M5788</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Intel implementation will abort with the diagnostics that not enough system resources available.&lt;/P&gt;
&lt;P&gt;Regards, Andrey&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2013 12:18:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OpenMP-Intel-Implementation-for-Determining-Number-of-Threads-in/m-p/983660#M5788</guid>
      <dc:creator>Andrey_C_Intel1</dc:creator>
      <dc:date>2013-04-16T12:18:18Z</dc:date>
    </item>
  </channel>
</rss>

