diff --git a/ompi/instance/instance.c b/ompi/instance/instance.c index a3269a82a11..7bd8d3f114f 100644 --- a/ompi/instance/instance.c +++ b/ompi/instance/instance.c @@ -498,6 +498,10 @@ static int ompi_mpi_instance_init_common (int argc, char **argv) /* Select which MPI components to use */ + if (OPAL_SUCCESS != (ret = mca_smsc_base_select())) { + return ompi_instance_print_error ("mca_smsc_base_select() failed", ret); + } + if (OMPI_SUCCESS != (ret = mca_pml_base_select (OPAL_ENABLE_PROGRESS_THREADS, ompi_mpi_thread_multiple))) { return ompi_instance_print_error ("mca_pml_base_select() failed", ret); } diff --git a/opal/mca/btl/sm/btl_sm_component.c b/opal/mca/btl/sm/btl_sm_component.c index 5141276278f..9d73e1e39f1 100644 --- a/opal/mca/btl/sm/btl_sm_component.c +++ b/opal/mca/btl/sm/btl_sm_component.c @@ -41,7 +41,6 @@ #include "opal/mca/btl/sm/btl_sm_fbox.h" #include "opal/mca/btl/sm/btl_sm_fifo.h" #include "opal/mca/btl/sm/btl_sm_frag.h" -#include "opal/mca/smsc/base/base.h" #include "opal/mca/smsc/smsc.h" #ifdef HAVE_SYS_STAT_H @@ -333,8 +332,8 @@ mca_btl_sm_component_init(int *num_btls, bool enable_progress_threads, bool enab /* no fast boxes allocated initially */ component->num_fbox_in_endpoints = 0; - rc = mca_smsc_base_select(); - if (OPAL_SUCCESS == rc) { + bool have_smsc = (NULL != mca_smsc); + if (have_smsc) { mca_btl_sm.super.btl_flags |= MCA_BTL_FLAGS_RDMA; mca_btl_sm.super.btl_get = mca_btl_sm_get; mca_btl_sm.super.btl_put = mca_btl_sm_put; @@ -356,11 +355,11 @@ mca_btl_sm_component_init(int *num_btls, bool enable_progress_threads, bool enab } else { BTL_ERROR(("single-copy component requires registration but could not provide the " "registration handle size")); - rc = (int) handle_size; + have_smsc = false; } } } - if (OPAL_SUCCESS != rc) { + if (!have_smsc) { mca_btl_sm.super.btl_flags &= ~MCA_BTL_FLAGS_RDMA; mca_btl_sm.super.btl_get = NULL; mca_btl_sm.super.btl_put = NULL;