ensure to check for init/finalize
This commit was SVN r1813.
Этот коммит содержится в:
родитель
6c8c9e9445
Коммит
4799f629e3
@ -18,6 +18,9 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Op_create";
|
||||
|
||||
|
||||
int MPI_Op_create(MPI_User_function *function, int commute,
|
||||
MPI_Op *op)
|
||||
{
|
||||
@ -26,20 +29,22 @@ int MPI_Op_create(MPI_User_function *function, int commute,
|
||||
/* Error checking */
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
||||
if (NULL == function ||
|
||||
NULL == op) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
"MPI_Comm_create_op");
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create and cache the op. Sets a refcount of 1. */
|
||||
|
||||
*op = ompi_op_create((bool) commute, (ompi_op_fortran_handler_fn_t*) function);
|
||||
*op = ompi_op_create((bool) commute,
|
||||
(ompi_op_fortran_handler_fn_t*) function);
|
||||
if (NULL == *op) {
|
||||
err = MPI_ERR_INTERN;
|
||||
}
|
||||
|
||||
OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN,
|
||||
"MPI_Comm_create_op");
|
||||
FUNC_NAME);
|
||||
}
|
||||
|
@ -18,15 +18,19 @@
|
||||
#include "mpi/c/profile/defines.h"
|
||||
#endif
|
||||
|
||||
static char FUNC_NAME[] = "MPI_Op_free";
|
||||
|
||||
|
||||
int MPI_Op_free(MPI_Op *op)
|
||||
{
|
||||
/* Error checking */
|
||||
|
||||
if (MPI_PARAM_CHECK) {
|
||||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
||||
if (NULL == op ||
|
||||
ompi_op_is_intrinsic(*op)) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||
"MPI_Op_free");
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OP,
|
||||
FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user