source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB124-master-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: 998 bytes
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!This example is derived from an example by Simone Atzeni, NVIDIA.
9!
10!Description: Race on variable init. The variable is written by the
11!master thread and concurrently read by the others.
12!
13!Solution: master construct at line 23:24 does not have an implicit barrier better
14!use single. Data Race Pair, init@24:9 and init@26:17.
15
16program DRB124_master_orig_yes
17 use omp_lib
18 implicit none
19
20 integer :: init, local
21
22 !$omp parallel shared(init) private(local)
23 !$omp master
24 init = 10
25 !$omp end master
26 local = init
27 !$omp end parallel
28
29end program
Note: See TracBrowser for help on using the repository browser.