<?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 Multithreading (BLAS sgemm) in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006131#M18899</link>
    <description>&lt;P&gt;Dear Forum,&lt;/P&gt;

&lt;P&gt;I am trying to make MKL accelerate a matrix multiplication for me. It works, but MKL insists on doing it with a single thread. I played around a bit. But regardless of what I do - even when multiplying two randomly initialized 10000x10000 matrices - MKL does not use multiple threads. Am I missing something?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Function:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;BLAS sgemm, via libmkl_rt.so&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Environment settings:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;MKL_NUM_THREADS=8; export MKL_NUM_THREADS
OMP_NUM_THREADS=8; export OMP_NUM_THREADS
MKL_DYNAMIC=FALSE; export MKL_DYNAMIC
OMP_DYNAMIC=FALSE; export OMP_DYNAMIC
MKL_DOMAIN_NUM_THREADS=MKL_DOMAIN_ALL,8; export MKL_DOMAIN_NUM_THREADS
OMP_DOMAIN_NUM_THREADS=MKL_DOMAIN_ALL,8; export OMP_DOMAIN_NUM_THREADS&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Machine:&lt;/STRONG&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	LinuxMint 17.2, Kernel: 3.19.0-26, CPU: 4th gen. i7, HT activated in BIOS&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2015 14:22:44 GMT</pubDate>
    <dc:creator>Matthias_L_</dc:creator>
    <dc:date>2015-08-31T14:22:44Z</dc:date>
    <item>
      <title>Multithreading (BLAS sgemm)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006131#M18899</link>
      <description>&lt;P&gt;Dear Forum,&lt;/P&gt;

&lt;P&gt;I am trying to make MKL accelerate a matrix multiplication for me. It works, but MKL insists on doing it with a single thread. I played around a bit. But regardless of what I do - even when multiplying two randomly initialized 10000x10000 matrices - MKL does not use multiple threads. Am I missing something?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Function:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;BLAS sgemm, via libmkl_rt.so&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Environment settings:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;MKL_NUM_THREADS=8; export MKL_NUM_THREADS
OMP_NUM_THREADS=8; export OMP_NUM_THREADS
MKL_DYNAMIC=FALSE; export MKL_DYNAMIC
OMP_DYNAMIC=FALSE; export OMP_DYNAMIC
MKL_DOMAIN_NUM_THREADS=MKL_DOMAIN_ALL,8; export MKL_DOMAIN_NUM_THREADS
OMP_DOMAIN_NUM_THREADS=MKL_DOMAIN_ALL,8; export OMP_DOMAIN_NUM_THREADS&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Machine:&lt;/STRONG&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	LinuxMint 17.2, Kernel: 3.19.0-26, CPU: 4th gen. i7, HT activated in BIOS&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 14:22:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006131#M18899</guid>
      <dc:creator>Matthias_L_</dc:creator>
      <dc:date>2015-08-31T14:22:44Z</dc:date>
    </item>
    <item>
      <title>Hi Matthias, how do you check</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006132#M18900</link>
      <description>&lt;P&gt;Hi Matthias, how do you check that MKL runs single-threaded? Also, c&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;an you please show your LD_LIBRARY_PATH?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Usually setting OMP_NUM_THREADS is not even necessary since when it is not set, the Intel OpenMP library would use all the CPUs in the process CPU mask which is set to all CPUs by default.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 16:51:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006132#M18900</guid>
      <dc:creator>Roman_D_Intel1</dc:creator>
      <dc:date>2015-08-31T16:51:56Z</dc:date>
    </item>
    <item>
      <title>please set the environment</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006133#M18901</link>
      <description>&lt;P&gt;please set the environment variable MKL_VERBOSE=1 to check how many threads has been used while ?gemm was called.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 17:45:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006133#M18901</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2015-08-31T17:45:14Z</dc:date>
    </item>
    <item>
      <title>Hi Matthias L.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006134#M18902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://software.intel.com/en-us/user/1212678" style="font-size: 11px; line-height: 16.5px; background-color: rgb(238, 238, 238);"&gt;Matthias L.&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Do you have any result if&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;MKL_VERBOSE=1 ? &amp;nbsp; Or are you calling sgemm in one multi-thread application?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;In some of situation, the MKL may not spawns threads as external threads.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/recommended-settings-for-calling-intelr-mkl-routines-from-multi-threaded-applications" target="_blank"&gt;https://software.intel.com/en-us/articles/recommended-settings-for-calling-intelr-mkl-routines-from-multi-threaded-applications&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 02:15:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006134#M18902</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-09-14T02:15:12Z</dc:date>
    </item>
    <item>
      <title>Thanks for your comments and</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006135#M18903</link>
      <description>&lt;P&gt;Thanks for your comments and sorry that it took so long. I got it working properly now. There was some conflict with the LD_LBIRARY_PATH. Instead the system loaded the another BLAS implementation that I had installed. Why that was I cannot tell. I can hereby confirm that the MK_VERBOSE is very helpful for diagnosing issues. And that&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;MKL_NUM_THREADS=8; &lt;/CODE&gt;&lt;CODE class="functions"&gt;export&lt;/CODE&gt; &lt;CODE class="plain"&gt;MKL_NUM_THREADS&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;OMP_NUM_THREADS=8; &lt;/CODE&gt;&lt;CODE class="functions"&gt;export&lt;/CODE&gt; &lt;CODE class="plain"&gt;OMP_NUM_THREADS&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;MKL_DYNAMIC=FALSE; &lt;/CODE&gt;&lt;CODE class="functions"&gt;export&lt;/CODE&gt; &lt;CODE class="plain"&gt;MKL_DYNAMIC&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;OMP_DYNAMIC=FALSE; &lt;/CODE&gt;&lt;CODE class="functions"&gt;export&lt;/CODE&gt; &lt;CODE class="plain"&gt;OMP_DYNAMIC&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;produces the right results one would expect (if one loads the right runtime library).&lt;/P&gt;

&lt;P&gt;~Matthias&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 09:22:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Multithreading-BLAS-sgemm/m-p/1006135#M18903</guid>
      <dc:creator>Matthias_L_</dc:creator>
      <dc:date>2015-11-12T09:22:07Z</dc:date>
    </item>
  </channel>
</rss>

