source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB135-taskdep-mutexinoutset-orig-omp50-no.f95@ cc8e265

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since cc8e265 was e3f356c, checked in by Wenhao Wu <wuwenhao@…>, 5 years ago

merge from branch omptrans for tacas2022

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

  • Property mode set to 100755
File size: 1.4 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!Addition of mutexinoutset dependence type on c, will ensure that line d@36:9 assignment will depend
9!on task at Line 29 and line 32. They might execute in any order but not at the same time.
10!There is no data race.
11
12program DRB135_taskdep_mutexinoutset_orig_no_omp50
13 use omp_lib
14 implicit none
15
16 integer :: a, b, c, d
17
18 !$omp parallel
19 !$omp single
20 !$omp task depend(out: c)
21 c = 1 ! Task T1
22 !$omp end task
23 !$omp task depend(out: a)
24 a = 2 ! Task T2
25 !$omp end task
26 !$omp task depend(out: b)
27 b = 3 ! Task T3
28 !$omp end task
29 !$omp task depend(in: a) depend(mutexinoutset: c)
30 c = c + a ! Task T4
31 !$omp end task
32 !$omp task depend(in: b) depend(mutexinoutset: c)
33 c = c + b ! Task T5
34 !$omp end task
35 !$omp task depend(in: c)
36 d = c ! Task T6
37 !$omp end task
38 !$omp end single
39 !$omp end parallel
40
41 print *, d
42end program
Note: See TracBrowser for help on using the repository browser.