<?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 Inspector strange data race warning in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779663#M229</link>
    <description>Hi,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I use the Inspector to see if my program has any data race conditions. I get a warning that I cannot interpret.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;This is a segment of the code:&lt;/DIV&gt;&lt;DIV&gt;[fortran]!$omp parallel do default(none) &amp;amp;
!$omp private(j) &amp;amp;
!$omp shared(nb1,nb2, adf) &amp;amp;
!$omp reduction(+:counter) &amp;amp;
!$omp schedule(static,200)
do j=1,nb1+nb2
  ...
  counter=counter+1
  CALL DGETRF(adf(j+1)-adf(j),adf(j+1)-adf(j),A(1,1,j),mxxinj,IPVT(1,j),info) 
  ...
endif[/fortran] It issues a "data race" on the DGETRF subrouting call. More specifically, the call stack goes: my_subroutine-&amp;gt;libmkl_intel_lp64.so!DGETRF_-&amp;gt;libmkl_core.so!mkl_serv_allocate for the Read description andmy_subroutine-&amp;gt;libmkl_intel_lp64.so!DGETRF_-&amp;gt;libmkl_core.so!mkl_serv_allocate-&amp;gt;libmkl_core.so!mkl_serv_unlock for the write description &lt;B&gt;on the same code line&lt;/B&gt;.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;From the DGETRF call:&lt;/DIV&gt;&lt;DIV&gt;-A, IPVT and info are threadprivate&lt;/DIV&gt;&lt;DIV&gt;-adf is shared&lt;/DIV&gt;&lt;DIV&gt;-mxxinj is declared as a parameter (so, shared by default, I think).&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I compile with:&lt;/DIV&gt;&lt;DIV&gt;[bash]-g -fno-alias -fpp -openmp -openmp-report -I$(MKLROOT)/include -align -zero -O3 -msse4 -simd -module $(OBJS_DIR) -c[/bash]&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;And link with:&lt;/DIV&gt;[bash]-L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -liomp5 -lpthread -lm[/bash] &lt;DIV&gt;The results I get when compared to compiling without openmp (sequential run) are the same.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any ideas welcome!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance,&lt;/DIV&gt;&lt;DIV&gt;Petros&lt;/DIV&gt;</description>
    <pubDate>Mon, 02 Apr 2012 15:23:57 GMT</pubDate>
    <dc:creator>Petros</dc:creator>
    <dc:date>2012-04-02T15:23:57Z</dc:date>
    <item>
      <title>Inspector strange data race warning</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779663#M229</link>
      <description>Hi,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I use the Inspector to see if my program has any data race conditions. I get a warning that I cannot interpret.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;This is a segment of the code:&lt;/DIV&gt;&lt;DIV&gt;[fortran]!$omp parallel do default(none) &amp;amp;
!$omp private(j) &amp;amp;
!$omp shared(nb1,nb2, adf) &amp;amp;
!$omp reduction(+:counter) &amp;amp;
!$omp schedule(static,200)
do j=1,nb1+nb2
  ...
  counter=counter+1
  CALL DGETRF(adf(j+1)-adf(j),adf(j+1)-adf(j),A(1,1,j),mxxinj,IPVT(1,j),info) 
  ...
