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 | !The loop in this example cannot be parallelized.
|
|---|
| 9 | !
|
|---|
| 10 | !This pattern has two pair of dependencies:
|
|---|
| 11 | !1. loop carried output dependence
|
|---|
| 12 | ! x = .. :
|
|---|
| 13 | !
|
|---|
| 14 | !2. loop carried true dependence due to:
|
|---|
| 15 | !.. = x;
|
|---|
| 16 | ! x = ..;
|
|---|
| 17 | !Data race pairs: we allow two pairs to preserve the original code pattern.
|
|---|
| 18 | ! 1. x@48 vs. x@49
|
|---|
| 19 | ! 2. x@49 vs. x@49
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | module globalArray
|
|---|
| 23 | implicit none
|
|---|
| 24 | integer, dimension(:), allocatable :: a
|
|---|
| 25 | contains
|
|---|
| 26 | subroutine useGlobalArray(len)
|
|---|
| 27 | integer :: len
|
|---|
| 28 | len = 100
|
|---|
| 29 | allocate (a(100))
|
|---|
| 30 | end subroutine useGlobalArray
|
|---|
| 31 | end module globalArray
|
|---|
| 32 |
|
|---|
| 33 | program DRB016_outputdep_orig_yes
|
|---|
| 34 | use omp_lib
|
|---|
| 35 | use globalArray
|
|---|
| 36 |
|
|---|
| 37 | implicit none
|
|---|
| 38 |
|
|---|
| 39 | integer len, i, x
|
|---|
| 40 |
|
|---|
| 41 | len = 100
|
|---|
| 42 | x = 10
|
|---|
| 43 |
|
|---|
| 44 | call useGlobalArray(len)
|
|---|
| 45 |
|
|---|
| 46 | !$omp parallel do
|
|---|
| 47 | do i = 1, len
|
|---|
| 48 | a(i) = x
|
|---|
| 49 | x = i
|
|---|
| 50 | end do
|
|---|
| 51 | !$omp end parallel do
|
|---|
| 52 |
|
|---|
| 53 | write(*,*) "x =",x
|
|---|
| 54 | end program
|
|---|
| 55 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.