<?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 Re: Replacing XERBLA in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888779#M10222</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/431175"&gt;bb_12_bb_12&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Thank you Vladimir. &lt;BR /&gt;Now I understand. dgemm() calls XERBLA and cblas_dgemm calls cblas_xerbla().&lt;BR /&gt;&lt;BR /&gt;Is there a way to avoid getting the callbacks and check an error code instead after the function completes? I know that I can do it for vml (vmlGetErrStatus()). Is there a way to do it for BLAS, dgemm for example?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Unfortunately, no. BLAS doesn't have such functionality.&lt;BR /&gt;-Vladimir</description>
    <pubDate>Tue, 09 Jun 2009 11:14:43 GMT</pubDate>
    <dc:creator>Vladimir_Lunev</dc:creator>
    <dc:date>2009-06-09T11:14:43Z</dc:date>
    <item>
      <title>Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888772#M10215</link>
      <description>The MKL docs talk about replacing the BLAS error handler XERBLA, but don't provide much (any?) guidance.&lt;BR /&gt;&lt;BR /&gt;I am writing in C/C++, using Visual Studio 2005 to build my application, linking statically to MKL 10.1.0.018.&lt;BR /&gt;&lt;BR /&gt;If I simply write a function called xerbla (may xerbla_?) will it be linked in preference to the MKL version? Would I use cdecl calling convention for it?</description>
      <pubDate>Tue, 03 Mar 2009 21:11:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888772#M10215</guid>
      <dc:creator>johnwavemetrics_com</dc:creator>
      <dc:date>2009-03-03T21:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888773#M10216</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/406593"&gt;johnwavemetrics.com&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;The MKL docs talk about replacing the BLAS error handler XERBLA, but don't provide much (any?) guidance.&lt;BR /&gt;&lt;BR /&gt;I am writing in C/C++, using Visual Studio 2005 to build my application, linking statically to MKL 10.1.0.018.&lt;BR /&gt;&lt;BR /&gt;If I simply write a function called xerbla (may xerbla_?) will it be linked in preference to the MKL version? Would I use cdecl calling convention for it?&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Your xerbla would have compatible calling interface to legacy Fortran/f2c/ as you would see if you ran f2c on the netlib source version, with one exception: the Windows default linkage is cdecl, as you suggested, but with upper case identifiers and no trailing underscore. You could use dumpbin /symbols or equivalent method to check the one from MKL.  If you put it ahead of the mkl_core library in the link command, and use static linking, yours would be used in preference.&lt;BR /&gt;The XERBLA has Fortran linkage, so the parameters should be pointer to string, pointer to int, string length (6) by value. At least, this is what I expect to see. If you confirm whether you are writing for 32-bit or X64, I could try to confirm it. &lt;BR /&gt;</description>
      <pubDate>Wed, 04 Mar 2009 01:33:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888773#M10216</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-03-04T01:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888774#M10217</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;On Windows you need to use upper-case XERBLA to replace BLAS error handler.&lt;/DIV&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;&lt;/DIV&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;void XERBLA (char * Name, int * Num, int Len) {&lt;BR /&gt; printf("n*** My XERBLA is called :%s: %dn",Name,*Num);&lt;BR /&gt; return;&lt;BR /&gt;}&lt;/DIV&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;&lt;/DIV&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;-Vladimir&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 15 Mar 2009 05:27:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888774#M10217</guid>
      <dc:creator>Vladimir_Lunev</dc:creator>
      <dc:date>2009-03-15T05:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888775#M10218</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/406593"&gt;johnwavemetrics.com&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;The MKL docs talk about replacing the BLAS error handler XERBLA, but don't provide much (any?) guidance.&lt;BR /&gt;&lt;BR /&gt;I am writing in C/C++, using Visual Studio 2005 to build my application, linking statically to MKL 10.1.0.018.&lt;BR /&gt;&lt;BR /&gt;If I simply write a function called xerbla (may xerbla_?) will it be linked in preference to the MKL version? Would I use cdecl calling convention for it?&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hi John, did you ever get this to work? I am using the same setup and adding a function XERBLA didn't do anything.&lt;BR /&gt;What worked for me was implementing the following function (cdecl, implementd as C (not C++))&lt;BR /&gt;&lt;BR /&gt;void cblas_xerbla(const char *srname, const int *info, const int lsrname)&lt;BR /&gt;{&lt;BR /&gt; printf("n*** My xerbla is called :%s: %dn", srname, info);&lt;BR /&gt; return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I do get a call back with that. I am wondering if it's the right way to do it. &lt;BR /&gt;And anybody there at Intel, why is it that XERBLA doesn't work? Also, is there a way to just check the error code for BLAS/LAPACK functions after they complete? I don't always want to deal with callback functions. &lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Jun 2009 20:24:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888775#M10218</guid>
      <dc:creator>bb_12_bb_12</dc:creator>
      <dc:date>2009-06-07T20:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888776#M10219</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
