Skip to content

Commit d8ab204

Browse files
committed
sessions:improve error messages
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 <[email protected]>
1 parent 1deda08 commit d8ab204

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

ompi/communicator/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
3939
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
4040
endif # WANT_FT_MPI
4141

42+
dist_ompidata_DATA += communicator/help-comm.txt

ompi/communicator/comm_cid.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "opal/mca/pmix/base/base.h"
4040
#include "opal/mca/pmix/pmix-internal.h"
4141
#include "opal/util/printf.h"
42+
#include "opal/util/show_help.h"
4243

4344
#include "ompi/proc/proc.h"
4445
#include "ompi/communicator/communicator.h"
@@ -48,6 +49,7 @@
4849
#include "opal/class/opal_list.h"
4950
#include "ompi/mca/pml/pml.h"
5051
#include "ompi/runtime/ompi_rte.h"
52+
#include "ompi/mca/pml/base/base.h"
5153
#include "ompi/mca/coll/base/base.h"
5254
#include "ompi/request/request.h"
5355
#include "ompi/runtime/mpiruntime.h"
@@ -428,8 +430,19 @@ int ompi_comm_nextcid_nb (ompi_communicator_t *newcomm, ompi_communicator_t *com
428430

429431
/* old CID algorighm */
430432

433+
/* if we got here and comm is NULL then that means the app is invoking MPI-4 Sessions or later
434+
functions but the pml does not support these functions so return not supported */
431435
if (NULL == comm) {
432-
return OMPI_ERR_BAD_PARAM;
436+
char msg_string[1024];
437+
sprintf(msg_string,"The PML being used - %s - does not support MPI sessions related features",
438+
mca_pml_base_selected_component.pmlm_version.mca_component_name);
439+
opal_show_help("help-comm.txt",
440+
"MPI function not supported",
441+
true,
442+
"MPI_Comm_from_group/MPI_Intercomm_from_groups",
443+
msg_string);
444+
445+
return MPI_ERR_UNSUPPORTED_OPERATION;
433446
}
434447

435448
newcomm->c_flags |= OMPI_COMM_GLOBAL_INDEX;

ompi/mpi/c/comm_create_from_group.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,10 @@ int MPI_Comm_create_from_group (MPI_Group group, const char *tag, MPI_Info info,
8383

8484
rc = ompi_comm_create_from_group ((ompi_group_t *) group, tag, &info->super, errhandler,
8585
(ompi_communicator_t **) newcomm);
86-
OMPI_ERRHANDLER_RETURN (rc, *newcomm, rc, FUNC_NAME);
86+
if (MPI_SUCCESS != rc) {
87+
return ompi_errhandler_invoke (errhandler, MPI_COMM_NULL, errhandler->eh_mpi_object_type,
88+
rc, FUNC_NAME);
89+
}
90+
91+
return rc;
8792
}

ompi/mpi/c/intercomm_create_from_groups.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ int MPI_Intercomm_create_from_groups (MPI_Group local_group, int local_leader, M
8585
rc = ompi_intercomm_create_from_groups (local_group, local_leader, remote_group, remote_leader, tag,
8686
&info->super, errhandler, newintercomm);
8787

88-
OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME);
88+
if (MPI_SUCCESS != rc) {
89+
return ompi_errhandler_invoke (errhandler, MPI_COMM_NULL, errhandler->eh_mpi_object_type,
90+
rc, FUNC_NAME);
91+
}
92+
93+
return rc;
8994
}
9095

0 commit comments

Comments
 (0)