<?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 My problem with workqueuing model , please do me a favor in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/My-problem-with-workqueuing-model-please-do-me-a-favor/m-p/914726#M4768</link>
    <description>&lt;P&gt;hi ,I want to parallel do-while codes with the workqueuing modol. soI writen a simple program for testing, however,the following codes does not get the right result as the serial ones,can you tell me why? thank you!&lt;/P&gt;
&lt;P&gt;float ParallelTest(float *Array)&lt;BR /&gt;{&lt;BR /&gt;int pjn,step;&lt;BR /&gt;float sum=0;&lt;BR /&gt;pjn=1000;&lt;BR /&gt;#pragma intel omp parallel taskq shared(pjn,Array) reduction(+:sum) &lt;BR /&gt;{&lt;BR /&gt; do&lt;BR /&gt;{&lt;BR /&gt;#pragma intel omp task captureprivate(pjn) &lt;BR /&gt;{&lt;BR /&gt;for(step=0;step&lt;SIZE&gt;{&lt;BR /&gt;sum+=Array[step]/(10*SIZE*SIZE);&lt;BR /&gt;// I add these codes for increasing calculation time&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;pjn=pjn/2;&lt;BR /&gt;}while(pjn!=1);&lt;BR /&gt;}&lt;BR /&gt;return sum;&lt;BR /&gt;}&lt;/SIZE&gt;&lt;/P&gt;
&lt;P&gt;the serial codes is :&lt;/P&gt;
&lt;P&gt;float ParallelTest(float *Array)&lt;BR /&gt;{&lt;BR /&gt;int pjn,step;&lt;BR /&gt;float sum=0;&lt;BR /&gt;pjn=1000;&lt;BR /&gt; do&lt;BR /&gt;{&lt;BR /&gt;for(step=0;step&lt;SIZE&gt;{&lt;BR /&gt;sum+=Array[step]/(10*SIZE*SIZE);&lt;BR /&gt;// I add these codes for increasing calculation time&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;}&lt;BR /&gt;pjn=pjn/2;&lt;BR /&gt;}while(pjn!=1);&lt;BR /&gt;return sum;&lt;BR /&gt;}&lt;/SIZE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2006 17:18:36 GMT</pubDate>
    <dc:creator>chbq</dc:creator>
    <dc:date>2006-08-04T17:18:36Z</dc:date>
    <item>
      <title>My problem with workqueuing model , please do me a favor</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/My-problem-with-workqueuing-model-please-do-me-a-favor/m-p/914726#M4768</link>
      <description>&lt;P&gt;hi ,I want to parallel do-while codes with the workqueuing modol. soI writen a simple program for testing, however,the following codes does not get the right result as the serial ones,can you tell me why? thank you!&lt;/P&gt;
&lt;P&gt;float ParallelTest(float *Array)&lt;BR /&gt;{&lt;BR /&gt;int pjn,step;&lt;BR /&gt;float sum=0;&lt;BR /&gt;pjn=1000;&lt;BR /&gt;#pragma intel omp parallel taskq shared(pjn,Array) reduction(+:sum) &lt;BR /&gt;{&lt;BR /&gt; do&lt;BR /&gt;{&lt;BR /&gt;#pragma intel omp task captureprivate(pjn) &lt;BR /&gt;{&lt;BR /&gt;for(step=0;step&lt;SIZE&gt;{&lt;BR /&gt;sum+=Array[step]/(10*SIZE*SIZE);&lt;BR /&gt;// I add these codes for increasing calculation time&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;pjn=pjn/2;&lt;BR /&gt;}while(pjn!=1);&lt;BR /&gt;}&lt;BR /&gt;return sum;&lt;BR /&gt;}&lt;/SIZE&gt;&lt;/P&gt;
&lt;P&gt;the serial codes is :&lt;/P&gt;
&lt;P&gt;float ParallelTest(float *Array)&lt;BR /&gt;{&lt;BR /&gt;int pjn,step;&lt;BR /&gt;float sum=0;&lt;BR /&gt;pjn=1000;&lt;BR /&gt; do&lt;BR /&gt;{&lt;BR /&gt;for(step=0;step&lt;SIZE&gt;{&lt;BR /&gt;sum+=Array[step]/(10*SIZE*SIZE);&lt;BR /&gt;// I add these codes for increasing calculation time&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;sum=sum*10/10*20/20*30/30;&lt;BR /&gt;}&lt;BR /&gt;pjn=pjn/2;&lt;BR /&gt;}while(pjn!=1);&lt;BR /&gt;return sum;&lt;BR /&gt;}&lt;/SIZE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2006 17:18:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/My-problem-with-workqueuing-model-please-do-me-a-favor/m-p/914726#M4768</guid>
      <dc:creator>chbq</dc:creator>
      <dc:date>2006-08-04T17:18:36Z</dc:date>
    </item>
  </channel>
</rss>

