source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB086-static-data-member-orig-yes.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.2 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!For the case of a variable which is not referenced within a construct:
9!static data member should be shared, unless it is within a threadprivate directive.
10!
11!Dependence pair: counter@27:9 vs. counter@27:19
12
13module DRB086
14 implicit none
15 public :: A, foo
16
17 integer, save :: counter
18 integer, save :: pcounter
19
20 type A
21 integer :: counter
22 integer :: pcounter
23 end type
24 !$omp threadprivate(pcounter)
25contains
26 subroutine foo()
27 counter = counter + 1
28 pcounter = pcounter + 1
29 end subroutine
30end module
31
32program DRB086_static_data_member_orig_yes
33 use omp_lib
34 use DRB086
35 implicit none
36
37 type(A) :: c
38 c = A(0,0)
39
40 !$omp parallel
41 call foo()
42 !$omp end parallel
43
44 print *,counter,pcounter
45end program
Note: See TracBrowser for help on using the repository browser.