1
1

Per MPI-2:3.1, MPI_GET_VERSION can be called before MPI_INIT, so

remove the MPI_ERR_INIT_FINALIZE() macro.  Also check to see how we
invoke the errhandler if an error occurs (i.e., the action depends on
whether we're between MPI_INIT and MPI_FINALIZE or not).

This commit was SVN r5891.
Этот коммит содержится в:
Jeff Squyres 2005-05-31 16:30:34 +00:00
родитель 9c2554d8ce
Коммит 497580441d

Просмотреть файл

@ -34,10 +34,29 @@ static const char FUNC_NAME[] = "MPI_Get_version";
int MPI_Get_version(int *version, int *subversion)
{
MPI_Comm null = NULL;
if (MPI_PARAM_CHECK) {
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
/* Per MPI-2:3.1, this function can be invoked before
MPI_INIT, so we don't invoke the normal
MPI_ERR_INIT_FINALIZE() macro here */
if (NULL == version || NULL == subversion) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
/* Note that we have to check and see if we have
previously called MPI_INIT or not. If so, use the
normal OMPI_ERRHANDLER_INVOKE, because the user may
have changed the default errhandler on MPI_COMM_WORLD.
If we have not invoked MPI_INIT, then just abort
(i.e., use a NULL communicator, which will end up at the
default errhandler, which is abort). */
if (ompi_mpi_initialized && !ompi_mpi_finalized) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
} else {
return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_ARG,
FUNC_NAME);
}
}
}