Skip to content

Initialize opal/smsc outside of btl/sm, to enable its use without it #10897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ompi/instance/instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, OMPI would silently handle smsc not being initialized. Now it's printing a warning. That does not seem like the behavior we want?

Copy link
Contributor Author

@gkatev gkatev Oct 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment mca_smsc_base_select() only returns OPAL_SUCCESS. The actual smsc components might still remain silently uninitialized. My though process here is that if it at some point in the future mca_smsc_base_select() started possibly returning something else, it would be something severe enough to warrant triggering an error.

}

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);
}
Expand Down
9 changes: 4 additions & 5 deletions opal/mca/btl/sm/btl_sm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down