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
|
| 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 | !Data race on outLen due to ++ operation.
|
|---|
| 9 | !Adding private (outLen) can avoid race condition. But it is wrong semantically.
|
|---|
| 10 | !Data races on outLen also cause output[outLen++] to have data races.
|
|---|
| 11 | !
|
|---|
| 12 | !Data race pairs (we allow two pairs to preserve the original code pattern):
|
|---|
| 13 | !1. outLen@34 vs. outLen@34
|
|---|
| 14 | !2. output[]@33 vs. output[]@33
|
|---|
| 15 |
|
|---|
| 16 | program DRB018_plusplus_orig_yes
|
|---|
| 17 | use omp_lib
|
|---|
| 18 | implicit none
|
|---|
| 19 |
|
|---|
| 20 | integer :: i, inLen, outLen
|
|---|
| 21 | integer :: input(1000)
|
|---|
| 22 | integer :: output(1000)
|
|---|
| 23 |
|
|---|
| 24 | inLen = 1000
|
|---|
| 25 | outLen = 1
|
|---|
| 26 |
|
|---|
| 27 | do i = 1, inLen
|
|---|
| 28 | input(i) = i
|
|---|
| 29 | end do
|
|---|
| 30 |
|
|---|
| 31 | !$omp parallel do
|
|---|
| 32 | do i = 1, inLen
|
|---|
| 33 | output(outLen) = input(i)
|
|---|
| 34 | outLen = outLen + 1
|
|---|
| 35 | end do
|
|---|
| 36 | !$omp end parallel do
|
|---|
| 37 |
|
|---|
| 38 | print 100, output(500)
|
|---|
| 39 | 100 format ("output(500)=",i3)
|
|---|
| 40 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.