<?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 Here is a simple example how in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099163#M23758</link>
    <description>&lt;PRE class="brush:cpp;"&gt;Here is a simple example how I use it:

...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#if ( defined ( _RTPRAGMAOMP_PARALLEL ) )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#pragma omp parallel
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#endif
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTinumber iId = OmpGetThreadId();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#ifdef _RTMATRIXSETCORE_DIAGNOSTICS
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CrtPrintf( RTU("ThreadID=%2ld\n"), ( RTINT )iId );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#endif
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTiterator i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// VR: Vectorized
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for( i = iStart[iId]; i &amp;lt; iEnd[iId]; i += 1 )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ptR&lt;I&gt; = ptA&lt;I&gt; + ptB&lt;I&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CrtSfence();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
...

Note: OmpGetThreadId is a macro wrapper for omp_get_thread_num function.&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2017 22:32:37 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2017-05-04T22:32:37Z</dc:date>
    <item>
      <title>OpenMP with MKL - Get Thread Num</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099161#M23756</link>
      <description>&lt;P style="font-size: 13.008px;"&gt;When using OpenMP I can get the thread num by using:&lt;/P&gt;

&lt;PRE class="brush:cpp;" style="font-size: 13.008px;"&gt;omp_get_thread_num()&lt;/PRE&gt;

&lt;P style="font-size: 13.008px;"&gt;However when using it with MKL the, the command doesn't work. Is there ano MKL command which replaces this?&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;Thank you,&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;Raphael&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 20:47:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099161#M23756</guid>
      <dc:creator>Raphael_P_</dc:creator>
      <dc:date>2017-05-04T20:47:22Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...However when using it</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099162#M23757</link>
      <description>&amp;gt;&amp;gt;...However when using it with MKL the, the command doesn't work...

&lt;STRONG&gt;OpenMP&lt;/STRONG&gt; function &lt;STRONG&gt;omp_get_thread_num()&lt;/STRONG&gt; should work in a parallel region(s) and it doesn't matter if MKL is used or not used. Could you post a piece of codes for review?</description>
      <pubDate>Thu, 04 May 2017 22:28:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099162#M23757</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-05-04T22:28:02Z</dc:date>
    </item>
    <item>
      <title>Here is a simple example how</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099163#M23758</link>
      <description>&lt;PRE class="brush:cpp;"&gt;Here is a simple example how I use it:

...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#if ( defined ( _RTPRAGMAOMP_PARALLEL ) )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#pragma omp parallel
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#endif
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTinumber iId = OmpGetThreadId();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#ifdef _RTMATRIXSETCORE_DIAGNOSTICS
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CrtPrintf( RTU("ThreadID=%2ld\n"), ( RTINT )iId );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#endif
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTiterator i;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// VR: Vectorized
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for( i = iStart[iId]; i &amp;lt; iEnd[iId]; i += 1 )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ptR&lt;I&gt; = ptA&lt;I&gt; + ptB&lt;I&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CrtSfence();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
...

Note: OmpGetThreadId is a macro wrapper for omp_get_thread_num function.&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 22:32:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099163#M23758</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-05-04T22:32:37Z</dc:date>
    </item>
    <item>
      <title>You may try to use verbose</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099164#M23759</link>
      <description>&lt;P&gt;You may try to use verbose mode to take the OpenMP thread number of the calling thread. pls see MKL User's Guide for details.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 14:58:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/OpenMP-with-MKL-Get-Thread-Num/m-p/1099164#M23759</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-05-06T14:58:05Z</dc:date>
    </item>
  </channel>
</rss>

