21
21
#include "topology.h"
22
22
23
23
struct numa_memory_target_t {
24
- size_t id ;
24
+ size_t physical_id ;
25
25
};
26
26
27
27
static umf_result_t numa_initialize (void * params , void * * memTarget ) {
@@ -38,7 +38,7 @@ static umf_result_t numa_initialize(void *params, void **memTarget) {
38
38
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY ;
39
39
}
40
40
41
- numaTarget -> id = config -> id ;
41
+ numaTarget -> physical_id = config -> physical_id ;
42
42
* memTarget = numaTarget ;
43
43
return UMF_RESULT_SUCCESS ;
44
44
}
@@ -60,7 +60,7 @@ numa_targets_create_nodemask(struct numa_memory_target_t **targets,
60
60
}
61
61
62
62
for (size_t i = 0 ; i < numTargets ; i ++ ) {
63
- if (hwloc_bitmap_set (bitmap , targets [i ]-> id )) {
63
+ if (hwloc_bitmap_set (bitmap , targets [i ]-> physical_id )) {
64
64
hwloc_bitmap_free (bitmap );
65
65
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY ;
66
66
}
@@ -170,7 +170,7 @@ static umf_result_t numa_clone(void *memTarget, void **outMemTarget) {
170
170
return UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY ;
171
171
}
172
172
173
- newNumaTarget -> id = numaTarget -> id ;
173
+ newNumaTarget -> physical_id = numaTarget -> physical_id ;
174
174
* outMemTarget = newNumaTarget ;
175
175
return UMF_RESULT_SUCCESS ;
176
176
}
@@ -181,9 +181,8 @@ static umf_result_t numa_get_capacity(void *memTarget, size_t *capacity) {
181
181
return UMF_RESULT_ERROR_NOT_SUPPORTED ;
182
182
}
183
183
184
- hwloc_obj_t numaNode =
185
- hwloc_get_obj_by_type (topology , HWLOC_OBJ_NUMANODE ,
186
- ((struct numa_memory_target_t * )memTarget )-> id );
184
+ hwloc_obj_t numaNode = hwloc_get_numanode_obj_by_os_index (
185
+ topology , ((struct numa_memory_target_t * )memTarget )-> physical_id );
187
186
if (!numaNode ) {
188
187
return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
189
188
}
0 commit comments