source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB096-doall2-taskloop-collapse-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.2 KB
RevLine 
[e3f356c]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!Two loops are associated with omp taskloop due to collapse(2).
10!Both loop index variables are private.
11!taskloop requires OpenMP 4.5 compilers. No data race pairs.
12
13module DRB096
14 implicit none
15 integer, dimension(:,:), allocatable :: a
16end module
17
18program DRB096_doall2_taskloop_collapse_orig_no
19 use omp_lib
20 use DRB096
21 implicit none
22
23 integer :: len, i, j
24 len = 100
25
26 allocate (a(len,len))
27
28 !$omp parallel
29 !$omp single
30 !$omp taskloop collapse(2)
31 do i = 1, len
32 do j = 1, len
33 a(i,j) = a(i,j)+1
34 end do
35 end do
36 !$omp end taskloop
37 !$omp end single
38 !$omp end parallel
39
40 print 100, a(50,50)
41 100 format ('a(50,50) =',i3)
42
43end program
Note: See TracBrowser for help on using the repository browser.