Skip to content

Commit 5be17e5

Browse files
authored
Merge pull request #10912 from gkatev/smsc_fix_v5.0.x
v5.0.x: Initialize opal/smsc outside of btl/sm, to enable its use without it
2 parents 7f8b119 + fce9b47 commit 5be17e5

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
@@ -493,6 +493,10 @@ static int ompi_mpi_instance_init_common (void)
493493

494494
/* Select which MPI components to use */
495495

496+
if (OPAL_SUCCESS != (ret = mca_smsc_base_select())) {
497+
return ompi_instance_print_error ("mca_smsc_base_select() failed", ret);
498+
}
499+
496500
if (OMPI_SUCCESS != (ret = mca_pml_base_select (OPAL_ENABLE_PROGRESS_THREADS, ompi_mpi_thread_multiple))) {
497501
return ompi_instance_print_error ("mca_pml_base_select() failed", ret);
498502
}

opal/mca/btl/sm/btl_sm_component.c

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

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

335-
rc = mca_smsc_base_select();
336-
if (OPAL_SUCCESS == rc) {
334+
bool have_smsc = (NULL != mca_smsc);
335+
if (have_smsc) {
337336
mca_btl_sm.super.btl_flags |= MCA_BTL_FLAGS_RDMA;
338337
mca_btl_sm.super.btl_get = mca_btl_sm_get;
339338
mca_btl_sm.super.btl_put = mca_btl_sm_put;
@@ -355,11 +354,11 @@ mca_btl_sm_component_init(int *num_btls, bool enable_progress_threads, bool enab
355354
} else {
356355
BTL_ERROR(("single-copy component requires registration but could not provide the "
357356
"registration handle size"));
358-
rc = (int) handle_size;
357+
have_smsc = false;
359358
}
360359
}
361360
}
362-
if (OPAL_SUCCESS != rc) {
361+
if (!have_smsc) {
363362
mca_btl_sm.super.btl_flags &= ~MCA_BTL_FLAGS_RDMA;
364363
mca_btl_sm.super.btl_get = NULL;
365364
mca_btl_sm.super.btl_put = NULL;

0 commit comments

Comments
 (0)