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