Skip to content

Commit 8a7f0ba

Browse files
committed
Fix call to opal_hwloc_base_get_topology.
Make sure the HWLOC topology is available as early as possible, so that we can fail graciously. Signed-off-by: George Bosilca <[email protected]>
1 parent 6061454 commit 8a7f0ba

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

ompi/mca/topo/treematch/topo_treematch_component.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ mca_topo_treematch_component_2_2_0_t mca_topo_treematch_component =
6262

6363
static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
6464
{
65+
if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) {
66+
return OPAL_ERR_NOT_SUPPORTED;
67+
}
6568
if(NULL == opal_hwloc_topology) {
6669
return OPAL_ERR_NOT_SUPPORTED;
6770
}

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
238238
/* Then, we need to know if the processes are bound */
239239
/* We make the hypothesis that all processes are in */
240240
/* the same state : all bound or none bound */
241-
if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) {
242-
goto fallback;
243-
}
244241
root_obj = hwloc_get_root_obj(opal_hwloc_topology);
245242
if (NULL == root_obj) goto fallback;
246243

@@ -254,7 +251,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
254251
* all the calls that involve collective communications, so we have to lay the logic
255252
* accordingly.
256253
*/
257-
258254
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */
259255
#ifdef __DEBUG__
260256
if (0 == rank)
@@ -296,7 +292,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
296292
num_objs_in_node,num_procs_in_node,
297293
nodes_roots,lindex_to_grank,comm_old);
298294
}
299-
295+
300296
if (!oversubscribed_pus) {
301297
/* Update the data used to compute the correct binding */
302298
if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */

0 commit comments

Comments
 (0)