<?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 Crash in OpenMP when using tasks from different thread in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746663#M2323</link>
    <description>Looks like if you use tasks in one thread and destroyed it after, than next time if you use tasks from other thread you get exception from libiomp5md.dll&lt;DIV&gt;Here is code that reproduces it on my system&lt;/DIV&gt;&lt;DIV&gt;(Microsoft Windows [Version 6.1.7601],Intel C++ Compiler XE for applications running on IA-32, Version 12.1.0.233 Build 20110811,Microsoft Visual Studio 2010Version 10.0.40219.1 SP1Rel) 
&lt;DIV&gt;&lt;PRE&gt;[cpp]#include &lt;TBB&gt;
#include &lt;IOSTREAM&gt;
int fib ( int n ) 
{
	int x,y;
	if ( n &amp;lt; 2 ) 
		return n;
#pragma omp task shared(x) 
	x = fib(n-1);
#pragma omp task shared(y) 
	y = fib(n-2);
#pragma omp taskwait
	return x+y;
}
void fib_fn(int n)
{
	int res;
#pragma omp parallel
	{
#pragma omp single
		res = fib(n);
	}
	std::cout &amp;lt;&amp;lt; res &amp;lt;&amp;lt; std::endl;
}
int main()
{
	fib_fn(10);
	for(int i = 0; i &amp;lt; 10; i++)
	{
		std::thread th(fib_fn,10);
		th.join();
	}
	return 0;
}[/cpp]&lt;/IOSTREAM&gt;&lt;/TBB&gt;&lt;/PRE&gt; &lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 15 Oct 2011 05:20:09 GMT</pubDate>
    <dc:creator>mongush</dc:creator>
    <dc:date>2011-10-15T05:20:09Z</dc:date>
    <item>
      <title>Crash in OpenMP when using tasks from different thread</title>
      <link>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746663#M2323</link>
      <description>Looks like if you use tasks in one thread and destroyed it after, than next time if you use tasks from other thread you get exception from libiomp5md.dll&lt;DIV&gt;Here is code that reproduces it on my system&lt;/DIV&gt;&lt;DIV&gt;(Microsoft Windows [Version 6.1.7601],Intel C++ Compiler XE for applications running on IA-32, Version 12.1.0.233 Build 20110811,Microsoft Visual Studio 2010Version 10.0.40219.1 SP1Rel) 
&lt;DIV&gt;&lt;PRE&gt;[cpp]#include &lt;TBB&gt;
#include &lt;IOSTREAM&gt;
int fib ( int n ) 
{
	int x,y;
	if ( n &amp;lt; 2 ) 
		return n;
#pragma omp task shared(x) 
	x = fib(n-1);
#pragma omp task shared(y) 
	y = fib(n-2);
#pragma omp taskwait
	return x+y;
}
void fib_fn(int n)
{
	int res;
#pragma omp parallel
	{
#pragma omp single
		res = fib(n);
	}
	std::cout &amp;lt;&amp;lt; res &amp;lt;&amp;lt; std::endl;
}
int main()
{
	fib_fn(10);
	for(int i = 0; i &amp;lt; 10; i++)
	{
		std::thread th(fib_fn,10);
		th.join();
	}
	return 0;
}[/cpp]&lt;/IOSTREAM&gt;&lt;/TBB&gt;&lt;/PRE&gt; &lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Oct 2011 05:20:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746663#M2323</guid>
      <dc:creator>mongush</dc:creator>
      <dc:date>2011-10-15T05:20:09Z</dc:date>
    </item>
    <item>
      <title>Crash in OpenMP when using tasks from different thread</title>
      <link>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746664#M2324</link>
      <description>OpenMP is designed to run from a single thread,principaly the main thread for a console app, but for a Windows app this could be one of the other threads you instantiate.&lt;BR /&gt;&lt;BR /&gt;IOW it is not re-entrant (although within an OpenMP session you can use re-entrant constructs).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Mon, 17 Oct 2011 11:47:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746664#M2324</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-10-17T11:47:49Z</dc:date>
    </item>
    <item>
      <title>Crash in OpenMP when using tasks from different thread</title>
      <link>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746665#M2325</link>
      <description>But everything works fine while using #pragma omp parallel for, only with tasks crash occur.&lt;BR /&gt;According to this post&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/forums/showpost.php?p=160568"&gt;http://software.intel.com/en-us/forums/showpost.php?p=160568&lt;/A&gt;&lt;A&gt;&lt;/A&gt;&lt;BR /&gt;it seems to me that the posted code should work.</description>
      <pubDate>Mon, 17 Oct 2011 13:36:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746665#M2325</guid>
      <dc:creator>mongush</dc:creator>
      <dc:date>2011-10-17T13:36:25Z</dc:date>
    </item>
    <item>
      <title>Crash in OpenMP when using tasks from different thread</title>
      <link>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746666#M2326</link>
      <description>&lt;P&gt;Did you read and understand the other post you referenced?&lt;BR /&gt;&lt;SPAN class="datatypes"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #2e8b57;"&gt;int&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;main()&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;fib_fn(10); // will instantiate OpenMP parallel team from main()&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #006699;"&gt;for&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="datatypes"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #2e8b57;"&gt;int&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;i=0;i&amp;lt;10;i++)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;std::&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #006699;"&gt;thread&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;th(fib_fn,10); // Instantiates non-OpenMP "main" thread&lt;BR /&gt;// ** each thread instantiating seperate "main" thread pool&lt;BR /&gt;// ** libiomp5md mayexhibit problems instantiating many thread pools&lt;BR /&gt;// ** the above code, on Sandy Bridge would generate11 thread pools each of 8 threads (88 threads)&lt;BR /&gt;// ** on IA32 the stack size may be an issue as well as reentrancy issues of libiomp5md.dll&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;th.join();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="keyword"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #006699;"&gt;return&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;0;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 20:52:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Crash-in-OpenMP-when-using-tasks-from-different-thread/m-p/746666#M2326</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-11-28T20:52:14Z</dc:date>
    </item>
  </channel>
</rss>

