<?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 Eric, the suggested in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169464#M28460</link>
    <description>&lt;P&gt;Eric, the suggested workaround the problem is to use&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;export KMP_INIT_AT_FORK=FALSE till compiler team will not fix the problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 04:36:17 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2018-04-27T04:36:17Z</dc:date>
    <item>
      <title>Calling dgetrf_ before fork() causes HANG with MKL_CBWR=COMPATIBLE</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169458#M28454</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a mwe with the bug.&amp;nbsp; I reproduced with the following setup:&lt;/P&gt;

&lt;P&gt;export MKL_CBWR=COMPATIBLE&lt;/P&gt;

&lt;P&gt;export MKL_VERBOSE=1&lt;/P&gt;

&lt;P&gt;./foo&lt;/P&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family:monospace"&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;Foo is called &lt;/SPAN&gt;&lt;BR /&gt;
	MKL_VERBOSE Intel(R) MKL 2018.0 Update 1 Product build 20171007 for Intel(R) 64 architecture Intel(R) Architecture processors, Lnx 3.20GHz lp64 intel_thread NMICDev:0&lt;BR /&gt;
	MKL_VERBOSE DGETRF(27,27,0x1f34280,27,0x7ffd36f28c20,27) 22.90ms CNR:COMPATIBLE Dyn:1 FastMM:1 TID:0 &amp;nbsp;NThr:6 WDiv:HOST:+0.000&lt;BR /&gt;
	Calling MPI_Init:&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	foo compiled with:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family:monospace"&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;mpicxx -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lmkl_blacs_intelmpi_lp64 -liomp5 -ldl -lpthread -o foo foo.cc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;mpicxx tested: OpenMPI {2.1.2,3.0.1}&lt;/P&gt;

&lt;P&gt;I&lt;SPAN style="font-size: 1em;"&gt;t works on another computer with Intel MKL 2015 installed:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: monospace; font-size: 1em;"&gt;./foo&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family:monospace"&gt;Foo is called&lt;BR /&gt;
	MKL_VERBOSE Intel(R) MKL 11.2 Update 2 Product build 20150120 for Intel(R) 64 architecture Intel(R) Architecture processors, Lnx 2.40GHz lp64 intel_thread NMICDev:0&lt;BR /&gt;
	MKL_VERBOSE DGETRF(27,27,0xdc7c20,27,0x7ffc8b6f1870,27) 8.38ms CNR:COMPATIBLE Dyn:1 FastMM:1 TID:0 &amp;nbsp;NThr:12 WDiv:HOST:+0.000&lt;BR /&gt;
	Calling MPI_Init:&lt;BR /&gt;
	MPI_Init done...&lt;BR /&gt;
	Foo is called&lt;BR /&gt;
	MKL_VERBOSE DGETRF(27,27,0xf15610,27,0x7ffc8b6f18e0,27) 127.27us CNR:COMPATIBLE Dyn:1 FastMM:1 TID:0 &amp;nbsp;NThr:12 WDiv:HOST:+0.000&lt;/SPAN&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;It also works if I set MKL_NUM_THREADS=1&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Eric&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 16:44:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169458#M28454</guid>
      <dc:creator>EricChamberland</dc:creator>
      <dc:date>2018-04-13T16:44:05Z</dc:date>
    </item>
    <item>
      <title>Eric, could you please check</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169459#M28455</link>
      <description>&lt;P&gt;Eric, could you please check this case with MKL 2018 u2 we released 2 weeks ago!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 06:43:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169459#M28455</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-04-14T06:43:20Z</dc:date>
    </item>
    <item>
      <title>Hi M. Gennady,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169460#M28456</link>
      <description>&lt;P&gt;Hi M. Gennady,&lt;/P&gt;

&lt;P&gt;we installed the latest update this morning and I tested it:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Foo is called 

MKL_VERBOSE Intel(R) MKL 2018.0 Update 2 Product build 20180127 for Intel(R) 64 architecture Intel(R) Architecture processors, Lnx 3.20GHz lp64 intel_thread
MKL_VERBOSE DGETRF(27,27,0x1bf4280,27,0x7ffff1fce520,27) 17.55ms CNR:COMPATIBLE Dyn:1 FastMM:1 TID:0  NThr:6
Calling MPI_Init:
&lt;/PRE&gt;

&lt;P&gt;It hangs at the same place.&amp;nbsp; I have been suggested to change&amp;nbsp;mkl_blacs_intelmpi_lp64 to&amp;nbsp;mkl_blacs_openmpi_lp64, but it changed nothing!&amp;nbsp; I also changed&amp;nbsp;&lt;SPAN style="font-family:monospace"&gt;&lt;SPAN style="color: rgb(0, 0, 0);"&gt;-lmkl_intel_thread to&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;lmkl_gnu_thread, but still have the same problem.&lt;/P&gt;

