diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp --- a/openmp/runtime/src/kmp_runtime.cpp +++ b/openmp/runtime/src/kmp_runtime.cpp @@ -1002,6 +1002,9 @@ } } } + if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) { + __kmp_add_threads_to_team(team, team->t.t_nproc); + } #if KMP_AFFINITY_SUPPORTED // Do not partition the places list for teams construct workers who @@ -2529,6 +2532,10 @@ } } } + if (__kmp_barrier_release_pattern[bs_forkjoin_barrier] == bp_dist_bar) { + // Reset barrier status + __kmp_resize_dist_barrier(team, team->t.t_nproc, team->t.t_nproc); + } #if OMPT_SUPPORT if (ompt_enabled.enabled) {