source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB101-task-value-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.3 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! * Cover an implicitly determined rule: In a task generating construct,
9! * a variable without applicable rules is firstprivate. No data race pairs.
10
11
12module DRB101
13 implicit none
14 integer, dimension(:), allocatable :: a
15contains
16 subroutine gen_task(i)
17 use omp_lib
18 implicit none
19 integer, value :: i
20 !$omp task
21 a(i) = i+1
22 !$omp end task
23 end subroutine
24end module
25
26program DRB101_task_value_orig_no
27 use omp_lib
28 use DRB101
29 implicit none
30
31 integer :: i
32 allocate (a(100))
33
34 !$omp parallel
35 !$omp single
36 do i = 1, 100
37 call gen_task(i)
38 end do
39 !$omp end single
40 !$omp end parallel
41
42 do i = 1, 100
43 if (a(i) /= i+1) then
44 print*,'warning: a(',i,') =',a(i),' not expected',i+1
45 end if
46! print*,a(i),i+1
47 end do
48end program
Note: See TracBrowser for help on using the repository browser.