1.23
2.0
acw/focus-triggers
main
test-branch
| 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 | !collapse(2) is used to associate two loops with omp for.
|
|---|
| 10 | !The corresponding loop iteration variables are private. No data race pairs.
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | module DRB093
|
|---|
| 14 | implicit none
|
|---|
| 15 | integer, dimension(:,:), allocatable :: a
|
|---|
| 16 | end module
|
|---|
| 17 |
|
|---|
| 18 | program DRB093_doall2_collapse_orig_no
|
|---|
| 19 | use omp_lib
|
|---|
| 20 | use DRB093
|
|---|
| 21 | implicit none
|
|---|
| 22 |
|
|---|
| 23 | integer :: len, i, j
|
|---|
| 24 | len = 100
|
|---|
| 25 |
|
|---|
| 26 | allocate (a(len,len))
|
|---|
| 27 |
|
|---|
| 28 | !$omp parallel do collapse(2)
|
|---|
| 29 | do i = 1, len
|
|---|
| 30 | do j = 1, len
|
|---|
| 31 | a(i,j) = a(i,j)+1
|
|---|
| 32 | end do
|
|---|
| 33 | end do
|
|---|
| 34 | !$omp end parallel do
|
|---|
| 35 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.