From: Egbert Eich Date: Sun Oct 16 13:10:39 2016 +0200 Subject: plugins/cgroup: Fix slurmd for new API in hwloc-2.0 Git-repo: https://github.com/SchedMD/slurm Git-commit: 018eee7d8dee1f769477263a891948e5bca8f738 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 Signed-off-by: Egbert Eich --- src/plugins/task/cgroup/task_cgroup_cpuset.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/task/cgroup/task_cgroup_cpuset.c b/src/plugins/task/cgroup/task_cgroup_cpuset.c index 9c41ea4..94a4b09 100644 --- a/src/plugins/task/cgroup/task_cgroup_cpuset.c +++ b/src/plugins/task/cgroup/task_cgroup_cpuset.c @@ -641,8 +641,23 @@ static int _get_cpuinfo(uint32_t *nsockets, uint32_t *ncores, /* parse full system info */ 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 */ if (hwloc_topology_load(topology)) { error("%s: hwloc_topology_load() failed", __func__);