[Openmp-commits] [openmp] r322205 - Force HWLOC topology method for NUMA-specific topology

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 10 10:31:49 PST 2018


Author: jlpeyton
Date: Wed Jan 10 10:31:49 2018
New Revision: 322205

URL: http://llvm.org/viewvc/llvm-project?rev=322205&view=rev
Log:
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

Modified:
    openmp/trunk/runtime/src/kmp_settings.cpp

Modified: openmp/trunk/runtime/src/kmp_settings.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.cpp?rev=322205&r1=322204&r2=322205&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.cpp (original)
+++ openmp/trunk/runtime/src/kmp_settings.cpp Wed Jan 10 10:31:49 2018
@@ -5126,6 +5126,15 @@ void __kmp_env_initialize(char const *st
 #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";




More information about the Openmp-commits mailing list