<?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 OMP how will this code execute in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763866#M22</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The &lt;B&gt;sections&lt;/B&gt; constructs in your code will be executed in serial, that is, one block after the other. The &lt;B&gt;section&lt;/B&gt; blocks in the individual &lt;B&gt;sections &lt;/B&gt;constructs may be executed concurrently or in serial, depending on the number of threads.&lt;BR /&gt;&lt;BR /&gt;So, in this code and two threads:&lt;BR /&gt;&lt;BR /&gt;#pragma omp sections // A&lt;BR /&gt;{&lt;BR /&gt;#pragma omp section // A1&lt;BR /&gt;do something&lt;BR /&gt;#pragma omp section // A2&lt;BR /&gt;do something &lt;BR /&gt;}&lt;BR /&gt;#pragma omp sections // B&lt;BR /&gt;{&lt;BR /&gt;#pragma omp section //B1&lt;BR /&gt;do something&lt;BR /&gt;#pragma omp section //B2&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You will see that A and B are executed after each other. A1 and A2 will be executed concurrentely as well as B1 and B2.&lt;BR /&gt;&lt;BR /&gt;Individual section constructs may be executed in serial too, if you have less threads than you have section constructs. So, in the above example, if you would only create a single OpenMP thread, A1 and A2 would be executed in serial.&lt;BR /&gt;&lt;BR /&gt;Does that help?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; -michael&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Jan 2012 12:32:19 GMT</pubDate>
    <dc:creator>Michael_K_Intel2</dc:creator>
    <dc:date>2012-01-09T12:32:19Z</dc:date>
    <item>
      <title>OMP how will this code execute</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763865#M21</link>
      <description>Hi I'm struggling with a peace of code because I'm not sure how it is going to be executed&lt;PRE&gt;[cpp]#pragma omp parallel
		{
			#pragma omp sections
			{
				#pragma omp section
					do something...
				#pragma omp section
					do something...
			}
			#pragma omp sections
			{
				#pragma omp section
					do something...
			}
			#pragma omp sections
			{
				#pragma omp section
					do something...
			}
		}[/cpp]&lt;/PRE&gt; Are the going to be executed all in parallel or each sections block in sequence.Thanks</description>
      <pubDate>Mon, 09 Jan 2012 11:26:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763865#M21</guid>
      <dc:creator>zzzelmu</dc:creator>
      <dc:date>2012-01-09T11:26:17Z</dc:date>
    </item>
    <item>
      <title>OMP how will this code execute</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763866#M22</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The &lt;B&gt;sections&lt;/B&gt; constructs in your code will be executed in serial, that is, one block after the other. The &lt;B&gt;section&lt;/B&gt; blocks in the individual &lt;B&gt;sections &lt;/B&gt;constructs may be executed concurrently or in serial, depending on the number of threads.&lt;BR /&gt;&lt;BR /&gt;So, in this code and two threads:&lt;BR /&gt;&lt;BR /&gt;#pragma omp sections // A&lt;BR /&gt;{&lt;BR /&gt;#pragma omp section // A1&lt;BR /&gt;do something&lt;BR /&gt;#pragma omp section // A2&lt;BR /&gt;do something &lt;BR /&gt;}&lt;BR /&gt;#pragma omp sections // B&lt;BR /&gt;{&lt;BR /&gt;#pragma omp section //B1&lt;BR /&gt;do something&lt;BR /&gt;#pragma omp section //B2&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You will see that A and B are executed after each other. A1 and A2 will be executed concurrentely as well as B1 and B2.&lt;BR /&gt;&lt;BR /&gt;Individual section constructs may be executed in serial too, if you have less threads than you have section constructs. So, in the above example, if you would only create a single OpenMP thread, A1 and A2 would be executed in serial.&lt;BR /&gt;&lt;BR /&gt;Does that help?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; -michael&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jan 2012 12:32:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763866#M22</guid>
      <dc:creator>Michael_K_Intel2</dc:creator>
      <dc:date>2012-01-09T12:32:19Z</dc:date>
    </item>
    <item>
      <title>OMP how will this code execute</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763867#M23</link>
      <description>10x it helps I was reviewing a code and was wondering why there were two &lt;B&gt;sections&lt;/B&gt; with only one &lt;B&gt;section&lt;/B&gt; in each one.</description>
      <pubDate>Thu, 12 Jan 2012 13:06:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763867#M23</guid>
      <dc:creator>zzzelmu</dc:creator>
      <dc:date>2012-01-12T13:06:07Z</dc:date>
    </item>
    <item>
      <title>OMP how will this code execute</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763868#M24</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;That's a good point. Since I do not know the code you're referring to, it might very well be a mistake or on purpose. Except for crazy way of getting something like &lt;B&gt;single&lt;/B&gt;, I cannot imagine a good use of a &lt;B&gt;sections&lt;/B&gt; construct with just one &lt;B&gt;secion&lt;/B&gt;.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt; -michael</description>
      <pubDate>Thu, 12 Jan 2012 13:57:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/OMP-how-will-this-code-execute/m-p/763868#M24</guid>
      <dc:creator>Michael_K_Intel2</dc:creator>
      <dc:date>2012-01-12T13:57:20Z</dc:date>
    </item>
  </channel>
</rss>

