Skip to content

Commit

Permalink
sessions:improve error messages
Browse files Browse the repository at this point in the history
Improve error message when an application is using
a PML that doesn't support excid, and hence sessions
related functions
- MPI_Comm_from_group
- MPI_Intercomm_create_from_groups

Example:

--------------------------------------------------------------------------
Your application has invoked an MPI function that is not supported in
this environment.

  MPI function: MPI_Comm_from_group/MPI_Intercomm_from_groups
  Reason:       The PML being used - ucx - does not support MPI sessions related features
--------------------------------------------------------------------------

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
  • Loading branch information
hppritcha committed Jul 6, 2021
1 parent 173116f commit 0fa3f87
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions ompi/communicator/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
communicator/ft/comm_ft.c communicator/ft/comm_ft_reliable_bcast.c communicator/ft/comm_ft_propagator.c communicator/ft/comm_ft_detector.c communicator/ft/comm_ft_revoke.c
endif # WANT_FT_MPI

dist_ompidata_DATA += communicator/help-comm.txt
15 changes: 14 additions & 1 deletion ompi/communicator/comm_cid.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "opal/mca/pmix/base/base.h"
#include "opal/mca/pmix/pmix-internal.h"
#include "opal/util/printf.h"
#include "opal/util/show_help.h"

#include "ompi/proc/proc.h"
#include "ompi/communicator/communicator.h"
Expand All @@ -48,6 +49,7 @@
#include "opal/class/opal_list.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/runtime/ompi_rte.h"
#include "ompi/mca/pml/base/base.h"
#include "ompi/mca/coll/base/base.h"
#include "ompi/request/request.h"
#include "ompi/runtime/mpiruntime.h"
Expand Down Expand Up @@ -428,8 +430,19 @@ int ompi_comm_nextcid_nb (ompi_communicator_t *newcomm, ompi_communicator_t *com

/* old CID algorighm */

/* if we got here and comm is NULL then that means the app is invoking MPI-4 Sessions or later
functions but the pml does not support these functions so return not supported */
if (NULL == comm) {
return OMPI_ERR_BAD_PARAM;
char msg_string[1024];
sprintf(msg_string,"The PML being used - %s - does not support MPI sessions related features",
mca_pml_base_selected_component.pmlm_version.mca_component_name);
opal_show_help("help-comm.txt",
"MPI function not supported",
true,
"MPI_Comm_from_group/MPI_Intercomm_from_groups",
msg_string);

return MPI_ERR_UNSUPPORTED_OPERATION;
}

newcomm->c_flags |= OMPI_COMM_GLOBAL_INDEX;
Expand Down
7 changes: 6 additions & 1 deletion ompi/mpi/c/comm_create_from_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@ int MPI_Comm_create_from_group (MPI_Group group, const char *tag, MPI_Info info,

rc = ompi_comm_create_from_group ((ompi_group_t *) group, tag, &info->super, errhandler,
(ompi_communicator_t **) newcomm);
OMPI_ERRHANDLER_RETURN (rc, *newcomm, rc, FUNC_NAME);
if (MPI_SUCCESS != rc) {
return ompi_errhandler_invoke (errhandler, MPI_COMM_NULL, errhandler->eh_mpi_object_type,
rc, FUNC_NAME);
}

return rc;
}
7 changes: 6 additions & 1 deletion ompi/mpi/c/intercomm_create_from_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ int MPI_Intercomm_create_from_groups (MPI_Group local_group, int local_leader, M
rc = ompi_intercomm_create_from_groups (local_group, local_leader, remote_group, remote_leader, tag,
&info->super, errhandler, newintercomm);

OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME);
if (MPI_SUCCESS != rc) {
return ompi_errhandler_invoke (errhandler, MPI_COMM_NULL, errhandler->eh_mpi_object_type,
rc, FUNC_NAME);
}

return rc;
}

0 comments on commit 0fa3f87

Please sign in to comment.