diff --git a/src/mpi/c/op_create.c b/src/mpi/c/op_create.c index b5f74ff24d..940cb0753c 100644 --- a/src/mpi/c/op_create.c +++ b/src/mpi/c/op_create.c @@ -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); } diff --git a/src/mpi/c/op_free.c b/src/mpi/c/op_free.c index 0f3c79658d..bb0e9146c9 100644 --- a/src/mpi/c/op_free.c +++ b/src/mpi/c/op_free.c @@ -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); } }