Skip to content

Commit aeee483

Browse files
committed
btl/sm: correctly handle nodes with zero NUMA hwloc object
the hwloc topology might not contain a NUMA object with hwloc < v2 if the node is not NUMA, so force the NUMA object count to one in order to correctly allocate mca_btl_sm_component.sm_mpools. Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 4932391 commit aeee483

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

opal/mca/btl/sm/btl_sm.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Copyright (c) 2010-2012 IBM Corporation. All rights reserved.
1818
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1919
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
20-
* Copyright (c) 2014-2015 Research Organization for Information Science
20+
* Copyright (c) 2014-2017 Research Organization for Information Science
2121
* and Technology (RIST). All rights reserved.
2222
* Copyright (c) 2016 ARM, Inc. All rights reserved.
2323
* $COPYRIGHT$
@@ -238,7 +238,8 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl,
238238
&wildcard_rank, &loc, OPAL_STRING);
239239
if (OPAL_SUCCESS == rc) {
240240
/* the number of NUMA nodes is right at the front */
241-
mca_btl_sm_component.num_mem_nodes = num_mem_nodes = strtoul(loc, NULL, 10);
241+
num_mem_nodes = strtoul(loc, NULL, 10);
242+
242243
free(loc);
243244
} else {
244245
/* If we have hwloc support, then get accurate information */
@@ -253,9 +254,15 @@ sm_btl_first_time_init(mca_btl_sm_t *sm_btl,
253254
the previous carto-based implementation), but it really
254255
should be improved to be how many NUMA nodes are being
255256
used *in this job*. */
256-
mca_btl_sm_component.num_mem_nodes = num_mem_nodes = i;
257+
num_mem_nodes = i;
257258
}
258259
}
260+
if (0 == num_mem_nodes) {
261+
/* the topology might not contain a NUMA object with hwloc < v2
262+
* if the node is not NUMA, so force it to one in this case */
263+
num_mem_nodes = 1;
264+
}
265+
mca_btl_sm_component.num_mem_nodes = num_mem_nodes;
259266
/* see if we were given our location */
260267
loc = NULL;
261268
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, OPAL_PMIX_LOCALITY_STRING,

0 commit comments

Comments
 (0)