From 879180119a5839d1fcf294c0e71b154f1f1ba966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Plewa?= Date: Fri, 9 May 2025 14:43:06 +0000 Subject: [PATCH] retrieve numanode object by os index instead of logical index. physical_id field stores os index, so we should use correct function to get hwloc numanode object. fixes: #1289 --- src/memtargets/memtarget_numa.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/memtargets/memtarget_numa.c b/src/memtargets/memtarget_numa.c index 88d8ac2a4..082e5eaa6 100644 --- a/src/memtargets/memtarget_numa.c +++ b/src/memtargets/memtarget_numa.c @@ -263,17 +263,15 @@ static umf_result_t query_attribute_value(void *srcMemoryTarget, return UMF_RESULT_ERROR_NOT_SUPPORTED; } - hwloc_obj_t srcNumaNode = hwloc_get_obj_by_type( - topology, HWLOC_OBJ_NUMANODE, - ((struct numa_memtarget_t *)srcMemoryTarget)->physical_id); + hwloc_obj_t srcNumaNode = hwloc_get_numanode_obj_by_os_index( + topology, ((struct numa_memtarget_t *)srcMemoryTarget)->physical_id); if (!srcNumaNode) { LOG_PERR("Getting HWLOC object by type failed"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; } - hwloc_obj_t dstNumaNode = hwloc_get_obj_by_type( - topology, HWLOC_OBJ_NUMANODE, - ((struct numa_memtarget_t *)dstMemoryTarget)->physical_id); + hwloc_obj_t dstNumaNode = hwloc_get_numanode_obj_by_os_index( + topology, ((struct numa_memtarget_t *)dstMemoryTarget)->physical_id); if (!dstNumaNode) { LOG_PERR("Getting HWLOC object by type failed"); return UMF_RESULT_ERROR_INVALID_ARGUMENT;