File slurmd-Fix-slurmd-for-new-API-in-hwloc-2.0.patch of Package slurm
From: Egbert Eich <eich@suse.com>
Date: Sun Oct 16 09:07:46 2016 +0200
Subject: slurmd: Fix slurmd for new API in hwloc-2.0
Git-repo: https://github.com/SchedMD/slurm
Git-commit: 2e431ed7fdf7a57c7ce1b5f3d3a8bbedaf94a51d
References:
The API of hwloc has changed considerably for version 2.0.
For a summary check:
https://github.com/open-mpi/hwloc/wiki/Upgrading-to-v2.0-API
Test for the API version to support both the old and new API.
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/slurmd/common/xcpuinfo.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/slurmd/common/xcpuinfo.c b/src/slurmd/common/xcpuinfo.c
index 4eec6cb..22a47d5 100644
--- a/src/slurmd/common/xcpuinfo.c
+++ b/src/slurmd/common/xcpuinfo.c
@@ -212,8 +212,23 @@ get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
hwloc_topology_set_flags(topology, HWLOC_TOPOLOGY_FLAG_WHOLE_SYSTEM);
/* ignores cache, misc */
+#if HWLOC_API_VERSION < 0x00020000
hwloc_topology_ignore_type (topology, HWLOC_OBJ_CACHE);
hwloc_topology_ignore_type (topology, HWLOC_OBJ_MISC);
+#else
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_L1CACHE,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_L2CACHE,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_L3CACHE,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_L4CACHE,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_L5CACHE,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+ hwloc_topology_set_type_filter(topology,HWLOC_OBJ_MISC,
+ HWLOC_TYPE_FILTER_KEEP_NONE);
+#endif
/* load topology */
debug2("hwloc_topology_load");