<?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 letting us know in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054319#M21331</link>
    <description>&lt;P&gt;Thanks for letting us know that it worked out.&lt;/P&gt;

&lt;P&gt;Regarding the performance differences between mkl_intel_lp64 and&amp;nbsp;mkl_gf_lp64, since these are interface libraries who main purpose is to handle different calling conventions of compilers they have no impact on performance. In MKL, all computational work/functions are located in mkl_core library and are common for all compilers types.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2015 18:17:57 GMT</pubDate>
    <dc:creator>Vamsi_S_Intel</dc:creator>
    <dc:date>2015-06-26T18:17:57Z</dc:date>
    <item>
      <title>ARPACK with MKL crashes when calling zdotc</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054316#M21328</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I am trying to use the ARPACK library written in fortran to solve an eigenvalue problem from within a C++ program, together with MKL implementations of the required BLAS and LAPACK routines. Specifically, I need to use the ARPACK driver for a standard eigenvalue problem of a complex general matrix. One first calls the ARPACK routine znaupd, which does the Arnoldi iteration, and then zneupd to extract the eigenvalues and -vectors. The sample program I have written is in C++ and calls the routines znaupd and zneupd as external fortran routines. The program runs perfectly fine when I link against regular BLAS/LAPACK (from the Ubuntu repos in my case) or OpenBLAS, but doesn't work with MKL.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;The problem I am facing is that if I link against MKL, the program either gets stuck in an infinite loop or crashes during the ARPACK routine zneupd when requesting eigenvectors to be calculated as well.&lt;/P&gt;

