source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB090-static-local-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.4 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 a variable declared in a scope inside an OpenMP construct:
9!* private if the variable has an automatic storage duration
10!* shared if the variable has a static storage duration.
11!
12!Dependence pairs:
13! tmp@38:13 vs. tmp@38:13
14! tmp@38:13 vs. tmp@39:20
15
16
17program DRB090_static_local_orig_yes
18 use omp_lib
19 implicit none
20
21 integer :: i, len
22 integer, dimension(:), allocatable :: a, b
23 integer, save :: tmp
24 integer :: tmp2
25
26 len = 100
27 allocate (a(len))
28 allocate (b(len))
29
30 do i = 1, len
31 a(i) = i
32 b(i) = i
33 end do
34
35 !$omp parallel
36 !$omp do
37 do i = 1, len
38 tmp = a(i)+i
39 a(i) = tmp
40 end do
41 !$omp end do
42 !$omp end parallel
43
44 !$omp parallel
45 !$omp do
46 do i = 1, len
47 tmp2 = b(i)+i
48 b(i) = tmp2
49 end do
50 !$omp end do
51 !$omp end parallel
52
53 print 100, a(50), b(50)
54 100 format (i3,3x,i3)
55
56 deallocate(a,b)
57
58end program
Note: See TracBrowser for help on using the repository browser.