source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB128-tasking-threadprivate2-orig-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.1 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!!The scheduling constraints prohibit a thread in the team from executing
9!!a new task that modifies tp while another such task region tied to
10!!the same thread is suspended. Therefore, the value written will
11!!persist across the task scheduling point.
12!!No Data Race
13
14module DRB128
15 integer :: tp, var
16 !$omp threadprivate(tp)
17contains
18 subroutine foo
19 !$omp task
20 !$omp task
21 tp = 1
22 !$omp task
23 !$omp end task
24 var = tp
25 !$omp end task
26 !$omp end task
27 end subroutine
28end module
29
30program DRB128_tasking_threadprivate2_orig_no
31 use omp_lib
32 use DRB128
33 implicit none
34
35 call foo()
36 print*,var
37end program
Note: See TracBrowser for help on using the repository browser.