OSDN Git Service

[OpenMP] Fix hierarchical barrier
authorTerry Wilmarth <terry.l.wilmarth@intel.com>
Wed, 13 Jan 2021 16:09:39 +0000 (10:09 -0600)
committerNawrin Sultana <nawrin.sultana@intel.com>
Wed, 13 Jan 2021 16:22:57 +0000 (10:22 -0600)
commit4fe17ada55ade9b77e18521dae0985cb4a88f6c4
tree2b3a7c7bfb04bb8f8f2bbdf85967a0141f855f18
parenta957634942a48c963a8ed99b1bb90f7b985a3602
[OpenMP] Fix hierarchical barrier

Hierarchical barrier is an experimental barrier algorithm that uses aspects
of machine hierarchy to define the barrier tree structure. This patch fixes
offset calculation in hierarchical barrier. The offset is used to store info
on a flag about sleeping threads waiting on a location stored in the flag.
This commit also fixes a potential deadlock in hierarchical barrier when
using infinite blocktime by adjusting the offset value of leaf kids so that
it matches the value of leaf state. It also adds testing of default barriers
with infinite blocktime, and also tests hierarchical barrier algorithm with
both default and infinite blocktime.

Patch by Terry Wilmarth and Nawrin Sultana.

Differential Revision: https://reviews.llvm.org/D94241
openmp/runtime/src/kmp_barrier.cpp
openmp/runtime/test/barrier/omp_barrier.c