source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB165-taskdep4-orig-omp50-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.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!There is no completion restraint on the second child task. Hence, immediately after the first
9!taskwait it is unsafe to access the y variable since the second child task may still be
10!executing.
11!Data Race at y@34:8 and y@41:23
12
13program DRB165_taskdep4_orig_yes_omp_50
14 use omp_lib
15 implicit none
16
17 !$omp parallel
18 !$omp single
19 call foo()
20 !$omp end single
21 !$omp end parallel
22contains
23 subroutine foo()
24 implicit none
25 integer :: x, y
26 x = 0
27 y = 2
28
29 !$omp task depend(inout: x) shared(x)
30 x = x+1 !!1st Child Task
31 !$omp end task
32
33 !$omp task shared(y)
34 y = y-1 !!2nd child task
35 !$omp end task
36
37 !$omp taskwait depend(in: x) !!1st taskwait
38
39 print*, "x=", x
40 print*, "y=", y
41
42 !$omp taskwait !!2nd taskwait
43 end subroutine foo
44end program
Note: See TracBrowser for help on using the repository browser.