[Openmp-commits] [openmp] 0808d95 - [OpenMP] libomp: Fix handling of barrier pattern environment variables
via Openmp-commits
openmp-commits at lists.llvm.org
Mon Nov 8 04:02:13 PST 2021
Author: @t-msn
Date: 2021-11-08T15:01:26+03:00
New Revision: 0808d956c43e10646bc3f79ef5f9ccf12fc829f3
URL: https://github.com/llvm/llvm-project/commit/0808d956c43e10646bc3f79ef5f9ccf12fc829f3
DIFF: https://github.com/llvm/llvm-project/commit/0808d956c43e10646bc3f79ef5f9ccf12fc829f3.diff
LOG: [OpenMP] libomp: Fix handling of barrier pattern environment variables
It is better to set all barrier patterns to use "dist" when at least
one environment variable specifies "dist". Otherwise if only one
environment is set to "dist" and others left blank inadvertently,
it would result in mixing dist barrier with default hyper barrier
pattern.
Differential Revision: https://reviews.llvm.org/D112597
Added:
Modified:
openmp/runtime/src/kmp_settings.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp
index aa0641f7f70f..a8c08f83c96f 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -1753,17 +1753,9 @@ static void __kmp_stg_parse_barrier_pattern(char const *name, char const *value,
}
}
}
- if ((dist_req == 0) && (non_dist_req != 0)) {
- // Something was set to a barrier other than dist; set all others to hyper
- for (int i = bs_plain_barrier; i < bs_last_barrier; i++) {
- if (__kmp_barrier_release_pattern[i] == bp_dist_bar)
- __kmp_barrier_release_pattern[i] = bp_hyper_bar;
- if (__kmp_barrier_gather_pattern[i] == bp_dist_bar)
- __kmp_barrier_gather_pattern[i] = bp_hyper_bar;
- }
- } else if (non_dist_req != 0) {
- // some requests for dist, plus requests for others; set all to dist
- if (non_dist_req > 0 && dist_req > 0 && warn) {
+ if (dist_req != 0) {
+ // set all barriers to dist
+ if ((non_dist_req != 0) && warn) {
KMP_INFORM(BarrierPatternOverride, name,
__kmp_barrier_pattern_name[bp_dist_bar]);
warn = 0;
More information about the Openmp-commits
mailing list