source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB135-taskdep-mutexinoutset-orig-omp50-no.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.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.