From 8a7f0baee00ea2e0b15868ae89a72c6c34ef6bb7 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 12 Jul 2017 18:12:00 -0400 Subject: [PATCH] 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 --- ompi/mca/topo/treematch/topo_treematch_component.c | 3 +++ ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ompi/mca/topo/treematch/topo_treematch_component.c b/ompi/mca/topo/treematch/topo_treematch_component.c index 80f631b830..9f1992cc55 100644 --- a/ompi/mca/topo/treematch/topo_treematch_component.c +++ b/ompi/mca/topo/treematch/topo_treematch_component.c @@ -62,6 +62,9 @@ mca_topo_treematch_component_2_2_0_t mca_topo_treematch_component = static int init_query(bool enable_progress_threads, bool enable_mpi_threads) { + if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) { + return OPAL_ERR_NOT_SUPPORTED; + } if(NULL == opal_hwloc_topology) { return OPAL_ERR_NOT_SUPPORTED; } diff --git a/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c b/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c index 9b37d92ca4..0f96d470ea 100644 --- a/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c +++ b/ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c @@ -238,9 +238,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module, /* Then, we need to know if the processes are bound */ /* We make the hypothesis that all processes are in */ /* the same state : all bound or none bound */ - if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) { - goto fallback; - } root_obj = hwloc_get_root_obj(opal_hwloc_topology); if (NULL == root_obj) goto fallback; @@ -254,7 +251,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module, * all the calls that involve collective communications, so we have to lay the logic * accordingly. */ - if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */ #ifdef __DEBUG__ if (0 == rank) @@ -296,7 +292,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module, num_objs_in_node,num_procs_in_node, nodes_roots,lindex_to_grank,comm_old); } - + if (!oversubscribed_pus) { /* Update the data used to compute the correct binding */ if(hwloc_bitmap_isincluded(root_obj->cpuset,set)){ /* processes are not bound on the machine */