<?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 Thread safety of MKL 10.3 (update 3) in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826343#M5137</link>
    <description>Easy mistake to make as the Intel compiler does not complain about the #pragma omp even when /Qopenmp is not specified&lt;BR /&gt;Will be interested to hear what you discover...</description>
    <pubDate>Fri, 13 May 2011 15:32:36 GMT</pubDate>
    <dc:creator>AndrewC</dc:creator>
    <dc:date>2011-05-13T15:32:36Z</dc:date>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826335#M5129</link>
      <description>I am checking the thread safety of my code using Intel Inspector XE ( Windows/x64). My code is using omp threading around calls to MKL (parallel)&lt;BR /&gt;&lt;BR /&gt;I get many data race conditions reported in MKL. This is very frustrating as I can never tell what is a real issue and what is bogus.&lt;BR /&gt;&lt;BR /&gt;For example, this code reports many data races such as below.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Time Description Modules Sources&lt;BR /&gt;8:24:42 Error:Data race mkl_core.dll mkl_core.dll!0x23a0; mkl_core.dll!0x254d&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]#include "mkl.h"
#include "mkl_vml_functions.h"
#include &lt;STDIO.H&gt;
#define SIZE ((size_t)10)
//
  // set_diff.cpp
  //

int testMKL()
{
	double *a, *b, *c;
	a = new double [SIZE*SIZE*2];
	b = new double [SIZE*SIZE*2];
	c = new double [SIZE*SIZE*2];
	double alpha[2]={1,0};
	double beta[2]={1,0};
	int m=SIZE, n=SIZE, k=SIZE, lda=SIZE, ldb=SIZE, ldc=SIZE, i=0, j=0;
	char transa='n', transb='n';
	for( i=0; i&lt;SIZE&gt; &lt;BR /&gt;&lt;/SIZE&gt;&lt;/STDIO.H&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2011 15:41:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826335#M5129</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-05-10T15:41:18Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826336#M5130</link>
      <description>If you call MKL from a single thread region, there is no mistake you can make (except maybe insufficient array sizes or other data overlaps) which would cause race conditions in MKL, so you would have to ignore any indications by Inspector within MKL.&lt;BR /&gt;In the early days of the predecessors of Inspector, they used to tell us we could test libraries for thread safety, so you would have a complaint to make in that respect.&lt;BR /&gt;If you call dgemm from a threaded region, you would need to assure that the c[] array which is updated by dgemm is a distinct data set in each thread.</description>
      <pubDate>Tue, 10 May 2011 16:35:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826336#M5130</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-05-10T16:35:00Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826337#M5131</link>
      <description>&lt;BR /&gt;I am calling MKL from multiple (OMP) threads, by inspection you can see my sample code is using distinct arrays for each thread ( as they are allocated inside the routine). There should not be any data races if MKL is "thread-safe".&lt;BR /&gt;&lt;BR /&gt;I am using the lastest Inspector XE 2011 and in my experience, when it says "data race" it is correct. When running my application code, all these MKL "data race" errors can crowd out and obscure real errors.&lt;BR /&gt;&lt;BR /&gt;It seems not unreasonable that given that MKL and Inspector XE are both Intel products they should "play nice" with each other. So who do I submit a bug report ? MKL team or Inspector XE team???&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 May 2011 16:52:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826337#M5131</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-05-10T16:52:25Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826338#M5132</link>
      <description>Andrew,&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;thanks for reporting this issue. i will try to re-pro this and understand whose issue it is (Inspector or MKL)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;What is the level of Inspector analysis you run? is the option to check stack accesses was enabled?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;--Gennady&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 May 2011 17:37:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826338#M5132</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-05-10T17:37:25Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826339#M5133</link>
      <description>&lt;PRE&gt;[cpp]// the following will show many "errors" in MKL  in inspector XE. Link against "parallel MKL"&lt;BR /&gt;&lt;BR /&gt;#include "mkl.h"
#include "mkl_vml_functions.h"
#include &lt;STDIO.H&gt;
#define SIZE ((size_t)10)
//
  // set_diff.cpp
  //


int testZGETRS()
{


	  #define  NMAX 4
	  int N=NMAX;
	  int LDA=N;
	  int IPIV[NMAX];

	  MKL_Complex16 A[NMAX*NMAX]={ 
	 {-1.34, 2.55}, { 0.28, 3.17}, {-6.39,-2.20}, { 0.72,-0.92},
	 {-0.17,-1.41}, { 3.31,-0.15}, {-0.15, 1.34}, { 1.29, 1.38},
	 {-3.29,-2.39}, {-1.91, 4.42}, {-0.14,-1.35}, { 1.72, 1.35},
	 { 2.41, 0.39}, {-0.56, 1.47}, {-0.83,-0.69}, {-1.96, 0.67} 
	  };

	 MKL_Complex16 B[NMAX]={{26.26, 51.78}, {31.32, -6.70},
	 { 6.43, -8.68}, {15.86, -1.42}};
	 int INFO=0;
	 zgetrf(&amp;amp;N,&amp;amp;N,A,&amp;amp;LDA,IPIV,&amp;amp;INFO);
	 if(INFO==0){
		 const char *TRANS="N";
		 int NRHS=1;
		 int LDB=N;
		 zgetrs(TRANS,&amp;amp;N,&amp;amp;NRHS,A,&amp;amp;LDA,IPIV,B,&amp;amp;LDB,&amp;amp;INFO);
	 }
	 return INFO;
}

int testzgemm3m()
{
	double *a, *b, *c;
	a = new double [SIZE*SIZE*2];
	b = new double [SIZE*SIZE*2];
	c = new double [SIZE*SIZE*2];
	double alpha[2]={1,0};
	double beta[2]={1,0};
	int m=SIZE, n=SIZE, k=SIZE, lda=SIZE, ldb=SIZE, ldc=SIZE, i=0, j=0;
	char transa='n', transb='n';
	for( i=0; i&lt;SIZE&gt;&lt;/SIZE&gt;&lt;/STDIO.H&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 May 2011 19:40:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826339#M5133</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-05-10T19:40:42Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826340#M5134</link>
      <description>it may be the false positive or smth like that. I checked your last example with theIntel Inspector XE 2011 Update 3, (&lt;B&gt;build 147581&lt;/B&gt;), Copyright  2009-2011 Intel Corporation. All rights reserved.&lt;DIV&gt;and Inspector reported: &lt;B&gt;"No Problems detected". &lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;- &lt;/B&gt;The stack frame which I used == 32 ( maximum)&lt;/DIV&gt;&lt;DIV&gt;- checked on Core2Duo CPU.&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;BR /&gt;&lt;/B&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 May 2011 18:45:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826340#M5134</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-05-11T18:45:21Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826341#M5135</link>
      <description>Hi Gennady,&lt;BR /&gt;&lt;BR /&gt;You must be doing something different to me. I am using the identical Inspector XE version. &lt;BR /&gt;&lt;BR /&gt;None of my MKL code runs without some many "complaints" in XE when called from multiple threads (threaded by OpenMP)&lt;BR /&gt;&lt;BR /&gt;Are you sure you&lt;BR /&gt;- Compiled with the Intel Compiler&lt;BR /&gt;- Compiled with Generate Parallel Code (/Qopenmp) ON.&lt;BR /&gt;- Do you see multiple threads created in the XE log.&lt;BR /&gt;- You are checking "Threading Errors" not "Memory Errors"&lt;BR /&gt;&lt;BR /&gt;Can I see your compiler command line?&lt;BR /&gt;&lt;BR /&gt;Andrew&lt;BR /&gt;</description>
      <pubDate>Wed, 11 May 2011 19:02:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826341#M5135</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-05-11T19:02:33Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826342#M5136</link>
      <description>Hi Andrew,&lt;DIV&gt;yeap, it was my fault :) - I was in a hurry and missed to add the /Qopenmp option.&lt;/DIV&gt;&lt;DIV&gt;now I see ~similar report with the last example you provided:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;B&gt;test.exe!mkl_serv_setxer - test.exe:44061&lt;/B&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!zgetrf - test.exe:8389&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!testZGETRS - test.cpp:30&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!main - test.cpp:78&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!main - test.cpp:76&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!_tmainCRTStartup - crtexe.c:586&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;test.exe!mainCRTStartup - crtexe.c:402&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;test.exe!mkl_serv_setxer - test.exe:44061test.exe!zgetrf - test.exe:8389test.exe!testZGETRS - test.cpp:30test.exe!main - test.cpp:78test.exe!main - test.cpp:76test.exe!_tmainCRTStartup - crtexe.c:586test.exe!mainCRTStartup - crtexe.c:402&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;We need to check where is the problem - mkl and/or Inspector.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;--Gennady&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 May 2011 06:41:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826342#M5136</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-05-13T06:41:21Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826343#M5137</link>
      <description>Easy mistake to make as the Intel compiler does not complain about the #pragma omp even when /Qopenmp is not specified&lt;BR /&gt;Will be interested to hear what you discover...</description>
      <pubDate>Fri, 13 May 2011 15:32:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826343#M5137</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-05-13T15:32:36Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826344#M5138</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV id="Normalcontent"&gt;&lt;DIV id="imcontent"&gt;&lt;SPAN style="font-family: Calibri; color: #800000;"&gt;Andrew,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="imcontent"&gt;&lt;SPAN style="font-family: Calibri; color: #800000;"&gt;The initial investigations shown that is sort of the benign race in 
our library whentwo or more threads are writing into same varaible same value. 
Indeed , such situation should be specially handled in Inspector to be not 
exposed and not confuse users.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="imcontent"&gt;&lt;SPAN style="font-family: Calibri; color: #800000;"&gt;--Gennady&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 May 2011 08:49:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826344#M5138</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2011-05-19T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Thread safety of MKL 10.3 (update 3)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826345#M5139</link>
      <description>Hi Gennady,&lt;BR /&gt;The latest update to MKL 10.3.5 seems to have fixed these issues. That's great!&lt;BR /&gt;&lt;BR /&gt;Andrew</description>
      <pubDate>Mon, 15 Aug 2011 21:17:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Thread-safety-of-MKL-10-3-update-3/m-p/826345#M5139</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2011-08-15T21:17:38Z</dc:date>
    </item>
  </channel>
</rss>

