diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-01-10 18:31:49 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-01-10 18:31:49 +0000 |
commit | 79390ad7096899c51863b823d8d76c85aa30af51 (patch) | |
tree | df016eb29157c36bc0baac906de513b15711c73d /openmp/runtime/src/kmp_settings.cpp | |
parent | 1800ecec70a069d75d70cf0438d2dff6f55d935a (diff) | |
download | bcm5719-llvm-79390ad7096899c51863b823d8d76c85aa30af51.tar.gz bcm5719-llvm-79390ad7096899c51863b823d8d76c85aa30af51.zip |
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
Diffstat (limited to 'openmp/runtime/src/kmp_settings.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_settings.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp index 1f2fae9a69d..0a05e7c6b75 100644 --- a/openmp/runtime/src/kmp_settings.cpp +++ b/openmp/runtime/src/kmp_settings.cpp @@ -5126,6 +5126,15 @@ void __kmp_env_initialize(char const *string) { #if KMP_AFFINITY_SUPPORTED if (!TCR_4(__kmp_init_middle)) { +#if KMP_USE_HWLOC + // Force using hwloc when either tiles or numa nodes requested within + // KMP_HW_SUBSET and no other topology method is requested + if ((__kmp_hws_node.num > 0 || __kmp_hws_tile.num > 0 || + __kmp_affinity_gran == affinity_gran_tile) && + (__kmp_affinity_top_method == affinity_top_method_default)) { + __kmp_affinity_top_method = affinity_top_method_hwloc; + } +#endif // Determine if the machine/OS is actually capable of supporting // affinity. const char *var = "KMP_AFFINITY"; |