<?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 running MKL in multithreaded functions in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808983#M3659</link>
    <description>Our multithreaded program is using cvm library built on Intel MKL. We observed that
when we increased the number of running threads, the program spent
more time on locking/unlocking. We are using pthread and we are not using OpenMP. We got hot spots from VTune. The
test machine has 8 cores and our program uses 1 thread for main(), 1 loading
thread and several computation threads (using MKL). We got the best performance when we used 4 computation threads. Once we increased number of
computation threads over 4 the performance began to degrade and
"__lll_unlock_wake" and "__lll_lock_wait" became top 2 hot spots. The
data inputted into computation threads were independent from each
other. We also tried on a dummy thread function instead of using MKL,
just doing sqrt() in a loop to make sure we had long enough computation
time. We didn't see "__lll_unlock_wake" and "__lll_lock_wait" from the
dummy function. We were told by the author of cvm library
that the locking/unlocking functions came from MKL. Why does the performance degrade before number of logic threads reaches the number of physic cores? How does MKL use locking/unlocking in multithreaded function? Is there any limitation on number of threads and/or cache? How can we optimize MKL configuration for multithreaded program?&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help.&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Jun 2011 20:36:03 GMT</pubDate>
    <dc:creator>zhangj5</dc:creator>
    <dc:date>2011-06-08T20:36:03Z</dc:date>
    <item>
      <title>running MKL in multithreaded functions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808983#M3659</link>
      <description>Our multithreaded program is using cvm library built on Intel MKL. We observed that
when we increased the number of running threads, the program spent
more time on locking/unlocking. We are using pthread and we are not using OpenMP. We got hot spots from VTune. The
test machine has 8 cores and our program uses 1 thread for main(), 1 loading
thread and several computation threads (using MKL). We got the best performance when we used 4 computation threads. Once we increased number of
computation threads over 4 the performance began to degrade and
"__lll_unlock_wake" and "__lll_lock_wait" became top 2 hot spots. The
data inputted into computation threads were independent from each
other. We also tried on a dummy thread function instead of using MKL,
just doing sqrt() in a loop to make sure we had long enough computation
time. We didn't see "__lll_unlock_wake" and "__lll_lock_wait" from the
dummy function. We were told by the author of cvm library
that the locking/unlocking functions came from MKL. Why does the performance degrade before number of logic threads reaches the number of physic cores? How does MKL use locking/unlocking in multithreaded function? Is there any limitation on number of threads and/or cache? How can we optimize MKL configuration for multithreaded program?&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jun 2011 20:36:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808983#M3659</guid>
      <dc:creator>zhangj5</dc:creator>
      <dc:date>2011-06-08T20:36:03Z</dc:date>
    </item>
    <item>
      <title>running MKL in multithreaded functions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808984#M3660</link>
      <description>If you are running individual pthreads on a majority of the cores, it's unlikely that you would find threaded MKL running as well as the "sequential." If you do have enough cores available to accommodate both your pthreads and the MKL threads, you will likely run into random affinity conflicts, thus continuing to see excessive lock activity. I've been told that you should be able to bring your linux pthreads under the control of KMP_AFFINITY e.g. by setting up a tiny OpenMP parallel region and calling omp_get_num_threads. This would enable you to spread out your pthreads and MKL OpenMP threads.</description>
      <pubDate>Thu, 09 Jun 2011 02:08:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808984#M3660</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-06-09T02:08:05Z</dc:date>
    </item>
    <item>
      <title>running MKL in multithreaded functions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808985#M3661</link>
      <description>Thank you very much for your response. I have changed those parameters in many combinations but I have not seen any improvement on the performance. Could you pleasesend me an example on how to avoid random affinity conflicts?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;Jason</description>
      <pubDate>Fri, 10 Jun 2011 02:01:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808985#M3661</guid>
      <dc:creator>zhangj5</dc:creator>
      <dc:date>2011-06-10T02:01:20Z</dc:date>
    </item>
    <item>
      <title>running MKL in multithreaded functions</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808986#M3662</link>
      <description>It is my understanding that if you are calling MKL in an OpenMP threaded region MKL will revert to single-threading as nested threading is off. This is certainly what I see. &lt;BR /&gt;&lt;BR /&gt;That is , on a 4 core machine, I only ever see my 4 (omp) threads running when my OpenMP code is calling MKL functions. Outside OpenMP threaded regions, I see 4 threads when calling MKL, as MKL is starting it's own threads.</description>
      <pubDate>Fri, 10 Jun 2011 02:05:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/running-MKL-in-multithreaded-functions/m-p/808986#M3662</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-06-10T02:05:49Z</dc:date>
    </item>
  </channel>
</rss>

