source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB136-taskdep-mutexinoutset-orig-yes.f95@ 1aaefd4

1.23 2.0 main test-branch
Last change on this file since 1aaefd4 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.3 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!Due to the missing mutexinoutset dependence type on c, these tasks will execute in any
9!order leading to the data race at line 35. Data Race Pair, d@35:9 and d@35:9
10
11program DRB135_taskdep_mutexinoutset_orig_no_omp50
12 use omp_lib
13 implicit none
14
15 integer :: a, b, c, d
16
17 !$omp parallel
18 !$omp single
19 !$omp task depend(out: c)
20 c = 1 ! Task T1
21 !$omp end task
22 !$omp task depend(out: a)
23 a = 2 ! Task T2
24 !$omp end task
25 !$omp task depend(out: b)
26 b = 3 ! Task T3
27 !$omp end task
28 !$omp task depend(in: a)
29 c = c + a ! Task T4
30 !$omp end task
31 !$omp task depend(in: b)
32 c = c + b ! Task T5
33 !$omp end task
34 !$omp task depend(in: c)
35 d = c ! Task T6
36 !$omp end task
37 !$omp end single
38 !$omp end parallel
39
40 print *, d
41end program
Note: See TracBrowser for help on using the repository browser.