[Openmp-commits] [PATCH] D95263: [OpenMP] Add environment variable to force monotonic dynamic scheduling
Terry Wilmarth via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jan 29 10:26:56 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG67773681c0ef: [OpenMP] Add environment variable to force monotonic dynamic scheduling (authored by jlpeyton, committed by tlwilmar).
Changed prior to commit:
https://reviews.llvm.org/D95263?vs=319903&id=320168#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95263/new/
https://reviews.llvm.org/D95263
Files:
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_dispatch.cpp
openmp/runtime/src/kmp_global.cpp
openmp/runtime/src/kmp_settings.cpp
Index: openmp/runtime/src/kmp_settings.cpp
===================================================================
--- openmp/runtime/src/kmp_settings.cpp
+++ openmp/runtime/src/kmp_settings.cpp
@@ -4136,6 +4136,18 @@
} // __kmp_stg_print_kmp_hand_thread
#endif
+// -----------------------------------------------------------------------------
+// KMP_FORCE_MONOTONIC_DYNAMIC_SCHEDULE
+static void __kmp_stg_parse_kmp_force_monotonic(char const *name,
+ char const *value, void *data) {
+ __kmp_stg_parse_bool(name, value, &(__kmp_force_monotonic));
+} // __kmp_stg_parse_kmp_force_monotonic
+
+static void __kmp_stg_print_kmp_force_monotonic(kmp_str_buf_t *buffer,
+ char const *name, void *data) {
+ __kmp_stg_print_bool(buffer, name, __kmp_force_monotonic);
+} // __kmp_stg_print_kmp_force_monotonic
+
// -----------------------------------------------------------------------------
// KMP_ATOMIC_MODE
@@ -5224,6 +5236,9 @@
{"KMP_DISP_HAND_THREAD", __kmp_stg_parse_kmp_hand_thread,
__kmp_stg_print_kmp_hand_thread, NULL, 0, 0},
#endif
+ {"KMP_FORCE_MONOTONIC_DYNAMIC_SCHEDULE",
+ __kmp_stg_parse_kmp_force_monotonic, __kmp_stg_print_kmp_force_monotonic,
+ NULL, 0, 0},
{"KMP_ATOMIC_MODE", __kmp_stg_parse_atomic_mode,
__kmp_stg_print_atomic_mode, NULL, 0, 0},
{"KMP_CONSISTENCY_CHECK", __kmp_stg_parse_consistency_check,
Index: openmp/runtime/src/kmp_global.cpp
===================================================================
--- openmp/runtime/src/kmp_global.cpp
+++ openmp/runtime/src/kmp_global.cpp
@@ -166,6 +166,7 @@
int __kmp_ncores = 0;
#endif
int __kmp_chunk = 0;
+int __kmp_force_monotonic = 0;
int __kmp_abort_delay = 0;
#if KMP_OS_LINUX && defined(KMP_TDATA_GTID)
int __kmp_gtid_mode = 3; /* use __declspec(thread) TLS to store gtid */
Index: openmp/runtime/src/kmp_dispatch.cpp
===================================================================
--- openmp/runtime/src/kmp_dispatch.cpp
+++ openmp/runtime/src/kmp_dispatch.cpp
@@ -80,7 +80,7 @@
if (loc->get_openmp_version() < 50)
monotonicity = SCHEDULE_MONOTONIC;
- if (use_hier)
+ if (use_hier || __kmp_force_monotonic)
monotonicity = SCHEDULE_MONOTONIC;
else if (SCHEDULE_HAS_NONMONOTONIC(schedule))
monotonicity = SCHEDULE_NONMONOTONIC;
Index: openmp/runtime/src/kmp.h
===================================================================
--- openmp/runtime/src/kmp.h
+++ openmp/runtime/src/kmp.h
@@ -3004,6 +3004,7 @@
extern enum sched_type __kmp_guided; /* default guided scheduling method */
extern enum sched_type __kmp_auto; /* default auto scheduling method */
extern int __kmp_chunk; /* default runtime chunk size */
+extern int __kmp_force_monotonic; /* whether monotonic scheduling forced */
extern size_t __kmp_stksize; /* stack size per thread */
#if KMP_USE_MONITOR
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95263.320168.patch
Type: text/x-patch
Size: 2934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210129/95ef44dd/attachment.bin>
More information about the Openmp-commits
mailing list