source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB095-doall2-taskloop-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.5 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!Two-dimensional array computation:
9!Only one loop is associated with omp taskloop.
10!The inner loop's loop iteration variable will be shared if it is shared in the enclosing context.
11!Data race pairs (we allow multiple ones to preserve the pattern):
12! Write_set = {j@36:20, j@36:30 (implicit step +1)}
13! Read_set = {j@36:22, j@36:24, j@37:35}
14! Any pair from Write_set vs. Write_set and Write_set vs. Read_set is a data race pair.
15
16!need to run with large thread number and large num of iterations.
17
18module DRB095
19 implicit none
20 integer, dimension(:,:), allocatable :: a
21end module
22
23program DRB095_doall2_taskloop_orig_yes
24 use omp_lib
25 use DRB095
26 implicit none
27
28 integer :: len, i, j
29 len = 100
30 allocate (a(len,len))
31
32 !$omp parallel
33 !$omp single
34 !$omp taskloop
35 do i = 1, len
36 do j = 1, len
37 a(i,j) = a(i,j)+1
38 end do
39 end do
40 !$omp end taskloop
41 !$omp end single
42 !$omp end parallel
43
44 print 100, a(50,50)
45 100 format ('a(50,50) =',i3)
46
47end program
Note: See TracBrowser for help on using the repository browser.