diff --git a/ompi/mpi/c/comm_spawn.c b/ompi/mpi/c/comm_spawn.c index 8e418de8c9..7d00d058bd 100644 --- a/ompi/mpi/c/comm_spawn.c +++ b/ompi/mpi/c/comm_spawn.c @@ -111,8 +111,8 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, } } else if (1 < ompi_comm_size(comm)) { /* we do not support non_mpi spawns on comms this size */ - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_UNSUPPORTED_OPERATION, - FUNC_NAME); + rc = OMPI_ERR_NOT_SUPPORTED + goto error; } if (OMPI_SUCCESS != (rc = ompi_dpm.spawn (1, &command, &argv, &maxprocs, &info, port_name))) { diff --git a/ompi/mpi/c/comm_spawn_multiple.c b/ompi/mpi/c/comm_spawn_multiple.c index 1a1a6b0743..177a90f19f 100644 --- a/ompi/mpi/c/comm_spawn_multiple.c +++ b/ompi/mpi/c/comm_spawn_multiple.c @@ -151,8 +151,8 @@ int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_o } } else if (1 < ompi_comm_size(comm)) { /* we do not support non_mpi spawns on comms this size */ - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_UNSUPPORTED_OPERATION, - FUNC_NAME); + rc = OMPI_ERR_NOT_SUPPORTED + goto error; } if (OMPI_SUCCESS != (rc = ompi_dpm.spawn(count, array_of_commands, array_of_argv, array_of_maxprocs,