Skip to content

Commit 6c90ecc

Browse files
authored
Merge pull request #10897 from gkatev/smsc_fix
Initialize opal/smsc outside of btl/sm, to enable its use without it
2 parents 5d38444 + 9e13c2a commit 6c90ecc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ompi/instance/instance.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ static int ompi_mpi_instance_init_common (int argc, char **argv)
498498

499499
/* Select which MPI components to use */
500500

501+
if (OPAL_SUCCESS != (ret = mca_smsc_base_select())) {
502+
return ompi_instance_print_error ("mca_smsc_base_select() failed", ret);
503+
}
504+
501505
if (OMPI_SUCCESS != (ret = mca_pml_base_select (OPAL_ENABLE_PROGRESS_THREADS, ompi_mpi_thread_multiple))) {
502506
return ompi_instance_print_error ("mca_pml_base_select() failed", ret);
503507
}

opal/mca/btl/sm/btl_sm_component.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "opal/mca/btl/sm/btl_sm_fbox.h"
4242
#include "opal/mca/btl/sm/btl_sm_fifo.h"
4343
#include "opal/mca/btl/sm/btl_sm_frag.h"
44-
#include "opal/mca/smsc/base/base.h"
4544
#include "opal/mca/smsc/smsc.h"
4645

4746
#ifdef HAVE_SYS_STAT_H
@@ -333,8 +332,8 @@ mca_btl_sm_component_init(int *num_btls, bool enable_progress_threads, bool enab
333332
/* no fast boxes allocated initially */
334333
component->num_fbox_in_endpoints = 0;
335334

336-
rc = mca_smsc_base_select();
337-
if (OPAL_SUCCESS == rc) {
335+
bool have_smsc = (NULL != mca_smsc);
336+
if (have_smsc) {
338337
mca_btl_sm.super.btl_flags |= MCA_BTL_FLAGS_RDMA;
339338
mca_btl_sm.super.btl_get = mca_btl_sm_get;
340339
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
356355
} else {
357356
BTL_ERROR(("single-copy component requires registration but could not provide the "
358357
"registration handle size"));
359-
rc = (int) handle_size;
358+
have_smsc = false;
360359
}
361360
}
362361
}
363-
if (OPAL_SUCCESS != rc) {
362+
if (!have_smsc) {
364363
mca_btl_sm.super.btl_flags &= ~MCA_BTL_FLAGS_RDMA;
365364
mca_btl_sm.super.btl_get = NULL;
366365
mca_btl_sm.super.btl_put = NULL;

0 commit comments

Comments
 (0)