As long as your linker symbols match up, you can do whatever you wish. This seems fine if you chose the CBLAS interface. In order to replace XERBLA directly with a C function, you must take into account the Fortran name mangling of the compiler you choose, as we discussed earlier in the thread.&lt;BR /&gt;</description>
      <pubDate>Sun, 07 Jun 2009 21:19:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888776#M10219</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-06-07T21:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888777#M10220</link>
      <description>&lt;P&gt;&lt;BR /&gt;Since the version MKL 10.1 Update 2, you can use both xerbla and XERBLA to replace MKL error handler.&lt;BR /&gt;The correct interface of MKL cblas_xerbla() is:&lt;BR /&gt;void cblas_xerbla (const char * Name, const int Num);&lt;BR /&gt;Note, this function is undocumented and we can change its interface in any time without special warnings.&lt;BR /&gt;&lt;BR /&gt;Please try such example:&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;MKL.H&gt;&lt;BR /&gt;#define buf_len 198&lt;BR /&gt;int main() {&lt;BR /&gt;&lt;BR /&gt;char transa, transb;&lt;BR /&gt;double *a, *b, *c;&lt;BR /&gt;double alpha, beta;&lt;BR /&gt;int n = 100, N, i, j;&lt;BR /&gt;char buf[buf_len];&lt;BR /&gt;&lt;BR /&gt;MKLGetVersionString(buf, buf_len);&lt;BR /&gt;printf("nMKL release version:n"); fflush(NULL);&lt;BR /&gt;printf("%sn",buf); fflush(NULL);&lt;BR /&gt;&lt;BR /&gt;transa = 'N'; transb = 'N';&lt;BR /&gt;alpha = 1.1; beta = -1.2;&lt;BR /&gt;a = (double *)calloc( n*n, sizeof( double ) );&lt;BR /&gt;b = (double *)calloc( n*n, sizeof( double ) );&lt;BR /&gt;c = (double *)calloc( n*n, sizeof( double ) );&lt;BR /&gt;&lt;BR /&gt;N = -n;&lt;BR /&gt;printf("nCall dgemmn"); fflush(NULL);&lt;BR /&gt;dgemm(&amp;amp;transa,&amp;amp;transb,&amp;amp;N,&amp;amp;N,&amp;amp;N,α,a,&amp;amp;N,b,&amp;amp;N,β,c,&amp;amp;N);&lt;BR /&gt;&lt;BR /&gt;printf("nCall cblas_dgemm"); fflush(NULL);&lt;BR /&gt;cblas_dgemm(CblasRowMajor,CblasNoTrans,CblasNoTrans,-N,N,N,alpha,a,N,b,N,beta,c,N);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void XERBLA (const char * Name, const int * Num, const int Len) {&lt;BR /&gt;printf("nUser xerbla is called :%s:%dn",Name,*Num); fflush(NULL);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void cblas_xerbla (const char * Name, const int Num) {&lt;BR /&gt;printf("nUser cblas_xerbla is called :%s:%dn",Name,Num); fflush(NULL);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You should see the output something like this:&lt;BR /&gt;&lt;BR /&gt;MKL release version:&lt;BR /&gt;Intel Math Kernel Library Version 10.1.1 Product Build 082212.12 for Intel 64 architecture applications&lt;BR /&gt;&lt;BR /&gt;Call dgemm&lt;BR /&gt;User xerbla is called :DGEMM :3&lt;BR /&gt;&lt;BR /&gt;Call cblas_dgemm&lt;BR /&gt;User cblas_xerbla is called :cblas_dgemm:5&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Vladimir&lt;/MKL.H&gt;&lt;/STDIO.H&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2009 15:05:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888777#M10220</guid>
      <dc:creator>Vladimir_Lunev</dc:creator>
      <dc:date>2009-06-08T15:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888778#M10221</link>
      <description>Thank you Vladimir. &lt;BR /&gt;Now I understand. dgemm() calls XERBLA and cblas_dgemm calls cblas_xerbla().&lt;BR /&gt;&lt;BR /&gt;Is there a way to avoid getting the callbacks and check an error code instead after the function completes? I know that I can do it for vml (vmlGetErrStatus()). Is there a way to do it for BLAS, dgemm for example?&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jun 2009 19:09:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888778#M10221</guid>
      <dc:creator>bb_12_bb_12</dc:creator>
      <dc:date>2009-06-08T19:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing XERBLA</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888779#M10222</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/431175"&gt;bb_12_bb_12&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Thank you Vladimir. &lt;BR /&gt;Now I understand. dgemm() calls XERBLA and cblas_dgemm calls cblas_xerbla().&lt;BR /&gt;&lt;BR /&gt;Is there a way to avoid getting the callbacks and check an error code instead after the function completes? I know that I can do it for vml (vmlGetErrStatus()). Is there a way to do it for BLAS, dgemm for example?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Unfortunately, no. BLAS doesn't have such functionality.&lt;BR /&gt;-Vladimir</description>
      <pubDate>Tue, 09 Jun 2009 11:14:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Replacing-XERBLA/m-p/888779#M10222</guid>
      <dc:creator>Vladimir_Lunev</dc:creator>
      <dc:date>2009-06-09T11:14:43Z</dc:date>
    </item>
  </channel>
</rss>

