source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB140-reduction-barrier-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: 997 bytes
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!The assignment to a@21:9 is not synchronized with the update of a@29:11 as a result of the
9!reduction computation in the for loop.
10!Data Race pair: a@21:9 and a@24:30
11
12
13program DRB140_reduction_barrier_orig_yes
14 use omp_lib
15 implicit none
16
17 integer :: a, i
18
19 !$omp parallel shared(a) private(i)
20 !$omp master
21 a = 0
22 !$omp end master
23
24 !$omp do reduction(+:a)
25 do i = 1, 10
26 a = a+i
27 end do
28 !$omp end do
29
30 !$omp single
31 print*, "Sum is ", A
32 !$omp end single
33
34 !$omp end parallel
35end program
Note: See TracBrowser for help on using the repository browser.