aboutsummaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2015-01-13 14:47:02 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2015-01-13 14:47:02 +0000
commitcc78b2420990e8ee0a6695a6f87d27bf646bd9ef (patch)
tree98b50930f9afaef6e56b60d8bf5765ee2ae561cc /runtime/src
parent889547d5893d556277c448e3cb0ff87d9299bda8 (diff)
small fixes to the hierarchical barrier
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@225793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/kmp_barrier.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/src/kmp_barrier.cpp b/runtime/src/kmp_barrier.cpp
index cbd1edd..79cfd3a 100644
--- a/runtime/src/kmp_barrier.cpp
+++ b/runtime/src/kmp_barrier.cpp
@@ -834,6 +834,9 @@ __kmp_hierarchical_barrier_gather(enum barrier_type bt, kmp_info_t *this_thr,
KA_TRACE(20, ("__kmp_hierarchical_barrier_gather: T#%d(%d:%d) set team %d arrived(%p) = %u\n",
gtid, team->t.t_id, tid, team->t.t_id, &team->t.t_bar[bt].b_arrived, team->t.t_bar[bt].b_arrived));
}
+ // If nested, but outer level is top-level, resume use of oncore optimization
+ if (this_thr->th.th_team->t.t_level <=2) thr_bar->use_oncore_barrier = 1;
+ else thr_bar->use_oncore_barrier = 0;
// Is the team access below unsafe or just technically invalid?
KA_TRACE(20, ("__kmp_hierarchical_barrier_gather: T#%d(%d:%d) exit for barrier type %d\n",
gtid, team->t.t_id, tid, bt));
@@ -896,7 +899,7 @@ __kmp_hierarchical_barrier_release(enum barrier_type bt, kmp_info_t *this_thr, i
KMP_MB(); // Flush all pending memory write invalidates.
}
- if (this_thr->th.th_team->t.t_level == 1) thr_bar->use_oncore_barrier = 1;
+ if (this_thr->th.th_team->t.t_level <= 1) thr_bar->use_oncore_barrier = 1;
else thr_bar->use_oncore_barrier = 0;
nproc = this_thr->th.th_team_nproc;