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 | !Test if the semantics of omp_get_thread_num() is correctly recognized.
|
|---|
| 9 | !Thread with id 0 writes numThreads while other threads read it, causing data races.
|
|---|
| 10 | !Data race pair: numThreads@22 vs. numThreads@24.
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | program DRB075_getthreadnum_orig_yes
|
|---|
| 14 | use omp_lib
|
|---|
| 15 | implicit none
|
|---|
| 16 |
|
|---|
| 17 | integer :: numThreads
|
|---|
| 18 | numThreads = 0
|
|---|
| 19 |
|
|---|
| 20 | !$omp parallel
|
|---|
| 21 | if ( omp_get_thread_num()==0 ) then
|
|---|
| 22 | numThreads = omp_get_num_threads();
|
|---|
| 23 | else
|
|---|
| 24 | print*,'numThreads =',numThreads
|
|---|
| 25 | end if
|
|---|
| 26 | !$omp endparallel
|
|---|
| 27 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.