<?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: Fortran + OpenMP + Thread checker in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741985#M1279</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I've seen a few anomalies with -tcheck which have been corrected in recent compilers. Going even further back, in case you are using a very old compiler, at one time -tcheck didn't set the other options it requires, such as debug symbols.&lt;BR /&gt;I've also received hints that major enhancements to support Parallel Studio have put some of the work on Fortran tcheck on hold.&lt;BR /&gt;</description>
    <pubDate>Wed, 09 Dec 2009 13:41:31 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2009-12-09T13:41:31Z</dc:date>
    <item>
      <title>Fortran + OpenMP + Thread checker</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741982#M1276</link>
      <description>&lt;PRE&gt;[cpp]According to Intel's thread checker, the attached Fortran+OpenMP code produces a write-&amp;gt;write data-race. Can anyone say why this is happening? I don't understand why&lt;BR /&gt;the race condition is only produced in the v-variable in the subroutine and not in the other cases. Is this a problem with&lt;BR /&gt;the code, the compiler or the thread checker???&lt;BR /&gt;&lt;BR /&gt;Fabian&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;program iomp_itt
   implicit none

   type tvector
      real(kind=8), dimension(:), pointer :: u,v
   end type tvector

   type tgrid
      type(tvector) :: t
   end type tgrid

   type(tgrid) :: grid
   integer(kind=4) :: i
   
   allocate(grid%t%u(1:26))
   allocate(grid%t%v(1:26))

   !$omp parallel do shared(grid)
   do i=1,26
      ! no data race 
      grid%t%u(i) = 0.0_8
      ! no data race 
      grid%t%v(i) = 0.0_8
   end do
   !$omp end parallel do
   
   call test(grid)

   deallocate(grid%t%u)
   deallocate(grid%t%v)

contains

   subroutine test(g)
      type(tgrid) :: g
      integer(kind=4) :: i

      !$omp parallel do shared(g)
      do i=1,26
         ! no data race 
         g%t%u(i) = 0.0_8
         ! the following line produces a write-&amp;gt;write data-race
         g%t%v(i) = 0.0_8
      end do
      !$omp end parallel do

  end subroutine test

end program iomp_itt
[/cpp]&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Dec 2009 15:50:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741982#M1276</guid>
      <dc:creator>fah10</dc:creator>
      <dc:date>2009-12-08T15:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran + OpenMP + Thread checker</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741983#M1277</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Asside from the fact that your loop and work contained are too small to take advantage of parallization, one would expect thatboth loops would exhibit the same behavior. In the first loop grid is a local array, in the second g is a passed descriptor of grid (which generates a copy of the descriptor of grid). This may be a case of the unLuck of the draw.&lt;BR /&gt;&lt;BR /&gt;As an experiment, make the iteration space (26)such that when divided by the number of threads is a multiple of 8 (8 real(kind=8) fit in a cache line).&lt;BR /&gt;&lt;BR /&gt;2 threads 32&lt;BR /&gt;3 threads 48&lt;BR /&gt;4 threads 32&lt;BR /&gt;5 threads 40&lt;BR /&gt;6 threads 48&lt;BR /&gt;7 threads 56&lt;BR /&gt;8 threads 64&lt;BR /&gt;&lt;BR /&gt;This will give you the smallest number of iterations yet when divided up amongst the threads, each thread is isolated within cache lines.&lt;BR /&gt;&lt;BR /&gt;Your test program might be of interest to Intel.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Dec 2009 16:42:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741983#M1277</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-12-08T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran + OpenMP + Thread checker</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741984#M1278</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
The problem doesn't seem to depend on the length on the array. However, I figured out that Intel's thread checker is only complaining about the data race when the program was compiled with -tcheck&lt;BR /&gt;Just compiling without -tcheck is also not an option because then the thread checker complains about data races when allocating a private array inside a parallel region. It's really a mess with OpenMP... :-(&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 09:15:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741984#M1278</guid>
      <dc:creator>fah10</dc:creator>
      <dc:date>2009-12-09T09:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fortran + OpenMP + Thread checker</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741985#M1279</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I've seen a few anomalies with -tcheck which have been corrected in recent compilers. Going even further back, in case you are using a very old compiler, at one time -tcheck didn't set the other options it requires, such as debug symbols.&lt;BR /&gt;I've also received hints that major enhancements to support Parallel Studio have put some of the work on Fortran tcheck on hold.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 13:41:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fortran-OpenMP-Thread-checker/m-p/741985#M1279</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2009-12-09T13:41:31Z</dc:date>
    </item>
  </channel>
</rss>

