Skip to content

Commit 79390ad

Browse files
committedJan 10, 2018
Force HWLOC topology method for NUMA-specific topology
If user requested affinity with granularity=tile we need to either use HWLOC or ignore the request. The change allows user to not specify KMP_TOPOLOGY_METHOD=hwloc and choose it automatically instead. Patch by Andrey Churbanov Differential Revision: https://reviews.llvm.org/D40905 llvm-svn: 322205
1 parent 1800ece commit 79390ad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎openmp/runtime/src/kmp_settings.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5126,6 +5126,15 @@ void __kmp_env_initialize(char const *string) {
51265126
#if KMP_AFFINITY_SUPPORTED
51275127

51285128
if (!TCR_4(__kmp_init_middle)) {
5129+
#if KMP_USE_HWLOC
5130+
// Force using hwloc when either tiles or numa nodes requested within
5131+
// KMP_HW_SUBSET and no other topology method is requested
5132+
if ((__kmp_hws_node.num > 0 || __kmp_hws_tile.num > 0 ||
5133+
__kmp_affinity_gran == affinity_gran_tile) &&
5134+
(__kmp_affinity_top_method == affinity_top_method_default)) {
5135+
__kmp_affinity_top_method = affinity_top_method_hwloc;
5136+
}
5137+
#endif
51295138
// Determine if the machine/OS is actually capable of supporting
51305139
// affinity.
51315140
const char *var = "KMP_AFFINITY";

0 commit comments

Comments
 (0)