- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]program test use omp_lib implicit none real, dimension(:), allocatable :: Da,DaLocal real :: di integer, parameter :: n=100, nset=16 integer :: i,iset,imin,imax allocate(Da(n)) ! *** ! Standard OpenMP Do-loop ! *** !$omp parallel do default(none) private(di) shared(i,Da) do i=1,size(Da) di = real(i) Da(i) = di end do !$omp end parallel do ! *** ! Blocked OpenMP Do-loop ! *** !$omp parallel default(none) private(DaLocal,di,i,imax) shared(Da) allocate(DaLocal(nset)) !$omp do schedule(static,1) do iset = 1, size(Da), nset ! Compute upper index of current block imax = min(size(Da), iset-1+nset) ! Loop over all 1,2,3... items in current set do i = 1, imax-iset+1 ! Perform computation di = real(i+iset-1) DaLocal(i) = di end do ! Copy local data into gobal array do i = 1, imax-iset+1 Da(i+iset-1) = DaLocal(i) end do end do !$omp end do deallocate(DaLocal) !$omp end parallel deallocate(Da) end program test [/fortran]
Intel Inspector XE running Analysis "Locate Deadlocks and Data Races" with option "Detect data races on stack accesses" enabled and "Scope" set to "Extremely thorough" indicates
1. Cross-thread stack access in line 34
2. Data race in line 34
First of all, I do think that the code is correct, is it?. I understand that the standard Do-loop is preferable in this case but the code is extracted from a larger application, where each thread needs to allocate a set of private working arrays and private derived types in order to perform some more complicated computations before it can copy the local results into the global array.
If the code is correct then is the data race problem reported by Intel Inspector XE really a "problem" which can be solved by a better implementation or is it an "internal problem" of the inspector tool?
Any help will be greatly appreaciated
Matthias
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tested your code with same Inspector XE version, but hard to reproduce this problem.
Is it due to different Intel Fortran compiler, or different OS?
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
# ifort -V
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.2.273 Build 20111128
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
# ifort test.f90 -g -openmp -openmp-report -o test.ifort
test.f90(17): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
test.f90(34): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
test.f90(30): (col. 9) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
# inspxe-cl -collect ti3 -- ./test.ifort
Used suppression file(s): []
0 new problem(s) found
Regadrs, Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are welcome:-)
Thank you for the update. It seems that this is compiler related issue.
Regards, Peter

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page