<?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 Yes. in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155426#M7879</link>
    <description>&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Arthur V. Ratz wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you exactly mean that you still don't know the real generated C code of openmp ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Apr 2020 14:59:52 GMT</pubDate>
    <dc:creator>sun__lei</dc:creator>
    <dc:date>2020-04-12T14:59:52Z</dc:date>
    <item>
      <title>How to translate or expand openmp code into C pseudo code?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155421#M7874</link>
      <description>&lt;P&gt;How to translate openmp code(#pragma omp parallel for and&amp;nbsp;&amp;nbsp;#pragma omp simd ) into C pseudo code(pthread or simd intrinsic function)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 11:05:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155421#M7874</guid>
      <dc:creator>sun__lei</dc:creator>
      <dc:date>2020-04-04T11:05:36Z</dc:date>
    </item>
    <item>
      <title>sun, lei, I've carefully read</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155422#M7875</link>
      <description>&lt;P&gt;sun, lei, I've carefully read your question and here are some of the&amp;nbsp;suggestions:&lt;/P&gt;&lt;P&gt;The first of all C pseudo code is *NOT*&amp;nbsp;the either pthread or simd intrinsic functions.&lt;/P&gt;&lt;P&gt;Just for your interest: the C pseudo code is just a plain text explanation of how a certain code in C/C++ works.&lt;/P&gt;&lt;P&gt;The C pseudo code for the specific OpenMP pragmas listed below against the code in C/C++:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#pragma omp parallel for:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;#pragma omp parallel for private(i)
for (int i = 0; i &amp;lt; N; i++)
{
     // do some work in parallel
}

initialize i to zero (i = 0);
while i less than N do:
   spawn i-th thread;
      do some work in parallel;
   end spawn;
&amp;nbsp;  increment i by 1;
end while;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;#pragma omp simd:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;#pragma omp simd
{
    // An associated loop
    for (int i =0 ; i &amp;lt; N; i++) 
    {
         // do some work in parallel
    }
}

initialize i to zero (i = 0);
spawn each of N-threads in parallel;
while i less than N / 4 do:
   do the loop vectorization using SIMD instructions:
          do some work in parallel #1 (i);
          do some work in parallel #2 (i + 1);
          do some work in parallel #3 (i + 2);
          do some work in parallel #4 (i + 3);
   end do;
&amp;nbsp;  increment i by 4;
end while;&lt;/PRE&gt;

&lt;P&gt;Also, it's recommended to use the following OpenMP construct&amp;nbsp;instead of using #pragma parallel for simd:&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;#pragma omp parallel
{
        #pragma omp for simd
        for (int i = 0; i &amp;lt; N; i++)
        {
                 // do some work in parallel
        }
}
&lt;/PRE&gt;

&lt;P&gt;That's all. Have a good day ahead!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 15:51:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155422#M7875</guid>
      <dc:creator>ArthurRatz</dc:creator>
      <dc:date>2020-04-04T15:51:00Z</dc:date>
    </item>
    <item>
      <title>Was this solution helpful ?</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155423#M7876</link>
      <description>&lt;P&gt;Was this solution helpful ?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 15:28:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155423#M7876</guid>
      <dc:creator>ArthurRatz</dc:creator>
      <dc:date>2020-04-11T15:28:49Z</dc:date>
    </item>
    <item>
      <title>Thank you for your reply. But</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155424#M7877</link>
      <description>&lt;P&gt;Thank you for your reply. But I still don't know the real generated C code of&amp;nbsp;openmp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Arthur V. Ratz wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was this solution helpful ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 15:57:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155424#M7877</guid>
      <dc:creator>sun__lei</dc:creator>
      <dc:date>2020-04-11T15:57:51Z</dc:date>
    </item>
    <item>
      <title>What do you exactly mean that</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155425#M7878</link>
      <description>&lt;P&gt;What do you exactly mean that you still don't know the real generated C code of openmp ?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 15:59:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155425#M7878</guid>
      <dc:creator>ArthurRatz</dc:creator>
      <dc:date>2020-04-11T15:59:39Z</dc:date>
    </item>
    <item>
      <title>Yes.</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155426#M7879</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Arthur V. Ratz wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you exactly mean that you still don't know the real generated C code of openmp ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 14:59:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155426#M7879</guid>
      <dc:creator>sun__lei</dc:creator>
      <dc:date>2020-04-12T14:59:52Z</dc:date>
    </item>
    <item>
      <title>When an OpenMP program is</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155427#M7880</link>
      <description>&lt;P&gt;When an OpenMP program is converted to executable it is linked with a OpenMP library which internally uses POSIX functions.&lt;/P&gt;&lt;P&gt;An OpenMP code is not converted to an implementation in "C" using POSIX functions. So there is no intermediate "C code" using POSIX functions for OpenMP programs. You can always write a equivalent program directly using POSIX functions pthread_create, pthread_join... , but it would require much more effort compare to implementing the same logic in OpenMP program.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as equivalent pseudo-code is concerned Arthur provided a good example.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 07:08:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/How-to-translate-or-expand-openmp-code-into-C-pseudo-code/m-p/1155427#M7880</guid>
      <dc:creator>ASing3</dc:creator>
      <dc:date>2020-06-06T07:08:30Z</dc:date>
    </item>
  </channel>
</rss>