endif[/fortran] It issues a "data race" on the DGETRF subrouting call. More specifically, the call stack goes: my_subroutine-&amp;gt;libmkl_intel_lp64.so!DGETRF_-&amp;gt;libmkl_core.so!mkl_serv_allocate for the Read description andmy_subroutine-&amp;gt;libmkl_intel_lp64.so!DGETRF_-&amp;gt;libmkl_core.so!mkl_serv_allocate-&amp;gt;libmkl_core.so!mkl_serv_unlock for the write description &lt;B&gt;on the same code line&lt;/B&gt;.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;From the DGETRF call:&lt;/DIV&gt;&lt;DIV&gt;-A, IPVT and info are threadprivate&lt;/DIV&gt;&lt;DIV&gt;-adf is shared&lt;/DIV&gt;&lt;DIV&gt;-mxxinj is declared as a parameter (so, shared by default, I think).&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I compile with:&lt;/DIV&gt;&lt;DIV&gt;[bash]-g -fno-alias -fpp -openmp -openmp-report -I$(MKLROOT)/include -align -zero -O3 -msse4 -simd -module $(OBJS_DIR) -c[/bash]&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;And link with:&lt;/DIV&gt;[bash]-L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -liomp5 -lpthread -lm[/bash] &lt;DIV&gt;The results I get when compared to compiling without openmp (sequential run) are the same.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any ideas welcome!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance,&lt;/DIV&gt;&lt;DIV&gt;Petros&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Apr 2012 15:23:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779663#M229</guid>
      <dc:creator>Petros</dc:creator>
      <dc:date>2012-04-02T15:23:57Z</dc:date>
    </item>
    <item>
      <title>Inspector strange data race warning</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779664#M230</link>
      <description>You don't show whether you allowed for info to be private. That would be enough to produce a warning, even if all threads are returning the same value in your case.&lt;BR /&gt;Not all versions of Intel OpenMP work with the pre-f90" method for passing an array section by designating the first element, as you do with A(1,1,j) and IPVT(1,j), but your success shows that's not the issue here.</description>
      <pubDate>Fri, 06 Apr 2012 11:32:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779664#M230</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2012-04-06T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Inspector strange data race warning</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779665#M231</link>
      <description>&lt;DIV id="tiny_quote"&gt;
                &lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A href="https://community.intel.com/en-us/profile/336549/" class="basic" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=336549"&gt;TimP (Intel)&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;I&gt;You don't show whether you allowed for info to be private. That would be enough to produce a warning, even if all threads are returning the same value in your case.&lt;BR /&gt;Not all versions of Intel OpenMP work with the pre-f90" method for passing an array section by designating the first element, as you do with A(1,1,j) and IPVT(1,j), but your success shows that's not the issue here.&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;a better description of the code is:&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;[bash]module a1
use dimensions
integer :: IPVT(M,nb1+nb2+nb3)
double precision :: A(M,nb1+nb2+nb3)
end module a1

subroutine simulator
use a1
implicit none
integer, save:: info
integer :: adf(nb1+nb2+nb3)
!$omp threadprivate(info,A,IPVT)
...
!$omp parallel
A=0.d0
info=0.d0
IPVT=0.d0
!$omp end parallel
...
!$omp parallel do default(none) &amp;amp;
!$omp private(j) &amp;amp;
!$omp shared(nb1,nb2,nb3,adf) &amp;amp;
!$omp reduction(+:counter) &amp;amp;
!$omp schedule(static,200)
do j=1,nb1+nb2+nb3
  ...
  counter=counter+1
  CALL DGETRF(adf(j+1)-adf(j),adf(j+1)-adf(j),A(1,1,j),mxxinj,IPVT(1,j),info) 
  ...
endif
...
end subroutine simulator[/bash] &lt;/DIV&gt;&lt;DIV&gt;You think it might be the f77 way of calling lapack?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Apr 2012 13:22:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779665#M231</guid>
      <dc:creator>Petros</dc:creator>
      <dc:date>2012-04-06T13:22:16Z</dc:date>
    </item>
    <item>
      <title>Inspector strange data race warning</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779666#M232</link>
      <description>No, each call updates info, and you could get a failure which you never see reported because of another thread reporting success before you see the failure. You may not care, it's only a warning. It's unlikely to be a big performance hit relative to the work done in dgetrf.&lt;BR /&gt;If the "f77 array section" notation were biting you, you wouldn't have had a successful run. I don't know of it being a problem in a released OpenMP.</description>
      <pubDate>Fri, 06 Apr 2012 16:08:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779666#M232</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2012-04-06T16:08:31Z</dc:date>
    </item>
    <item>
      <title>Inspector strange data race warning</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779667#M233</link>
      <description>&lt;DIV id="tiny_quote"&gt;
                &lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=336549" class="basic" href="https://community.intel.com/en-us/profile/336549/"&gt;TimP (Intel)&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;I&gt;No, each call updates info, and you could get a failure which you never see reported because of another thread reporting success before you see the failure. You may not care, it's only a warning. It's unlikely to be a big performance hit relative to the work done in dgetrf.&lt;BR /&gt;If the "f77 array section" notation were biting you, you wouldn't have had a successful run. I don't know of it being a problem in a released OpenMP.&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;"info" is threadprivate, so each thread has it's own info variable. dgetrf subroutines called by different threads update different info variables. I don't see how they could collide...&lt;BR /&gt;&lt;BR /&gt;I will try changing for f95 lapack calls and see if inspector still complains.&lt;BR /&gt;&lt;BR /&gt;Thanks for the effort!&lt;BR /&gt;&lt;BR /&gt;Petros</description>
      <pubDate>Fri, 06 Apr 2012 22:31:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Inspector-strange-data-race-warning/m-p/779667#M233</guid>
      <dc:creator>Petros</dc:creator>
      <dc:date>2012-04-06T22:31:13Z</dc:date>
    </item>
  </channel>
</rss>