&lt;P&gt;Here is the backtrace when it hang:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;(gdb) bt
#0  0x00007fffef681e47 in sched_yield () from /lib64/libc.so.6
#1  0x00007ffff0a5fe74 in _INTERNAL_26_______src_z_Linux_util_cpp_d7ee2e5e::__kmp_atfork_prepare () at ../../src/z_Linux_util.cpp:1534
#2  0x00007fffef66852d in fork () from /lib64/libc.so.6
#3  0x00007fffea07c842 in rte_init.part () from /opt/openmpi-3.0.1/lib/openmpi/mca_ess_singleton.so
#4  0x00007fffef30f8c6 in orte_init () from /opt/openmpi-3.0.1/lib/libopen-rte.so.40
#5  0x00007ffff028f4ec in ompi_mpi_init () from /opt/openmpi-3.0.1/lib/libmpi.so.40
#6  0x00007ffff02b7bdb in PMPI_Init () from /opt/openmpi-3.0.1/lib/libmpi.so.40
#7  0x0000000000400851 in main ()&lt;/PRE&gt;

&lt;P&gt;I also have followed a suggestion from a reply on OpenMPI issue I have opened:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/open-mpi/ompi/issues/5070#issuecomment-381572059" target="_blank"&gt;https://github.com/open-mpi/ompi/issues/5070#issuecomment-381572059&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But as reported, it did not fixed anything...&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Eric&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 13:45:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169460#M28456</guid>
      <dc:creator>EricChamberland</dc:creator>
      <dc:date>2018-04-16T13:45:34Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169461#M28457</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Gilles Gouaillardet from OpenMPI narrowed the problem down to a simple call to "fork" that is causing the bug, independently from OpenMPI itself. Please give a try at his reproducer:&lt;/P&gt;

&lt;P&gt;cat a.cpp:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;cstdio&amp;gt;
#include  &amp;lt;mkl.h&amp;gt;

int foo() {
   printf("Foo is called\n");
   const int lN = 27;
   double* lA = (double*)malloc(lN*lN*sizeof(double));
   for (int i = 0; i &amp;lt; lN*lN; ++i) {
     lA&lt;I&gt; = i;
   }
   int lPiv[lN];
   int lRes;
   dgetrf_(&amp;amp;lN, &amp;amp;lN, lA, &amp;amp;lN, lPiv, &amp;amp;lRes);
   return lRes;
}

int main(int pArgc, char* pArgv[])
{
   foo();
   printf("Forking:\n");
   pid_t pid = fork();
   if (0 == pid) {
       exit(0);
   }
   printf("Forked...\n");
   foo();
   return 0;
}
&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;compiled and launched with:&lt;/P&gt;

&lt;PRE style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 11.9px; margin-top: 0px; margin-bottom: 16px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 3px; color: rgb(36, 41, 46);"&gt;&lt;CODE style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 11.9px; padding: 0px; margin: 0px; background: transparent; border-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;"&gt;g++ a.cpp -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -liomp5
$ MKL_CBWR=COMPATIBLE ./a.out &lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;FONT face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"&gt;&lt;SPAN style="font-size: 11.9px;"&gt;(extracted from Gilles reply:&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;A href="https://github.com/open-mpi/ompi/issues/5070#issuecomment-382224431" target="_blank"&gt;https://github.com/open-mpi/ompi/issues/5070#issuecomment-382224431&lt;/A&gt; )&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Eric&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 02:55:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169461#M28457</guid>
      <dc:creator>EricChamberland</dc:creator>
      <dc:date>2018-04-18T02:55:58Z</dc:date>
    </item>
    <item>
      <title>Thanks Eric. I see the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169462#M28458</link>
      <description>&lt;P&gt;Thanks Eric. I see the similar hanging with intel threading ( lmkl_intel_thread) also. the case is escalated. We will keep into updated.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 09:55:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169462#M28458</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-04-18T09:55:48Z</dc:date>
    </item>
    <item>
      <title>Hi All,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169463#M28459</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Is it same to this? &lt;A href="https://software.intel.com/en-us/forums/intel-c-compiler/topic/758961"&gt;https://software.intel.com/en-us/forums/intel-c-compiler/topic/758961&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 14:57:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169463#M28459</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2018-04-18T14:57:03Z</dc:date>
    </item>
    <item>
      <title>Eric, the suggested</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169464#M28460</link>
      <description>&lt;P&gt;Eric, the suggested workaround the problem is to use&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;export KMP_INIT_AT_FORK=FALSE till compiler team will not fix the problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 04:36:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169464#M28460</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-04-27T04:36:17Z</dc:date>
    </item>
    <item>
      <title>Ok, thanks, it works for me!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169465#M28461</link>
      <description>&lt;P&gt;Ok, thanks, it works for me!&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;You wrote:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;"...FALSE till compiler team will not fix the problem."&lt;/P&gt;

&lt;P&gt;but I hope you meant "till compiler team will fix the problem."... ???&lt;/P&gt;

&lt;P&gt;:)&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Eric&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 17:16:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-dgetrf-before-fork-causes-HANG-with-MKL-CBWR-COMPATIBLE/m-p/1169465#M28461</guid>
      <dc:creator>EricChamberland</dc:creator>
      <dc:date>2018-04-27T17:16:12Z</dc:date>
    </item>
  </channel>
</rss>

