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 | !!The scheduling constraints prohibit a thread in the team from executing
|
|---|
| 9 | !!a new task that modifies tp while another such task region tied to
|
|---|
| 10 | !!the same thread is suspended. Therefore, the value written will
|
|---|
| 11 | !!persist across the task scheduling point.
|
|---|
| 12 | !!No Data Race
|
|---|
| 13 |
|
|---|
| 14 | module DRB128
|
|---|
| 15 | integer :: tp, var
|
|---|
| 16 | !$omp threadprivate(tp)
|
|---|
| 17 | contains
|
|---|
| 18 | subroutine foo
|
|---|
| 19 | !$omp task
|
|---|
| 20 | !$omp task
|
|---|
| 21 | tp = 1
|
|---|
| 22 | !$omp task
|
|---|
| 23 | !$omp end task
|
|---|
| 24 | var = tp
|
|---|
| 25 | !$omp end task
|
|---|
| 26 | !$omp end task
|
|---|
| 27 | end subroutine
|
|---|
| 28 | end module
|
|---|
| 29 |
|
|---|
| 30 | program DRB128_tasking_threadprivate2_orig_no
|
|---|
| 31 | use omp_lib
|
|---|
| 32 | use DRB128
|
|---|
| 33 | implicit none
|
|---|
| 34 |
|
|---|
| 35 | call foo()
|
|---|
| 36 | print*,var
|
|---|
| 37 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.