<?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 Access violation in XERBLA when using CVF interface to MKL in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777074#M1166</link>
    <description>Thanks for that mecej4 - I might be able to get away with using mkl_rt.lib&lt;BR /&gt;&lt;BR /&gt;Mick</description>
    <pubDate>Tue, 13 Dec 2011 12:22:07 GMT</pubDate>
    <dc:creator>Mick_Pont</dc:creator>
    <dc:date>2011-12-13T12:22:07Z</dc:date>
    <item>
      <title>Access violation in XERBLA when using CVF interface to MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777072#M1164</link>
      <description>I've run into a problem with the LAPACK error handling routine&lt;BR /&gt;XERBLA, using MKL on a 32-bit Windows machine with ifort 12.1&lt;BR /&gt;and MKL 10.3.&lt;BR /&gt;&lt;BR /&gt;The test program below calls the LAPACK routine ZGETRF from MKL, and&lt;BR /&gt;deliberately sets the first argument M to an incorrect value, -1.&lt;BR /&gt;ZGETRF detects this and is supposed to call LAPACK routine&lt;BR /&gt;XERBLA to output an error message and then stop.&lt;BR /&gt;&lt;BR /&gt;Program test&lt;BR /&gt; Integer m, n, lda, ipiv(2), info&lt;BR /&gt; Complex*16 a(2,2)&lt;BR /&gt; external zgetrf&lt;BR /&gt; a = (1.0d0,0.0d0)&lt;BR /&gt; m = -1&lt;BR /&gt; n = 2&lt;BR /&gt; lda = 2&lt;BR /&gt; Call zgetrf(m,n,a,lda,ipiv,info)&lt;BR /&gt;End Program test&lt;BR /&gt;&lt;BR /&gt;That's the theory, and in practice it does work, so long as&lt;BR /&gt;the program is compiled to use the default _cdecl calling convention.&lt;BR /&gt;Here's how I compile:&lt;BR /&gt;&lt;BR /&gt; ifort test.f90 mkl_intel_c.lib mkl_sequential.lib mkl_core.lib&lt;BR /&gt;&lt;BR /&gt;and this is what correctly happens at run time:&lt;BR /&gt;&lt;BR /&gt; MKL ERROR: Parameter 1 was incorrect on entry to ZGETRF&lt;BR /&gt;&lt;BR /&gt;Instead, I want to compile to use the CVF calling convention, like this:&lt;BR /&gt;&lt;BR /&gt; ifort /iface:cvf test.f90 mkl_intel_s.lib mkl_sequential.lib mkl_core.lib&lt;BR /&gt;&lt;BR /&gt;- notice that now I need to link to mkl_intel_s.lib rather than&lt;BR /&gt;mkl_intel_c.lib - as suggested by the MKL link line advisor tool.&lt;BR /&gt;With this version of the executable, I get an access violation at&lt;BR /&gt;run time:&lt;BR /&gt;&lt;BR /&gt; forrtl: severe (157): Program Exception - access violation&lt;BR /&gt; Image PC Routine Line Source&lt;BR /&gt; test.exe 00971546 Unknown Unknown Unknown&lt;BR /&gt;&lt;BR /&gt;Tracing with a debugger I see that the access violation happens&lt;BR /&gt;several levels deep inside XERBLA.&lt;BR /&gt;&lt;BR /&gt;This experiment was done with this compiler:&lt;BR /&gt;&lt;BR /&gt; Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.1.0.233 Build 20110811&lt;BR /&gt; Copyright (C) 1985-2011 Intel Corporation. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;and using MKL 10.3 that comes in the same installation package as the compiler.&lt;BR /&gt;&lt;BR /&gt;I then tried compiling the same program using an older compiler version and&lt;BR /&gt;older MKL, and it worked fine. I used MKL 10.0.3.021 with compiler:&lt;BR /&gt;&lt;BR /&gt; Intel Visual Fortran Compiler for applications running on IA-32, Version 10.1 Build 20080602 Package ID: w_fc_p_10.1.024&lt;BR /&gt; Copyright (C) 1985-2008 Intel Corporation. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;and using the same compile line as before showed no problems.&lt;BR /&gt;&lt;BR /&gt;With the newer compiler and MKL, if I add my own copy of XERBLA to the&lt;BR /&gt;end of the test program, then the problem also goes away. Of course&lt;BR /&gt;I can't use that workaround if I link to the DLL version of MKL because&lt;BR /&gt;it's not possible to override a DLL routine in that way. In any case, we&lt;BR /&gt;can't tell NAG users to override XERBLA like that.&lt;BR /&gt;&lt;BR /&gt;So, my suspicion is that the CVF interface to XERBLA has been broken&lt;BR /&gt;somehow in newer versions of MKL. I'm guessing that the access violation&lt;BR /&gt;may be caused by a mixup of _cdecl and CVF calling conventions. XERBLA&lt;BR /&gt;attempts to use the value 6, which I think is the string length argument&lt;BR /&gt;of 'ZGETRF', as an address.&lt;BR /&gt;&lt;BR /&gt;Mick Pont&lt;BR /&gt;Numerical Algorithms Group, Oxford&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Dec 2011 16:49:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777072#M1164</guid>
      <dc:creator>Mick_Pont</dc:creator>
      <dc:date>2011-12-12T16:49:25Z</dc:date>
    </item>
    <item>
      <title>Access violation in XERBLA when using CVF interface to MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777073#M1165</link>
      <description>Here is a workaround, but it may not work for larger projects where you may need to use the recommendation of the Link Line Advisor:&lt;BR /&gt;&lt;BR /&gt; ifort /iface:cvf zgetx.f90 mkl_rt.lib&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Dec 2011 17:15:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777073#M1165</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2011-12-12T17:15:01Z</dc:date>
    </item>
    <item>
      <title>Access violation in XERBLA when using CVF interface to MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777074#M1166</link>
      <description>Thanks for that mecej4 - I might be able to get away with using mkl_rt.lib&lt;BR /&gt;&lt;BR /&gt;Mick</description>
      <pubDate>Tue, 13 Dec 2011 12:22:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777074#M1166</guid>
      <dc:creator>Mick_Pont</dc:creator>
      <dc:date>2011-12-13T12:22:07Z</dc:date>
    </item>
    <item>
      <title>Access violation in XERBLA when using CVF interface to MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777075#M1167</link>
      <description>Mick, yes this is the bug withCVF calling convention. We have escalated the issue (for  reference - this is the issue number #DPD200266877 ). The workaround suggested by mecej4 can help you. We will be back to you as soon as the fix of the problem will available.&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Dec 2011 06:37:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Access-violation-in-XERBLA-when-using-CVF-interface-to-MKL/m-p/777075#M1167</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-12-14T06:37:02Z</dc:date>
    </item>
  </channel>
</rss>