&lt;P&gt;I have pinpointed the problem to a call to the BLAS routine zdotc. When linked against MKL, &lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_blas_avx_zdotc is&amp;nbsp;&lt;/SPAN&gt;actually called and this routine seems to modify memory where it shouldn't. Specifically in this case, it also modifies a for-loop counter and always resets it to 0 and the program is infinitely stuck in this loop (If of interest, the loop is in ARPACK's file zneupd.f from line 719 to 736, the affected loop variable is j). Sometimes&amp;nbsp;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_blas_avx_zdotc seems to modify memory somewhere else too and the program segfaults.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;I tried linking against a precompiled version of ARPACK from the Ubuntu repos, as well as against a self-built version downloaded from arpack-ng (&lt;/SPAN&gt;&lt;A href="http://forge.scilab.org/index.php/p/arpack-ng/)" target="_blank"&gt;http://forge.scilab.org/index.php/p/arpack-ng/)&lt;/A&gt; that I built using gfortran. The problem is the same in both cases.&lt;/P&gt;

&lt;P&gt;I compile my program using&lt;BR /&gt;
	icpc -std=c++11 -g -c arpack_test.cpp -o &lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;arpack_test&lt;/SPAN&gt;.o&lt;/P&gt;

&lt;P&gt;When I link against MKL, I follow the MKL link line advisor and use&lt;BR /&gt;
	icpc -o arp_test &lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;arpack_test&lt;/SPAN&gt;.o&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;/path/to/arpack/static/libarpack_debug.a -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -lgfortran&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Is there anything specific I need to watch out for when using MKL together with gfortran compiled libraries? To check if the problem is connected to passing complex c style arrays to fortran, I implemented the C++ program entirely using double c-style arrays only. Apart from that, is there anything one should watch out when using MKL in this case?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Valentin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 16:48:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054316#M21328</guid>
      <dc:creator>Zauner__Valentin</dc:creator>
      <dc:date>2015-06-25T16:48:44Z</dc:date>
    </item>
    <item>
      <title>Since ARPACK is being</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054317#M21329</link>
      <description>&lt;P&gt;Since ARPACK is being compiled with GFortran, MKL GFortran interface library should be used in the link line (mkl_gf_lp64). Can you try linking with this interface library?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 20:13:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054317#M21329</guid>
      <dc:creator>Vamsi_S_Intel</dc:creator>
      <dc:date>2015-06-25T20:13:52Z</dc:date>
    </item>
    <item>
      <title>Oh, wow, that was easy to fix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054318#M21330</link>
      <description>&lt;P&gt;Oh, wow, that was easy to fix, thanks a lot!! If only all arpack bugs were that easy to resolve... To summarize I just replaced -lmkl_intel_lp64 with -lmkl_gf_lp64 in the linker call:&lt;/P&gt;

&lt;P&gt;icpc -o arp_test arpack_test.o /path/to/arpack/static/libarpack_debug.a -L${MKLROOT}/lib/intel64 -lmkl_gf_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -lgfortran&lt;/P&gt;

&lt;P&gt;I actually didn't know that there was a separate MKL Gfortran interface. It would be nice if there was a note concerning that on the MKL link line advisor page (similar to the notes about libraries on WIN32 systems).&lt;/P&gt;

&lt;P&gt;Are there any performance differences between&amp;nbsp;mkl_intel_lp64 and&amp;nbsp;mkl_gf_lp64?&lt;/P&gt;

&lt;P&gt;Thanks again for the quick help and best regards,&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Valentin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 08:01:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054318#M21330</guid>
      <dc:creator>Zauner__Valentin</dc:creator>
      <dc:date>2015-06-26T08:01:18Z</dc:date>
    </item>
    <item>
      <title>Thanks for letting us know</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054319#M21331</link>
      <description>&lt;P&gt;Thanks for letting us know that it worked out.&lt;/P&gt;

&lt;P&gt;Regarding the performance differences between mkl_intel_lp64 and&amp;nbsp;mkl_gf_lp64, since these are interface libraries who main purpose is to handle different calling conventions of compilers they have no impact on performance. In MKL, all computational work/functions are located in mkl_core library and are common for all compilers types.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2015 18:17:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054319#M21331</guid>
      <dc:creator>Vamsi_S_Intel</dc:creator>
      <dc:date>2015-06-26T18:17:57Z</dc:date>
    </item>
    <item>
      <title>Ah ok, great, thank you!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054320#M21332</link>
      <description>&lt;P&gt;Ah ok, great, thank you!&lt;/P&gt;

&lt;P&gt;What should I then actually do if I had a C++ program calling BLAS functions, which is linked to a library compiled with gfortran, that is also calling BLAS function itself (e.g using ARPACK and in the main program also calling some BLAS routines)? I know this sounds very artificial, but I might actually have to consider this case...&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Valentin&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2015 12:56:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054320#M21332</guid>
      <dc:creator>Zauner__Valentin</dc:creator>
      <dc:date>2015-06-29T12:56:35Z</dc:date>
    </item>
    <item>
      <title>To cover this use-case, MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054321#M21333</link>
      <description>&lt;P&gt;To cover this use-case, MKL mkl_gf_lp64 interface has both CBLAS and BLAS functions. So, you can continue to link with mkl_gf_lp64 even if BLAS/CBLAS functions are called from C/C++ and you also have linked third-party libraries that are compiled with GFortran.&lt;/P&gt;

&lt;P&gt;The only exception cases are for Complex-type dot functions (cdotc, cdotu, zdotc, zdotu). In these case, you cannot call standard BLAS [c,z]dot[c,u] functions from C/C++ because the interface library that is linked is specific for GFortran which has a different calling convention of returning a Complex type and would cause issues. You can use the dot functions through the CBLAS interface (cblas_cdotc etc) to avoid this.&lt;/P&gt;

&lt;P&gt;Is there any reason why ARPACK is not being compiled with Intel Fortran Compiler, ifort? If you compile ARPACK with ifort, then you can just use mkl_intel_lp64 library&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 00:59:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054321#M21333</guid>
      <dc:creator>Vamsi_S_Intel</dc:creator>
      <dc:date>2015-06-30T00:59:02Z</dc:date>
    </item>
    <item>
      <title>Hi! Thanks for the detailed</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054322#M21334</link>
      <description>&lt;P&gt;Hi! Thanks for the detailed info! The reason why I use gfortran is that I only have a non-commercial license for icpc, but not for ifort. I saw however that open source developers can obtain a free non-commercial ifort version, so I will probably apply for such a license.&lt;/P&gt;

&lt;P&gt;Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2015 15:09:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054322#M21334</guid>
      <dc:creator>Zauner__Valentin</dc:creator>
      <dc:date>2015-06-30T15:09:29Z</dc:date>
    </item>
    <item>
      <title> I just found this post.  I</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054323#M21335</link>
      <description>&lt;P&gt;&amp;nbsp;I just found this post.&amp;nbsp; I have exactly the same problem. I am trying to link my c++ code with arpack. arpack is linked with gfortran and is crashing when in zdotc or giving a zero result. I am using parallel studio 2019 and I have only the c++ compiler. It looks the library linking since this post. I cannot libmkl_gf_lp64.a. Is it replaced by libmkl_gnu_thread.a ? Also, my c++ code is using blas and lapack a lot. How should I link?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marc&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 21:49:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ARPACK-with-MKL-crashes-when-calling-zdotc/m-p/1054323#M21335</guid>
      <dc:creator>marcsolal</dc:creator>
      <dc:date>2019-01-10T21:49:44Z</dc:date>
    </item>
  </channel>
</rss>

