diff options
Diffstat (limited to 'openmp/runtime/src/kmp_barrier.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_barrier.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp index 0c67b7f392d..89bf828aae6 100644 --- a/openmp/runtime/src/kmp_barrier.cpp +++ b/openmp/runtime/src/kmp_barrier.cpp @@ -706,6 +706,8 @@ __kmp_init_hierarchical_barrier_thread(enum barrier_type bt, kmp_bstate_t *thr_b thr_bar->offset = 7-(tid-thr_bar->parent_tid-1); thr_bar->old_tid = tid; thr_bar->wait_flag = KMP_BARRIER_NOT_WAITING; + thr_bar->team = team; + thr_bar->parent_bar = &team->t.t_threads[thr_bar->parent_tid]->th.th_bar[bt].bb; } if (uninitialized || team_changed || tid_changed) { thr_bar->team = team; @@ -1122,6 +1124,10 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, //KMP_DEBUG_ASSERT( is_split == TRUE ); // #C69956 this_thr->th.th_local.reduce_data = reduce_data; } + + if (KMP_MASTER_TID(tid) && __kmp_tasking_mode != tskm_immediate_exec) + __kmp_task_team_setup(this_thr, team, 0); // use 0 to only setup the current team if nthreads > 1 + switch (__kmp_barrier_gather_pattern[bt]) { case bp_hyper_bar: { KMP_ASSERT(__kmp_barrier_gather_branch_bits[bt]); // don't set branch bits to 0; use linear @@ -1153,7 +1159,6 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, if (__kmp_tasking_mode != tskm_immediate_exec) { __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj) ); - __kmp_task_team_setup(this_thr, team, 0); // use 0 to only setup the current team if nthreads > 1 } #if USE_DEBUGGER // Let the debugger know: All threads are arrived and starting leaving the barrier. |