<?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 Thanks for your reply. Let me in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027535#M19970</link>
    <description>&lt;P&gt;Thanks for your reply. Let me specify the problem.&lt;/P&gt;

&lt;P&gt;I'm testing lapacke_dgesvd (lapacke_dgesdd) for SVD computation. I can run it in C++ with multi-threading. With the same function, I can also make it a shared library (.so file) and calling it from R with&amp;nbsp;dyn.load amd .C function.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The problem I encountered is that in C++ &amp;nbsp;the lapacke_dgesvd function&amp;nbsp;with multi-threading performs correctly while with R binding lapacke_dgesvd produces wrong results with multi-threading.&lt;/P&gt;

&lt;P&gt;When building the C++ functions, I was only able to build it with mkl dynamic parallel setting, i.e. with&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;-lmkl_core -lmkl_intel_lp64 -lmkl_gnu_thread for linker. Meanwhile I was only able to build mkl sdl with -lmkl_rt for the R binding .so file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have two questions:&lt;/P&gt;

&lt;P&gt;1) How can I build C++ function and R bindings .so files with both mkl dynamic parallel setting and mkl sdl?&lt;/P&gt;

&lt;P&gt;2) Why the current R binding produce incorrect result?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 May 2014 15:00:32 GMT</pubDate>
    <dc:creator>Bowen_M_</dc:creator>
    <dc:date>2014-05-30T15:00:32Z</dc:date>
    <item>
      <title>error for R calling MKL with multithreading</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027533#M19968</link>
      <description>&lt;P&gt;Specifically, when using mkl functions (such as lapacke_dgesvd) in C++&amp;nbsp;with multi-threading, it works fine. But with the same function and R binding to call it under multi-threading, the result of SVD is not correct. Does anyone have an idea of what happened?&lt;/P&gt;

&lt;P&gt;In addition, I used&amp;nbsp;&lt;SPAN style="line-height: 1.5; font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 1em;"&gt;-lmkl_core -lmkl_intel_lp64 -lmkl_gnu_thread to compile, the C++ code compiled, but it won't work if I use&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif;"&gt;-lmkl_rt. R binding compiles the other way, only with&amp;nbsp;-lmkl_rt but not&amp;nbsp;-lmkl_core -lmkl_intel_lp64 -lmkl_gnu_thread.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif;"&gt;Bowen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2014 21:53:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027533#M19968</guid>
      <dc:creator>Bowen_M_</dc:creator>
      <dc:date>2014-05-29T21:53:56Z</dc:date>
    </item>
    <item>
      <title>Perhaps if you would give</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027534#M19969</link>
      <description>&lt;P&gt;Perhaps if you would give more detail, your question might be clearer.&lt;/P&gt;

&lt;P&gt;I guess you are using g++ with OpenMP.&amp;nbsp;&amp;nbsp; In that case, you must make consistent choices in the OpenMP support library.&amp;nbsp; Several choices:&lt;/P&gt;

&lt;P&gt;1) mkl_sequential avoids MKL linking an OpenMP library.&amp;nbsp; This might be good if you call MKL from parallel regions.&lt;/P&gt;

&lt;P&gt;2) mkl_gnu_thread should be compatible with libgomp (as implied by g++ -fopenmp)&lt;/P&gt;

&lt;P&gt;3) Omit -fopenmp at the g++ link step and specify -liomp5.&amp;nbsp;&amp;nbsp; libiomp5 supports all omp function calls from g++.&amp;nbsp; Then you can use the MKL default threading which depends on libiomp5.&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 12:43:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027534#M19969</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-05-30T12:43:02Z</dc:date>
    </item>
    <item>
      <title>Thanks for your reply. Let me</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027535#M19970</link>
      <description>&lt;P&gt;Thanks for your reply. Let me specify the problem.&lt;/P&gt;

&lt;P&gt;I'm testing lapacke_dgesvd (lapacke_dgesdd) for SVD computation. I can run it in C++ with multi-threading. With the same function, I can also make it a shared library (.so file) and calling it from R with&amp;nbsp;dyn.load amd .C function.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The problem I encountered is that in C++ &amp;nbsp;the lapacke_dgesvd function&amp;nbsp;with multi-threading performs correctly while with R binding lapacke_dgesvd produces wrong results with multi-threading.&lt;/P&gt;

&lt;P&gt;When building the C++ functions, I was only able to build it with mkl dynamic parallel setting, i.e. with&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;-lmkl_core -lmkl_intel_lp64 -lmkl_gnu_thread for linker. Meanwhile I was only able to build mkl sdl with -lmkl_rt for the R binding .so file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have two questions:&lt;/P&gt;

&lt;P&gt;1) How can I build C++ function and R bindings .so files with both mkl dynamic parallel setting and mkl sdl?&lt;/P&gt;

&lt;P&gt;2) Why the current R binding produce incorrect result?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 15:00:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027535#M19970</guid>
      <dc:creator>Bowen_M_</dc:creator>
      <dc:date>2014-05-30T15:00:32Z</dc:date>
    </item>
    <item>
      <title>I'd still have to guess about</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027536#M19971</link>
      <description>&lt;P&gt;I'd still have to guess about your possible problems with static linking.&amp;nbsp; That requires the ld begin-group ... end-group specifications as quoted by the link advisor.&amp;nbsp; This assumes that all your references to MKL lie within the shared object you are building, and you will still require the libiomp5.so if you use that option (I don't know about static option for mkl gnu_thread).&lt;/P&gt;

&lt;P&gt;If you didn't get a correct combination using a single OpenMP library, incorrect results could be a consequence.&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 19:35:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/error-for-R-calling-MKL-with-multithreading/m-p/1027536#M19971</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-05-30T19:35:00Z</dc:date>
    </item>
  </channel>
</rss>

