Skip to content

Commit 2a4cf41

Browse files
authored
Merge pull request #5615 from karasevb/v3.1.x_fix_hwloc_numa_obj
v3.1.x: Fixed the NUMA obj detection for hwloc ver >= 2.0.0
2 parents 60ce984 + 2eff88f commit 2a4cf41

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Copyright (c) 2013-2018 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2015-2017 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
19+
* Copyright (C) 2018 Mellanox Technologies, Ltd.
20+
* All rights reserved.
1921
* $COPYRIGHT$
2022
*
2123
* Additional copyrights may follow
@@ -2057,9 +2059,18 @@ static void sort_by_dist(hwloc_topology_t topo, char* device_name, opal_list_t *
20572059
if (!strcmp(device_obj->name, device_name)) {
20582060
/* find numa node containing this device */
20592061
obj = device_obj->parent;
2062+
#if HWLOC_API_VERSION < 0x20000
20602063
while ((obj != NULL) && (obj->type != HWLOC_OBJ_NODE)) {
20612064
obj = obj->parent;
20622065
}
2066+
#else
2067+
while (obj && !obj->memory_arity) {
2068+
obj = obj->parent; /* no memory child, walk up */
2069+
}
2070+
if (obj != NULL) {
2071+
obj = obj->memory_first_child;
2072+
}
2073+
#endif
20632074
if (obj == NULL) {
20642075
opal_output_verbose(5, opal_hwloc_base_framework.framework_output,
20652076
"hwloc:base:get_sorted_numa_list: NUMA node closest to %s wasn't found.",

orte/mca/rmaps/mindist/rmaps_mindist_module.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2014 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18-
* Copyright (c) 2017 Mellanox Technologies, Inc.
18+
* Copyright (c) 2017-2018 Mellanox Technologies, Inc.
1919
* All rights reserved.
2020
* $COPYRIGHT$
2121
*
@@ -331,6 +331,9 @@ static int mindist_map(orte_job_t *jdata)
331331
}
332332
}
333333
}
334+
/* first we need to fill summary object for root with information about nodes
335+
* so we call opal_hwloc_base_get_nbobjs_by_type */
336+
opal_hwloc_base_get_nbobjs_by_type(node->topology->topo, HWLOC_OBJ_NODE, 0, OPAL_HWLOC_AVAILABLE);
334337
OBJ_CONSTRUCT(&numa_list, opal_list_t);
335338
ret = opal_hwloc_get_sorted_numa_list(node->topology->topo, orte_rmaps_base.device, &numa_list);
336339
if (ret > 1) {

0 commit comments

Comments
 (0)