<?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 Try to use an MKL function in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115093#M24594</link>
    <description>Try to use an MKL function &lt;STRONG&gt;kmp_set_defaults&lt;/STRONG&gt;( "&amp;lt;...env variable=value...&amp;gt;" ).</description>
    <pubDate>Thu, 25 May 2017 15:46:35 GMT</pubDate>
    <dc:creator>SergeyKostrov</dc:creator>
    <dc:date>2017-05-25T15:46:35Z</dc:date>
    <item>
      <title>Problems about how to use multithreaded intel MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115092#M24593</link>
      <description>&lt;P&gt;&lt;A name="OLE_LINK4"&gt;&lt;/A&gt;&lt;A name="OLE_LINK3"&gt;Hello， &lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have some problems about &lt;A name="OLE_LINK5"&gt;&lt;/A&gt;&lt;A name="OLE_LINK2"&gt;&lt;/A&gt;&lt;A name="OLE_LINK1"&gt;multithreaded intel MKL&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;1. &amp;nbsp; &amp;nbsp;I use the function MKL_SET_NUM_THREADS(2) to change the thread number. Then I want to check the value of MKL_NUM_THREADS, by using function getnv (mklname, value), mklname = MKL_NUM_THREADS. The value is always 1.&lt;/P&gt;

&lt;P style="margin-left:18.0pt;"&gt;I wonder if the value of MKL_NUM_THREADS will be changed when the parallelization starts.&lt;/P&gt;

&lt;P style="margin-left:18.0pt;"&gt;If so, is there a way to check the value of MKL_NUM_THREADS? How do I know if the value of MKL_NUM_THREADS is really changed after I set it?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. &amp;nbsp; I use the function MKL_SET_NUM_THREADS(2) to change the thread number. According to the runtime it works and the cpu efficiency is about 200%. The function I test is DGEMM. But when I test DGEQP3 or DGEQPF, the runtime is not changed and the cpu efficiency is always 100%.&lt;/P&gt;

&lt;P style="margin-left:18.0pt;"&gt;I think there is something wrong but I can’t figure it out.&lt;/P&gt;

&lt;P style="margin-left:18.0pt;"&gt;I want to know why.&lt;/P&gt;

&lt;P style="margin-left:18.0pt;"&gt;Is there some examples for me about how to use multithreaded intel MKL?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you ！&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;OS: Linux, Red Hat 5.5&lt;/P&gt;

&lt;P&gt;MKL: compilerpro-12.0.0.084&lt;/P&gt;

&lt;P&gt;Ifort: composerxe-2011.0.084&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 02:29:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115092#M24593</guid>
      <dc:creator>Huang_X_2</dc:creator>
      <dc:date>2017-05-25T02:29:53Z</dc:date>
    </item>
    <item>
      <title>Try to use an MKL function</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115093#M24594</link>
      <description>Try to use an MKL function &lt;STRONG&gt;kmp_set_defaults&lt;/STRONG&gt;( "&amp;lt;...env variable=value...&amp;gt;" ).</description>
      <pubDate>Thu, 25 May 2017 15:46:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115093#M24594</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-05-25T15:46:35Z</dc:date>
    </item>
    <item>
      <title>MKL doesn’t provide routine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115094#M24595</link>
      <description>&lt;P&gt;MKL doesn’t provide routine to track env variables value, but by design this env variable have not to be changed. If this happens then this is the real issue.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regard to DGEQP3 or DGEQPF – what is the problem size did you tried to solve?&lt;/P&gt;

&lt;P&gt;Is there some examples for me about how to use multithreaded intel MKL?&amp;nbsp; -- pls have a look at the MKL User Guide. You may find out there the “Changing the Number of OpenMP* Threads at Run Time” example&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 07:46:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115094#M24595</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-05-26T07:46:27Z</dc:date>
    </item>
    <item>
      <title>Please check the following</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115095#M24596</link>
      <description>&lt;P&gt;Please check the following link for reference&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/mkl-linux-developer-guide-improving-performance-with-threading" target="_blank"&gt;https://software.intel.com/en-us/mkl-linux-developer-guide-improving-performance-with-threading&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 07:59:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115095#M24596</guid>
      <dc:creator>Jing_Xu</dc:creator>
      <dc:date>2017-05-26T07:59:26Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...MKL doesn’t provide</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115096#M24597</link>
      <description>&amp;gt;&amp;gt;...MKL doesn’t provide routine to track env variables value...

A CRT function &lt;STRONG&gt;getenv&lt;/STRONG&gt; needs to be used.</description>
      <pubDate>Fri, 26 May 2017 17:43:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115096#M24597</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-05-26T17:43:28Z</dc:date>
    </item>
    <item>
      <title>At runtime mkl_set_num</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115097#M24598</link>
      <description>&lt;PRE class="brush:cpp;"&gt;At runtime mkl_set_num_threads needs to be used instead to change running number of OpenMP processing threads and here is a C example:

...
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Finding max number of threads Intel(R) MKL can use for parallel runs\n\n");
&amp;nbsp;&amp;nbsp;&amp;nbsp; max_threads = mkl_get_max_threads();

&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Running Intel(R) MKL from 1 to %i threads\n\n", max_threads);

&amp;nbsp;&amp;nbsp;&amp;nbsp; for( i = 4; i &amp;lt;= max_threads; i += 16 )
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for( j = 0; j &amp;lt; (m*n); j++ )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;J&gt; = 0.0;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Requesting Intel(R) MKL to use %i thread(s)\n\n", i );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mkl_set_num_threads( i );

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Measuring performance of matrix product using Intel(R) MKL dgemm function \n"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "via CBLAS interface on %i thread(s)\n\n", i);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_initial = dsecnd();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for( r = 0; r &amp;lt; LOOP_COUNT; r++ )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cblas_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m, n, p, alpha, A, p, B, n, beta, C, n );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_elapsed = (dsecnd() - s_initial) / LOOP_COUNT;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("== Matrix multiplication using Intel(R) MKL dgemm completed ==\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "== at %.5f seconds using %d thread(s) ==\n\n", (s_elapsed), i);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

...&lt;/J&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 17:48:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problems-about-how-to-use-multithreaded-intel-MKL/m-p/1115097#M24598</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-05-26T17:48:00Z</dc:date>
    </item>
  </channel>
</rss>

