source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB114-if-orig-yes.f95

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.0 KB
Line 
1!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
2!!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
3!!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
4!!!
5!!! SPDX-License-Identifier: (BSD-3-Clause)
6!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
7
8!When if() evalutes to true, this program has data races due to true dependence within the loop at 31.
9!Data race pair: a[i+1]@32:9 vs. a[i]@32:18
10
11program DRB114_if_orig_yes
12 use omp_lib
13 implicit none
14
15 integer i, len, rem, j
16 real :: u
17 integer, parameter :: dp = kind(1.0d0)
18 real(dp), dimension(:), allocatable :: a
19
20 len = 100
21 allocate (a(len))
22
23 do i = 1, len
24 a(i) = i
25 end do
26
27 call random_number(u)
28 j = FLOOR(100*u)
29
30 !$omp parallel do if (MOD(j,2)==0)
31 do i = 1, len-1
32 a(i+1) = a(i)+1
33 end do
34 !$omp end parallel do
35
36 print*,'a(50) =',a(50)
37
38 deallocate(a)
39end program
Note: See TracBrowser for help on using the repository browser.