Come to think of it, we need better error handling for MPI_INITIALIZED
and MPI_FINALIZED, depening on whether we have already called MPI_INIT and/or MPI_FINALIZED... This fixes that issue. This commit was SVN r2360.
Этот коммит содержится в:
родитель
7b7c23466c
Коммит
f90e1d2628
@ -22,14 +22,27 @@ static const char FUNC_NAME[] = "MPI_Finalized";
|
||||
|
||||
int MPI_Finalized(int *flag)
|
||||
{
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == flag) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
|
||||
MPI_Comm null = NULL;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == flag) {
|
||||
|
||||
/* If we have an error, the action that we take depends on
|
||||
whether we're currently (after MPI_Init and before
|
||||
MPI_Finalize) or not */
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Pretty simple */
|
||||
/* Pretty simple */
|
||||
|
||||
*flag = ompi_mpi_finalized;
|
||||
return MPI_SUCCESS;
|
||||
*flag = ompi_mpi_finalized;
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
@ -22,14 +22,27 @@ static const char FUNC_NAME[] = "MPI_Initialized";
|
||||
|
||||
int MPI_Initialized(int *flag)
|
||||
{
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == flag) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
|
||||
MPI_Comm null = NULL;
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
if (NULL == flag) {
|
||||
|
||||
/* If we have an error, the action that we take depends on
|
||||
whether we're currently (after MPI_Init and before
|
||||
MPI_Finalize) or not */
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Pretty simple */
|
||||
|
||||
/* Pretty simple */
|
||||
|
||||
*flag = ompi_mpi_initialized;
|
||||
return MPI_SUCCESS;
|
||||
*flag = ompi_mpi_initialized;
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user