diff --git a/src/mpi/c/abort.c b/src/mpi/c/abort.c index c48882c18b..64e1a1546f 100644 --- a/src/mpi/c/abort.c +++ b/src/mpi/c/abort.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Abort = PMPI_Abort @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Abort(MPI_Comm comm, int errorcode) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Abort"; + + +int MPI_Abort(MPI_Comm comm, int errorcode) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/accumulate.c b/src/mpi/c/accumulate.c index 3135707070..6fb3fea4bc 100644 --- a/src/mpi/c/accumulate.c +++ b/src/mpi/c/accumulate.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Accumulate = PMPI_Accumulate @@ -15,9 +17,18 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, - int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Op op, MPI_Win win) { +static const char FUNC_NAME[] = "MPI_Accumlate"; - return MPI_SUCCESS; + +int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, + int target_rank, MPI_Aint target_disp, int target_count, + MPI_Datatype target_datatype, MPI_Op op, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/add_error_class.c b/src/mpi/c/add_error_class.c index 3315e68fb0..42cdb2fef4 100644 --- a/src/mpi/c/add_error_class.c +++ b/src/mpi/c/add_error_class.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Add_error_class"; +static const char FUNC_NAME[] = "MPI_Add_error_class"; int MPI_Add_error_class(int *errorclass) diff --git a/src/mpi/c/add_error_code.c b/src/mpi/c/add_error_code.c index bddf4938cc..09c1b6d2ad 100644 --- a/src/mpi/c/add_error_code.c +++ b/src/mpi/c/add_error_code.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Add_error_code"; +static const char FUNC_NAME[] = "MPI_Add_error_code"; int MPI_Add_error_code(int errorclass, int *errorcode) diff --git a/src/mpi/c/add_error_string.c b/src/mpi/c/add_error_string.c index e66481eefd..7d2752b838 100644 --- a/src/mpi/c/add_error_string.c +++ b/src/mpi/c/add_error_string.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Add_error_code"; +static const char FUNC_NAME[] = "MPI_Add_error_code"; int MPI_Add_error_string(int errorcode, char *string) diff --git a/src/mpi/c/address.c b/src/mpi/c/address.c index 64d7bb31ee..4603b33219 100644 --- a/src/mpi/c/address.c +++ b/src/mpi/c/address.c @@ -21,14 +21,16 @@ static const char FUNC_NAME[] = "MPI_Address"; + int MPI_Address(void *location, MPI_Aint *address) { if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, (ompi_communicator_t*)NULL, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == location || NULL == address) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } + *address = (MPI_Aint)location; - return MPI_SUCCESS; + return MPI_SUCCESS; } diff --git a/src/mpi/c/allgatherv.c b/src/mpi/c/allgatherv.c index b87c8c8957..46277d1b10 100644 --- a/src/mpi/c/allgatherv.c +++ b/src/mpi/c/allgatherv.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Allgatherv"; +static const char FUNC_NAME[] = "MPI_Allgatherv"; int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, diff --git a/src/mpi/c/alloc_mem.c b/src/mpi/c/alloc_mem.c index 06bffe581c..1eba5c13e9 100644 --- a/src/mpi/c/alloc_mem.c +++ b/src/mpi/c/alloc_mem.c @@ -8,6 +8,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Alloc_mem = PMPI_Alloc_mem @@ -17,13 +19,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Alloc_mem"; + + int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) { - if (size < 0) { - /* Return error on MPI_COMM_WORLD */ - } - if (NULL == baseptr) { - /* Return error on MPI_COMM_WORLD */ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (size < 0 || NULL == baseptr) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); + } } /* Check the MPI_Info and see if we requested a specific MCA @@ -33,5 +39,7 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) If either fails, return an error on MPI_COMM_WORLD. */ - return MPI_SUCCESS; + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/allreduce.c b/src/mpi/c/allreduce.c index a5843d13b6..106ca66c2f 100644 --- a/src/mpi/c/allreduce.c +++ b/src/mpi/c/allreduce.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Allreduce"; +static const char FUNC_NAME[] = "MPI_Allreduce"; int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, diff --git a/src/mpi/c/alltoallv.c b/src/mpi/c/alltoallv.c index ff28efac04..bcdefa5abc 100644 --- a/src/mpi/c/alltoallv.c +++ b/src/mpi/c/alltoallv.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Alltoallv"; +static const char FUNC_NAME[] = "MPI_Alltoallv"; int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, diff --git a/src/mpi/c/alltoallw.c b/src/mpi/c/alltoallw.c index c23b042060..c08fc4c5a6 100644 --- a/src/mpi/c/alltoallw.c +++ b/src/mpi/c/alltoallw.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Alltoallw"; +static const char FUNC_NAME[] = "MPI_Alltoallw"; int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls, diff --git a/src/mpi/c/attr_delete.c b/src/mpi/c/attr_delete.c index c16a5db5df..370c295ea9 100644 --- a/src/mpi/c/attr_delete.c +++ b/src/mpi/c/attr_delete.c @@ -19,11 +19,13 @@ static const char FUNC_NAME[] = "MPI_Attr_delete"; + int MPI_Attr_delete(MPI_Comm comm, int keyval) { int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); diff --git a/src/mpi/c/attr_get.c b/src/mpi/c/attr_get.c index d44f8ccfed..db23e69693 100644 --- a/src/mpi/c/attr_get.c +++ b/src/mpi/c/attr_get.c @@ -24,6 +24,7 @@ int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag) int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == attribute_val) || (NULL == flag)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); diff --git a/src/mpi/c/attr_put.c b/src/mpi/c/attr_put.c index b429bcdf8e..b531faef06 100644 --- a/src/mpi/c/attr_put.c +++ b/src/mpi/c/attr_put.c @@ -24,6 +24,7 @@ int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val) int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); diff --git a/src/mpi/c/bindings.h b/src/mpi/c/bindings.h index 16b3fe0534..483579a8e6 100644 --- a/src/mpi/c/bindings.h +++ b/src/mpi/c/bindings.h @@ -26,14 +26,14 @@ extern bool ompi_mpi_param_check; */ #define OMPI_CHECK_DATATYPE_FOR_SEND( RC, DDT, COUNT ) \ do { \ - if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ } while (0) #define OMPI_CHECK_DATATYPE_FOR_RECV( RC, DDT, COUNT ) \ do { \ - if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ @@ -41,7 +41,7 @@ do { \ #define OMPI_CHECK_DATATYPE_FOR_ONE_SIDED( RC, DDT, COUNT ) \ do { \ - if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \ + if( NULL == (DDT) || MPI_DATATYPE_NULL == (DDT) ) (RC) = MPI_ERR_TYPE; \ else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \ else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \ diff --git a/src/mpi/c/buffer_attach.c b/src/mpi/c/buffer_attach.c index 4bd50f5f9d..d50d0e94bc 100644 --- a/src/mpi/c/buffer_attach.c +++ b/src/mpi/c/buffer_attach.c @@ -7,6 +7,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" #include "runtime/runtime.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #include "mca/pml/pml.h" #include "mca/pml/base/pml_base_bsend.h" @@ -19,9 +21,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Buffer_attach"; + int MPI_Buffer_attach(void *buffer, int size) { - return mca_pml_base_bsend_attach(buffer, size); + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == buffer || size < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + return mca_pml_base_bsend_attach(buffer, size); } diff --git a/src/mpi/c/buffer_detach.c b/src/mpi/c/buffer_detach.c index 9577cbecbd..8556b35d84 100644 --- a/src/mpi/c/buffer_detach.c +++ b/src/mpi/c/buffer_detach.c @@ -18,7 +18,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Buffer_detach"; + + int MPI_Buffer_detach(void *buffer, int *size) { - return mca_pml_base_bsend_detach(buffer, size); + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == buffer || NULL == size || *size < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + return mca_pml_base_bsend_detach(buffer, size); } diff --git a/src/mpi/c/cancel.c b/src/mpi/c/cancel.c index 9cf092b060..363950f524 100644 --- a/src/mpi/c/cancel.c +++ b/src/mpi/c/cancel.c @@ -8,6 +8,8 @@ #include "runtime/runtime.h" #include "mpi/c/bindings.h" #include "mca/pml/pml.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Cancel = PMPI_Cancel @@ -17,14 +19,16 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cancel"; + + int MPI_Cancel(MPI_Request *request) { int rc; if ( MPI_PARAM_CHECK ) { rc = MPI_SUCCESS; - if ( OMPI_MPI_INVALID_STATE ) { - rc = MPI_ERR_INTERN; - } else if (request == NULL) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (request == NULL) { rc = MPI_ERR_REQUEST; } /* JMS: Tim will fix to invoke on the communicator/window/file diff --git a/src/mpi/c/cart_coords.c b/src/mpi/c/cart_coords.c index 6f3f7540ce..3a348a82f4 100644 --- a/src/mpi/c/cart_coords.c +++ b/src/mpi/c/cart_coords.c @@ -19,31 +19,35 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_coords"; + + int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords) { int err; mca_topo_base_cart_coords_fn_t func; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_coords"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_coords"); + FUNC_NAME); } if (!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_coords"); + FUNC_NAME); } if ( (0 > maxdims) || ((0 < maxdims) && (NULL == coords))) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_coords"); + FUNC_NAME); } if ((0 > rank) || (rank > ompi_group_size(comm->c_local_group))) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK, - "MPI_Cart_coords"); + FUNC_NAME); } } @@ -51,12 +55,12 @@ int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords) { func = comm->c_topo->topo_cart_coords; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_coords"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, rank, maxdims, coords))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_coords"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* all done */ diff --git a/src/mpi/c/cart_create.c b/src/mpi/c/cart_create.c index 1a84599287..31d728fb29 100644 --- a/src/mpi/c/cart_create.c +++ b/src/mpi/c/cart_create.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_create"; + + int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart) { @@ -26,25 +29,26 @@ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == old_comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_create"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(old_comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_create"); + FUNC_NAME); } if (1 > ndims) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_create"); + FUNC_NAME); } if (NULL == dims || NULL == periods || NULL == comm_cart) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_create"); + FUNC_NAME); } if (0 > reorder || 1 < reorder) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_create"); + FUNC_NAME); } /* check if the number of processes on the grid are corrct */ @@ -61,7 +65,7 @@ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, if (parent_procs < count_nodes) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_create"); + FUNC_NAME); } } } @@ -83,7 +87,7 @@ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, /* check the error status */ if (MPI_SUCCESS != err) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_create"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/cart_get.c b/src/mpi/c/cart_get.c index 957b0700a9..03c5a9cf23 100644 --- a/src/mpi/c/cart_get.c +++ b/src/mpi/c/cart_get.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_get"; + + int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) { /* local variables */ @@ -26,31 +29,33 @@ int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm || OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_get"); + FUNC_NAME); } if (!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_get"); + FUNC_NAME); } if ((0 > maxdims) || (0 < maxdims && - ((NULL == dims) || (NULL == periods) || (NULL == coords)))) { + ((NULL == dims) || (NULL == periods) || + (NULL == coords)))) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_get"); + FUNC_NAME); } } /* get the function pointer to do the right thing */ func = comm->c_topo->topo_cart_get; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_get"); + FUNC_NAME); } /* all arguments are checked and now call the back end function */ if ( MPI_SUCCESS != (err = func(comm, maxdims, dims, periods, coords))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_get"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/cart_map.c b/src/mpi/c/cart_map.c index 99f133f7b1..5a44758e33 100644 --- a/src/mpi/c/cart_map.c +++ b/src/mpi/c/cart_map.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_map"; + + int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, int *periods, int *newrank) { int err; @@ -25,21 +28,22 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_map"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_map"); + FUNC_NAME); } if(!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_map"); + FUNC_NAME); } if ((NULL == dims) || (NULL == periods) || (NULL == newrank)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_map"); + FUNC_NAME); } } @@ -47,12 +51,12 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims, func = comm->c_topo->topo_cart_map; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_map"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, ndims, dims, periods, newrank))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_map"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } return MPI_SUCCESS; diff --git a/src/mpi/c/cart_rank.c b/src/mpi/c/cart_rank.c index b5122dc36d..1950a9c4fa 100644 --- a/src/mpi/c/cart_rank.c +++ b/src/mpi/c/cart_rank.c @@ -18,6 +18,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_rank"; + int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) { int err; @@ -25,21 +27,22 @@ int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) { /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_rank"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_rank"); + FUNC_NAME); } if (!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_rank"); + FUNC_NAME); } if ((NULL == coords) || (NULL == rank)){ return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_rank"); + FUNC_NAME); } } @@ -47,12 +50,12 @@ int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) { func = comm->c_topo->topo_cart_rank; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_rank"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, coords, rank))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_rank"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } return MPI_SUCCESS; diff --git a/src/mpi/c/cart_shift.c b/src/mpi/c/cart_shift.c index 9a64b277cf..6e21eade07 100644 --- a/src/mpi/c/cart_shift.c +++ b/src/mpi/c/cart_shift.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_shift"; + + int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) { int err; @@ -25,25 +28,26 @@ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_shift"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_shift"); + FUNC_NAME); } if (!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_shift"); + FUNC_NAME); } if (0 > direction) { /* yet to detect direction >= comm->c_topo_ndims */ return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_DIMS, - "MPI_Cart_shift"); + FUNC_NAME); } if (NULL == rank_source || NULL == rank_dest) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_shift"); + FUNC_NAME); } } @@ -51,12 +55,12 @@ int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, func = comm->c_topo->topo_cart_shift; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_shift"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, direction, disp, rank_source, rank_dest))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_shift"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* all done */ diff --git a/src/mpi/c/cart_sub.c b/src/mpi/c/cart_sub.c index 7762524057..4b65ffba90 100644 --- a/src/mpi/c/cart_sub.c +++ b/src/mpi/c/cart_sub.c @@ -18,6 +18,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Cart_sub"; + int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm) { int err; @@ -25,21 +27,22 @@ int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm) { /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_sub"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Cart_sub"); + FUNC_NAME); } if (!OMPI_COMM_IS_CART(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Cart_sub"); + FUNC_NAME); } if (NULL == remain_dims || NULL == new_comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Cart_sub"); + FUNC_NAME); } } @@ -47,12 +50,12 @@ int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm) { func = comm->c_topo->topo_cart_sub; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Cart_sub"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, remain_dims, new_comm))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_sub"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* all done */ diff --git a/src/mpi/c/cartdim_get.c b/src/mpi/c/cartdim_get.c index dcf35f4ebb..8744564c37 100644 --- a/src/mpi/c/cartdim_get.c +++ b/src/mpi/c/cartdim_get.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Cartdim_get = PMPI_Cartdim_get @@ -16,6 +18,16 @@ #endif -int MPI_Cartdim_get(MPI_Comm comm, int *ndims) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Cartdim_get"; + + +int MPI_Cartdim_get(MPI_Comm comm, int *ndims) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/close_port.c b/src/mpi/c/close_port.c index 06de2514c1..bbc5a12e5d 100644 --- a/src/mpi/c/close_port.c +++ b/src/mpi/c/close_port.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Close_port"; +static const char FUNC_NAME[] = "MPI_Close_port"; int MPI_Close_port(char *port_name) @@ -27,7 +27,7 @@ int MPI_Close_port(char *port_name) if ( NULL == port_name ) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Close_port"); + FUNC_NAME); } /* As far as I can see at the moment, this is an empty function. @@ -35,5 +35,7 @@ int MPI_Close_port(char *port_name) therefore we don't have to free an 'address'. */ - return MPI_SUCCESS; + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/comm_accept.c b/src/mpi/c/comm_accept.c index a4e8ee003b..583e50c596 100644 --- a/src/mpi/c/comm_accept.c +++ b/src/mpi/c/comm_accept.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_accept"; +static const char FUNC_NAME[] = "MPI_Comm_accept"; int MPI_Comm_accept(char *port_name, MPI_Info info, int root, @@ -35,18 +35,22 @@ int MPI_Comm_accept(char *port_name, MPI_Info info, int root, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - if ( OMPI_COMM_IS_INTER(comm)) + } + if ( OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); - if ( 0 > root || ompi_comm_size(comm) < root ) + } + if ( 0 > root || ompi_comm_size(comm) < root ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == newcomm ) + } + if ( NULL == newcomm ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } rank = ompi_comm_rank ( comm ); diff --git a/src/mpi/c/comm_c2f.c b/src/mpi/c/comm_c2f.c index 8922375fdf..3ab322a643 100644 --- a/src/mpi/c/comm_c2f.c +++ b/src/mpi/c/comm_c2f.c @@ -18,18 +18,19 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Comm_c2f"; + + MPI_Fint MPI_Comm_c2f(MPI_Comm comm) { ompi_communicator_t *cptr=(ompi_communicator_t *)comm; if ( MPI_PARAM_CHECK) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_c2f"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ( ompi_comm_invalid (cptr)) return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Comm_c2f"); + FUNC_NAME); } /* Since MPI_COMM_NULL is an object itself, we do not have to check diff --git a/src/mpi/c/comm_call_errhandler.c b/src/mpi/c/comm_call_errhandler.c index aca84f5362..d60947511a 100644 --- a/src/mpi/c/comm_call_errhandler.c +++ b/src/mpi/c/comm_call_errhandler.c @@ -18,20 +18,23 @@ #endif +static const char FUNC_NAME[] = "MPI_Comm_call_errhandler"; + + int MPI_Comm_call_errhandler(MPI_Comm comm, int errorcode) { /* Error checking */ if (MPI_PARAM_CHECK) { - if (NULL == comm || - MPI_COMM_NULL == comm) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_call_errhandler"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, + FUNC_NAME); } } /* Invoke the errhandler */ - return OMPI_ERRHANDLER_INVOKE(comm, errorcode, - "MPI_Comm_call_errhandler"); + return OMPI_ERRHANDLER_INVOKE(comm, errorcode, FUNC_NAME); } + diff --git a/src/mpi/c/comm_compare.c b/src/mpi/c/comm_compare.c index b7d51a3220..07c1ba9d1b 100644 --- a/src/mpi/c/comm_compare.c +++ b/src/mpi/c/comm_compare.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_compare"; +static const char FUNC_NAME[] = "MPI_Comm_compare"; int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result) { diff --git a/src/mpi/c/comm_connect.c b/src/mpi/c/comm_connect.c index b22784598f..47c394636e 100644 --- a/src/mpi/c/comm_connect.c +++ b/src/mpi/c/comm_connect.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_connect"; +static const char FUNC_NAME[] = "MPI_Comm_connect"; int MPI_Comm_connect(char *port_name, MPI_Info info, int root, @@ -35,18 +35,22 @@ int MPI_Comm_connect(char *port_name, MPI_Info info, int root, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - if ( OMPI_COMM_IS_INTER(comm)) + } + if ( OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); - if ( 0 > root || ompi_comm_size(comm) < root ) + } + if ( 0 > root || ompi_comm_size(comm) < root ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == newcomm ) + } + if ( NULL == newcomm ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } rank = ompi_comm_rank ( comm ); diff --git a/src/mpi/c/comm_create.c b/src/mpi/c/comm_create.c index 969ee2504c..15ea416ff1 100644 --- a/src/mpi/c/comm_create.c +++ b/src/mpi/c/comm_create.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_create"; +static const char FUNC_NAME[] = "MPI_Comm_create"; int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) { diff --git a/src/mpi/c/comm_create_errhandler.c b/src/mpi/c/comm_create_errhandler.c index 45c11589b7..d80f207036 100644 --- a/src/mpi/c/comm_create_errhandler.c +++ b/src/mpi/c/comm_create_errhandler.c @@ -18,6 +18,9 @@ #endif +static const char FUNC_NAME[] = "MPI_Comm_create_errhandler"; + + int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler) { @@ -26,10 +29,12 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == function || NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_create_errhandler"); + FUNC_NAME); } } @@ -42,6 +47,5 @@ int MPI_Comm_create_errhandler(MPI_Comm_errhandler_fn *function, err = MPI_ERR_INTERN; } - OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_create_errhandler"); + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/comm_create_keyval.c b/src/mpi/c/comm_create_keyval.c index 57abd03419..2c02ff9f86 100644 --- a/src/mpi/c/comm_create_keyval.c +++ b/src/mpi/c/comm_create_keyval.c @@ -18,6 +18,7 @@ static const char FUNC_NAME[] = "MPI_Comm_create_keyval"; + int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, MPI_Comm_delete_attr_function *comm_delete_attr_fn, int *comm_keyval, void *extra_state) @@ -27,6 +28,7 @@ int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function *comm_copy_attr_fn, ompi_attribute_fn_ptr_union_t del_fn; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == comm_copy_attr_fn) || (NULL == comm_delete_attr_fn) || (NULL == comm_keyval)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, diff --git a/src/mpi/c/comm_delete_attr.c b/src/mpi/c/comm_delete_attr.c index 3b8a24038a..b22664c11f 100644 --- a/src/mpi/c/comm_delete_attr.c +++ b/src/mpi/c/comm_delete_attr.c @@ -18,11 +18,13 @@ static const char FUNC_NAME[] = "MPI_Comm_delete_attr"; + int MPI_Comm_delete_attr(MPI_Comm comm, int comm_keyval) { int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); diff --git a/src/mpi/c/comm_disconnect.c b/src/mpi/c/comm_disconnect.c index 8df53f8bea..49b09616fa 100644 --- a/src/mpi/c/comm_disconnect.c +++ b/src/mpi/c/comm_disconnect.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_disconnect"; +static const char FUNC_NAME[] = "MPI_Comm_disconnect"; int MPI_Comm_disconnect(MPI_Comm *comm) diff --git a/src/mpi/c/comm_dup.c b/src/mpi/c/comm_dup.c index 28a0882a74..bd83a8cfdb 100644 --- a/src/mpi/c/comm_dup.c +++ b/src/mpi/c/comm_dup.c @@ -17,11 +17,11 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_dup"; +static const char FUNC_NAME[] = "MPI_Comm_dup"; -int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) { - +int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) +{ /* local variables */ ompi_communicator_t *comp, *newcomp; int rsize, mode, rc=MPI_SUCCESS; diff --git a/src/mpi/c/comm_f2c.c b/src/mpi/c/comm_f2c.c index f7dddd3c1e..74b2f98ca8 100644 --- a/src/mpi/c/comm_f2c.c +++ b/src/mpi/c/comm_f2c.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_f2c"; +static const char FUNC_NAME[] = "MPI_Comm_f2c"; MPI_Comm MPI_Comm_f2c(MPI_Fint comm) diff --git a/src/mpi/c/comm_free.c b/src/mpi/c/comm_free.c index 199f841f7b..0eccc9a6ac 100644 --- a/src/mpi/c/comm_free.c +++ b/src/mpi/c/comm_free.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_free"; +static const char FUNC_NAME[] = "MPI_Comm_free"; int MPI_Comm_free(MPI_Comm *comm) { diff --git a/src/mpi/c/comm_free_keyval.c b/src/mpi/c/comm_free_keyval.c index 6ab5361702..dbbbbc9d67 100644 --- a/src/mpi/c/comm_free_keyval.c +++ b/src/mpi/c/comm_free_keyval.c @@ -18,6 +18,7 @@ static const char FUNC_NAME[] = "MPI_Comm_free_keyval"; + int MPI_Comm_free_keyval(int *comm_keyval) { int ret; @@ -25,6 +26,7 @@ int MPI_Comm_free_keyval(int *comm_keyval) /* Check for valid key pointer */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == comm_keyval) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); diff --git a/src/mpi/c/comm_get_attr.c b/src/mpi/c/comm_get_attr.c index b7537280dd..cefe88455e 100644 --- a/src/mpi/c/comm_get_attr.c +++ b/src/mpi/c/comm_get_attr.c @@ -18,12 +18,14 @@ static const char FUNC_NAME[] = "MPI_Comm_get_attr"; + int MPI_Comm_get_attr(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag) { int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == attribute_val) || (NULL == flag)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); diff --git a/src/mpi/c/comm_get_errhandler.c b/src/mpi/c/comm_get_errhandler.c index d02535a4d2..fa3c1a85f0 100644 --- a/src/mpi/c/comm_get_errhandler.c +++ b/src/mpi/c/comm_get_errhandler.c @@ -18,18 +18,22 @@ #endif +static const char FUNC_NAME[] = "MPI_Comm_get_errhandler"; + + int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler *errhandler) { /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == comm || MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_get_errhandler"); + FUNC_NAME); } else if (NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_get_errhandler"); + FUNC_NAME); } } diff --git a/src/mpi/c/comm_get_name.c b/src/mpi/c/comm_get_name.c index bea75c0f8e..9770f42835 100644 --- a/src/mpi/c/comm_get_name.c +++ b/src/mpi/c/comm_get_name.c @@ -21,7 +21,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_get_name"; +static const char FUNC_NAME[] = "MPI_Comm_get_name"; int MPI_Comm_get_name(MPI_Comm comm, char *name, int *length) { diff --git a/src/mpi/c/comm_get_parent.c b/src/mpi/c/comm_get_parent.c index b9d005fd92..8f37a23933 100644 --- a/src/mpi/c/comm_get_parent.c +++ b/src/mpi/c/comm_get_parent.c @@ -17,16 +17,19 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Comm_get_parent"; + + int MPI_Comm_get_parent(MPI_Comm *parent) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_get_parent"); - if ( NULL == parent ) + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + + if ( NULL == parent ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Comm_get_parent"); + FUNC_NAME); + } } /* * ompi_mpi_comm_parent is MPI_COMM_NULL, in case this @@ -40,5 +43,7 @@ int MPI_Comm_get_parent(MPI_Comm *parent) *parent = &ompi_mpi_comm_null; */ - return MPI_SUCCESS; + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/comm_group.c b/src/mpi/c/comm_group.c index 653fdd24ef..7fc562cc91 100644 --- a/src/mpi/c/comm_group.c +++ b/src/mpi/c/comm_group.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_group"; +static const char FUNC_NAME[] = "MPI_Comm_group"; int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) { diff --git a/src/mpi/c/comm_join.c b/src/mpi/c/comm_join.c index 037dac24aa..f6062055c1 100644 --- a/src/mpi/c/comm_join.c +++ b/src/mpi/c/comm_join.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_join"; +static const char FUNC_NAME[] = "MPI_Comm_join"; int MPI_Comm_join(int fd, MPI_Comm *intercomm) @@ -32,9 +32,10 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm) if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == intercomm ) + if ( NULL == intercomm ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } /* sendrecv OOB-name (port-name) through the socket connection. diff --git a/src/mpi/c/comm_rank.c b/src/mpi/c/comm_rank.c index 830066c642..4f22f2ffdc 100644 --- a/src/mpi/c/comm_rank.c +++ b/src/mpi/c/comm_rank.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_rank"; +static const char FUNC_NAME[] = "MPI_Comm_rank"; int MPI_Comm_rank(MPI_Comm comm, int *rank) diff --git a/src/mpi/c/comm_remote_group.c b/src/mpi/c/comm_remote_group.c index 1f2f728ca4..1a8ffc0865 100644 --- a/src/mpi/c/comm_remote_group.c +++ b/src/mpi/c/comm_remote_group.c @@ -10,7 +10,6 @@ #include "runtime/runtime.h" #include "communicator/communicator.h" - #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Comm_remote_group = PMPI_Comm_remote_group #endif @@ -20,29 +19,32 @@ #endif +static const char FUNC_NAME[] = "MPI_Comm_remote_group"; + + int MPI_Comm_remote_group(MPI_Comm comm, MPI_Group *group) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_remote_group"); - - if (MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Comm_remote_group"); + FUNC_NAME); + } - if ( NULL == group ) + if ( NULL == group ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, - "MPI_Comm_remote_group"); + FUNC_NAME); + } } if ( OMPI_COMM_IS_INTER(comm) ) { OBJ_RETAIN(comm->c_remote_group); } - else + else { return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_COMM, - "MPI_Comm_remote_group"); + FUNC_NAME); + } *group = (MPI_Group) comm->c_remote_group; return MPI_SUCCESS; diff --git a/src/mpi/c/comm_remote_size.c b/src/mpi/c/comm_remote_size.c index 0de6d80115..0caf2148de 100644 --- a/src/mpi/c/comm_remote_size.c +++ b/src/mpi/c/comm_remote_size.c @@ -18,20 +18,22 @@ #endif +static const char FUNC_NAME[] = "MPI_Comm_remote_size"; + + int MPI_Comm_remote_size(MPI_Comm comm, int *size) { if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Comm_remote_size"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if (MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Comm_remote_size"); + FUNC_NAME); + } - if ( NULL == size ) - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, - "MPI_Comm_remote_size"); + if ( NULL == size ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } *size = ompi_comm_remote_size ((ompi_communicator_t*)comm); diff --git a/src/mpi/c/comm_set_attr.c b/src/mpi/c/comm_set_attr.c index e05e2c4562..cbc87b3809 100644 --- a/src/mpi/c/comm_set_attr.c +++ b/src/mpi/c/comm_set_attr.c @@ -18,11 +18,13 @@ static const char FUNC_NAME[] = "MPI_Comm_set_attr"; + int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) { int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); @@ -31,6 +33,5 @@ int MPI_Comm_set_attr(MPI_Comm comm, int comm_keyval, void *attribute_val) ret = ompi_attr_set(COMM_ATTR, comm, comm->c_keyhash, comm_keyval, attribute_val, 0); - OMPI_ERRHANDLER_RETURN(ret, comm, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/comm_set_errhandler.c b/src/mpi/c/comm_set_errhandler.c index dfdd237c6d..0f62baece0 100644 --- a/src/mpi/c/comm_set_errhandler.c +++ b/src/mpi/c/comm_set_errhandler.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_set_errhandler"; +static const char FUNC_NAME[] = "MPI_Comm_set_errhandler"; int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) diff --git a/src/mpi/c/comm_set_name.c b/src/mpi/c/comm_set_name.c index 52c0160fc0..3751c956ab 100644 --- a/src/mpi/c/comm_set_name.c +++ b/src/mpi/c/comm_set_name.c @@ -21,7 +21,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_set_name"; +static const char FUNC_NAME[] = "MPI_Comm_set_name"; int MPI_Comm_set_name(MPI_Comm comm, char *name) { @@ -31,13 +31,15 @@ int MPI_Comm_set_name(MPI_Comm comm, char *name) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) { return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); + } - if ( NULL == name ) + if ( NULL == name ) { return OMPI_ERRHANDLER_INVOKE ( comm, MPI_ERR_ARG, FUNC_NAME); + } } /* -- Thread safety entrance -- */ diff --git a/src/mpi/c/comm_size.c b/src/mpi/c/comm_size.c index 49ce211070..ddc2bc799f 100644 --- a/src/mpi/c/comm_size.c +++ b/src/mpi/c/comm_size.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_comm_size"; +static const char FUNC_NAME[] = "MPI_comm_size"; int MPI_Comm_size(MPI_Comm comm, int *size) { @@ -25,12 +25,14 @@ int MPI_Comm_size(MPI_Comm comm, int *size) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); + } - if ( NULL == size ) + if ( NULL == size ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } *size = ompi_comm_size((ompi_communicator_t*)comm); diff --git a/src/mpi/c/comm_spawn.c b/src/mpi/c/comm_spawn.c index 35be571f0f..8e9dd20f48 100644 --- a/src/mpi/c/comm_spawn.c +++ b/src/mpi/c/comm_spawn.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_spawn"; +static const char FUNC_NAME[] = "MPI_Comm_spawn"; int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, @@ -36,35 +36,43 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - if ( OMPI_COMM_IS_INTER(comm)) + } + if ( OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); - if ( 0 > root || ompi_comm_size(comm) < root ) + } + if ( 0 > root || ompi_comm_size(comm) < root ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == intercomm ) + } + if ( NULL == intercomm ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_errcodes ) + } + if ( NULL == array_of_errcodes ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } rank = ompi_comm_rank ( comm ); if ( MPI_PARAM_CHECK ) { if ( rank == root ) { - if ( NULL == command ) + if ( NULL == command ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == argv ) + } + if ( NULL == argv ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( 0 > maxprocs ) + } + if ( 0 > maxprocs ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } } diff --git a/src/mpi/c/comm_spawn_multiple.c b/src/mpi/c/comm_spawn_multiple.c index 1cc5c881a6..d09414abea 100644 --- a/src/mpi/c/comm_spawn_multiple.c +++ b/src/mpi/c/comm_spawn_multiple.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_spawn_multiple"; +static const char FUNC_NAME[] = "MPI_Comm_spawn_multiple"; int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_of_argv, @@ -37,52 +37,65 @@ int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_o if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - if ( OMPI_COMM_IS_INTER(comm)) + } + if ( OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COMM, FUNC_NAME); - if ( 0 > root || ompi_comm_size(comm) < root ) + } + if ( 0 > root || ompi_comm_size(comm) < root ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == intercomm ) + } + if ( NULL == intercomm ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_errcodes ) + } + if ( NULL == array_of_errcodes ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } rank = ompi_comm_rank ( comm ); if ( MPI_PARAM_CHECK ) { if ( rank == root ) { - if ( 0 > count ) + if ( 0 > count ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_commands ) + } + if ( NULL == array_of_commands ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_argv ) + } + if ( NULL == array_of_argv ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_maxprocs ) + } + if ( NULL == array_of_maxprocs ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == array_of_info ) + } + if ( NULL == array_of_info ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - for ( i=0; i array_of_maxprocs[i] ) + } + for ( i=0; i array_of_maxprocs[i] ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, + FUNC_NAME); + } + } } } diff --git a/src/mpi/c/comm_split.c b/src/mpi/c/comm_split.c index ca00734f55..a63e53bd5c 100644 --- a/src/mpi/c/comm_split.c +++ b/src/mpi/c/comm_split.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_split"; +static const char FUNC_NAME[] = "MPI_Comm_split"; int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) { @@ -27,17 +27,20 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( comm == MPI_COMM_NULL || ompi_comm_invalid ( comm )) + if ( comm == MPI_COMM_NULL || ompi_comm_invalid ( comm )) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); + } - if ( color < 0 && MPI_UNDEFINED != color ) + if ( color < 0 && MPI_UNDEFINED != color ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } - if ( NULL == newcomm ) + if ( NULL == newcomm ) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } rc = ompi_comm_split ( (ompi_communicator_t*)comm, color, key, diff --git a/src/mpi/c/comm_test_inter.c b/src/mpi/c/comm_test_inter.c index 8651804139..75ba2aaa6c 100644 --- a/src/mpi/c/comm_test_inter.c +++ b/src/mpi/c/comm_test_inter.c @@ -17,7 +17,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Comm_test_inter"; +static const char FUNC_NAME[] = "MPI_Comm_test_inter"; int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { @@ -25,13 +25,15 @@ int MPI_Comm_test_inter(MPI_Comm comm, int *flag) { if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) + if ( MPI_COMM_NULL == comm || ompi_comm_invalid ( comm ) ) { return OMPI_ERRHANDLER_INVOKE ( MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); + } - if ( NULL == flag ) + if ( NULL == flag ) { return OMPI_ERRHANDLER_INVOKE ( comm, MPI_ERR_ARG, FUNC_NAME); + } } *flag = (comm->c_flags & OMPI_COMM_INTER); diff --git a/src/mpi/c/dims_create.c b/src/mpi/c/dims_create.c index a8aab88e16..05f9357fdb 100644 --- a/src/mpi/c/dims_create.c +++ b/src/mpi/c/dims_create.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Dims_create = PMPI_Dims_create @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Dims_create(int nnodes, int ndims, int *dims) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Dims_create"; + + +int MPI_Dims_create(int nnodes, int ndims, int *dims) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/errhandler_c2f.c b/src/mpi/c/errhandler_c2f.c index c62f0783f0..3d0f64e935 100644 --- a/src/mpi/c/errhandler_c2f.c +++ b/src/mpi/c/errhandler_c2f.c @@ -17,12 +17,15 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_c2f"; + MPI_Fint MPI_Errhandler_c2f(MPI_Errhandler errhandler) { /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == errhandler || MPI_ERRHANDLER_NULL == errhandler || OMPI_ERRHANDLER_TYPE_COMM != errhandler->eh_mpi_object_type) { diff --git a/src/mpi/c/errhandler_create.c b/src/mpi/c/errhandler_create.c index 6667569686..2a5c16aa9f 100644 --- a/src/mpi/c/errhandler_create.c +++ b/src/mpi/c/errhandler_create.c @@ -15,6 +15,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_create"; + + int MPI_Errhandler_create(MPI_Handler_function *function, MPI_Errhandler *errhandler) { diff --git a/src/mpi/c/errhandler_f2c.c b/src/mpi/c/errhandler_f2c.c index 100cf9a734..6de88557db 100644 --- a/src/mpi/c/errhandler_f2c.c +++ b/src/mpi/c/errhandler_f2c.c @@ -17,6 +17,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_f2c"; + MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler_f) { @@ -25,6 +27,8 @@ MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler_f) /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (0 > eh_index || eh_index >= ompi_pointer_array_get_size(ompi_errhandler_f_to_c_table)) { return MPI_ERRHANDLER_NULL; diff --git a/src/mpi/c/errhandler_free.c b/src/mpi/c/errhandler_free.c index 51abccb00a..c80e723064 100644 --- a/src/mpi/c/errhandler_free.c +++ b/src/mpi/c/errhandler_free.c @@ -17,12 +17,15 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_free"; + int MPI_Errhandler_free(MPI_Errhandler *errhandler) { /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == errhandler || ompi_errhandler_is_intrinsic(*errhandler)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, diff --git a/src/mpi/c/errhandler_get.c b/src/mpi/c/errhandler_get.c index e766c4d2aa..d98cd686c9 100644 --- a/src/mpi/c/errhandler_get.c +++ b/src/mpi/c/errhandler_get.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Errhandler_get = PMPI_Errhandler_get @@ -15,9 +17,15 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_get"; + int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) { + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + /* This is a deprecated -- just turn around and call the real function */ diff --git a/src/mpi/c/errhandler_set.c b/src/mpi/c/errhandler_set.c index 0faf90f1bb..976ca3c279 100644 --- a/src/mpi/c/errhandler_set.c +++ b/src/mpi/c/errhandler_set.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Errhandler_set = PMPI_Errhandler_set @@ -15,9 +17,15 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Errhandler_set"; + int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) { + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + /* This is a deprecated -- just turn around and call the real function */ diff --git a/src/mpi/c/error_class.c b/src/mpi/c/error_class.c index 4527309da5..27a96f3026 100644 --- a/src/mpi/c/error_class.c +++ b/src/mpi/c/error_class.c @@ -18,18 +18,18 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Error_class"; +static const char FUNC_NAME[] = "MPI_Error_class"; int MPI_Error_class(int errorcode, int *errorclass) { - if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( ompi_mpi_errcode_is_invalid(errorcode)) + if ( ompi_mpi_errcode_is_invalid(errorcode)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } diff --git a/src/mpi/c/error_string.c b/src/mpi/c/error_string.c index 76dbe88d69..9ef84d348b 100644 --- a/src/mpi/c/error_string.c +++ b/src/mpi/c/error_string.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Error_string"; +static const char FUNC_NAME[] = "MPI_Error_string"; int MPI_Error_string(int errorcode, char *string, int *resultlen) @@ -29,9 +29,10 @@ int MPI_Error_string(int errorcode, char *string, int *resultlen) if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( ompi_mpi_errcode_is_invalid(errorcode)) + if ( ompi_mpi_errcode_is_invalid(errorcode)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } tmpstring = ompi_mpi_errcode_get_string (errorcode); diff --git a/src/mpi/c/exscan.c b/src/mpi/c/exscan.c index 2af0f0f9f3..85d860c8ca 100644 --- a/src/mpi/c/exscan.c +++ b/src/mpi/c/exscan.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Exscan"; +static const char FUNC_NAME[] = "MPI_Exscan"; int MPI_Exscan(void *sendbuf, void *recvbuf, int count, diff --git a/src/mpi/c/file_c2f.c b/src/mpi/c/file_c2f.c index 9b2a5e2e5f..107d1f64a7 100644 --- a/src/mpi/c/file_c2f.c +++ b/src/mpi/c/file_c2f.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_c2f = PMPI_File_c2f @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -MPI_Fint MPI_File_c2f(MPI_File file) { - return (MPI_Fint)0; +static const char FUNC_NAME[] = "MPI_File_c2f"; + + +MPI_Fint MPI_File_c2f(MPI_File file) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_call_errhandler.c b/src/mpi/c/file_call_errhandler.c index 972bb70762..76c2dd93f6 100644 --- a/src/mpi/c/file_call_errhandler.c +++ b/src/mpi/c/file_call_errhandler.c @@ -18,19 +18,22 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_call_errhandler(MPI_File fh, int errorcode) { +static const char FUNC_NAME[] = "MPI_File_call_errhandler"; + + +int MPI_File_call_errhandler(MPI_File fh, int errorcode) +{ /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == fh || MPI_FILE_NULL == fh) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_File_call_errhandler"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } } /* Invoke the errhandler */ - return OMPI_ERRHANDLER_INVOKE(fh, errorcode, - "MPI_File_call_errhandler"); + return OMPI_ERRHANDLER_INVOKE(fh, errorcode, FUNC_NAME); } diff --git a/src/mpi/c/file_close.c b/src/mpi/c/file_close.c index a3fd9a0a88..8436f928e9 100644 --- a/src/mpi/c/file_close.c +++ b/src/mpi/c/file_close.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_close = PMPI_File_close @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_close(MPI_File *fh) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_close"; + + +int MPI_File_close(MPI_File *fh) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_create_errhandler.c b/src/mpi/c/file_create_errhandler.c index 13f6b71b17..0853d99637 100644 --- a/src/mpi/c/file_create_errhandler.c +++ b/src/mpi/c/file_create_errhandler.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_create_errhandler"; + + int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, MPI_Errhandler *errhandler) { int err = MPI_SUCCESS; @@ -25,6 +28,7 @@ int MPI_File_create_errhandler(MPI_File_errhandler_fn *function, /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == function || NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, diff --git a/src/mpi/c/file_delete.c b/src/mpi/c/file_delete.c index 523d5d76fd..6237f5c5a9 100644 --- a/src/mpi/c/file_delete.c +++ b/src/mpi/c/file_delete.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_delete = PMPI_File_delete @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_delete(char *filename, MPI_Info info) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_delete"; + + +int MPI_File_delete(char *filename, MPI_Info info) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_f2c.c b/src/mpi/c/file_f2c.c index f831797c99..618e8401cb 100644 --- a/src/mpi/c/file_f2c.c +++ b/src/mpi/c/file_f2c.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_f2c = PMPI_File_f2c @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -MPI_File MPI_File_f2c(MPI_Fint file) { - return (MPI_File)0; +static const char FUNC_NAME[] = "MPI_File_f2c"; + + +MPI_File MPI_File_f2c(MPI_Fint file) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return (MPI_File) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_amode.c b/src/mpi/c/file_get_amode.c index d86ca3620b..4d7f953548 100644 --- a/src/mpi/c/file_get_amode.c +++ b/src/mpi/c/file_get_amode.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_amode = PMPI_File_get_amode @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_amode(MPI_File fh, int *amode) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_amode"; + + +int MPI_File_get_amode(MPI_File fh, int *amode) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_atomicity.c b/src/mpi/c/file_get_atomicity.c index bd1a726566..0e21e5c4c9 100644 --- a/src/mpi/c/file_get_atomicity.c +++ b/src/mpi/c/file_get_atomicity.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_atomicity = PMPI_File_get_atomicity @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_atomicity(MPI_File fh, int *flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_atomicity"; + + +int MPI_File_get_atomicity(MPI_File fh, int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_byte_offset.c b/src/mpi/c/file_get_byte_offset.c index 54cbecf12f..c3fcf23048 100644 --- a/src/mpi/c/file_get_byte_offset.c +++ b/src/mpi/c/file_get_byte_offset.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_byte_offset = PMPI_File_get_byte_offset @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_get_byte_offset"; + + int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, - MPI_Offset *disp) { - return MPI_SUCCESS; + MPI_Offset *disp) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_errhandler.c b/src/mpi/c/file_get_errhandler.c index 9b77c4b3df..8297d9a605 100644 --- a/src/mpi/c/file_get_errhandler.c +++ b/src/mpi/c/file_get_errhandler.c @@ -18,13 +18,18 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler) { +static const char FUNC_NAME[] = "MPI_File_get_errhandler"; + + +int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler) +{ /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == file || MPI_FILE_NULL == file) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_FILE, "MPI_File_get_errhandler"); } else if (NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, @@ -38,5 +43,6 @@ int MPI_File_get_errhandler( MPI_File file, MPI_Errhandler *errhandler) { *errhandler = file->error_handler; /* All done */ + return MPI_SUCCESS; } diff --git a/src/mpi/c/file_get_group.c b/src/mpi/c/file_get_group.c index 2a9309f9d6..c921d0efa0 100644 --- a/src/mpi/c/file_get_group.c +++ b/src/mpi/c/file_get_group.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_group = PMPI_File_get_group @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_group(MPI_File fh, MPI_Group *group) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_group"; + + +int MPI_File_get_group(MPI_File fh, MPI_Group *group) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_info.c b/src/mpi/c/file_get_info.c index 651c76edb1..2a9f82ebc4 100644 --- a/src/mpi/c/file_get_info.c +++ b/src/mpi/c/file_get_info.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_info = PMPI_File_get_info @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_info"; + + +int MPI_File_get_info(MPI_File fh, MPI_Info *info_used) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_position.c b/src/mpi/c/file_get_position.c index 1f89cc5a59..b541746fa2 100644 --- a/src/mpi/c/file_get_position.c +++ b/src/mpi/c/file_get_position.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_position = PMPI_File_get_position @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_position"; + + +int MPI_File_get_position(MPI_File fh, MPI_Offset *offset) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_position_shared.c b/src/mpi/c/file_get_position_shared.c index e7ef8315d2..e0b076aa88 100644 --- a/src/mpi/c/file_get_position_shared.c +++ b/src/mpi/c/file_get_position_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_position_shared = PMPI_File_get_position_shared @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_position_shared"; + + +int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_size.c b/src/mpi/c/file_get_size.c index 290221bafb..be6f30cbfd 100644 --- a/src/mpi/c/file_get_size.c +++ b/src/mpi/c/file_get_size.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_size = PMPI_File_get_size @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_get_size(MPI_File fh, MPI_Offset *size) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_get_size"; + + +int MPI_File_get_size(MPI_File fh, MPI_Offset *size) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_type_extent.c b/src/mpi/c/file_get_type_extent.c index de6d30be75..f7036283ef 100644 --- a/src/mpi/c/file_get_type_extent.c +++ b/src/mpi/c/file_get_type_extent.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_type_extent = PMPI_File_get_type_extent @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_get_type_extent"; + + int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, - MPI_Aint *extent) { - return MPI_SUCCESS; + MPI_Aint *extent) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_get_view.c b/src/mpi/c/file_get_view.c index 908c4c47ae..d4d0f56bb1 100644 --- a/src/mpi/c/file_get_view.c +++ b/src/mpi/c/file_get_view.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_get_view = PMPI_File_get_view @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_get_view"; + + int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, - MPI_Datatype *etype, - MPI_Datatype *filetype, char *datarep) { - return MPI_SUCCESS; + MPI_Datatype *etype, + MPI_Datatype *filetype, char *datarep) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iread.c b/src/mpi/c/file_iread.c index 00a50a6ade..4ed7137fca 100644 --- a/src/mpi/c/file_iread.c +++ b/src/mpi/c/file_iread.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iread = PMPI_File_iread @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_iread"; + + int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Request *request) { - return MPI_SUCCESS; + datatype, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iread_at.c b/src/mpi/c/file_iread_at.c index edb4becbaa..74a9990c47 100644 --- a/src/mpi/c/file_iread_at.c +++ b/src/mpi/c/file_iread_at.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iread_at = PMPI_File_iread_at @@ -15,8 +17,17 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Request *request) { +static const char FUNC_NAME[] = "MPI_File_iread_at"; - return MPI_SUCCESS; + +int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iread_shared.c b/src/mpi/c/file_iread_shared.c index 889485d604..9b9db0f7cd 100644 --- a/src/mpi/c/file_iread_shared.c +++ b/src/mpi/c/file_iread_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iread_shared = PMPI_File_iread_shared @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_iread_shared"; + + int MPI_File_iread_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iwrite.c b/src/mpi/c/file_iwrite.c index 2b302091ba..54e430565b 100644 --- a/src/mpi/c/file_iwrite.c +++ b/src/mpi/c/file_iwrite.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iwrite = PMPI_File_iwrite @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_iwrite"; + + int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Request *request) { - return MPI_SUCCESS; + datatype, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iwrite_at.c b/src/mpi/c/file_iwrite_at.c index 3c6e6fb7b6..64f3edaaac 100644 --- a/src/mpi/c/file_iwrite_at.c +++ b/src/mpi/c/file_iwrite_at.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iwrite_at = PMPI_File_iwrite_at @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_iwrite_at"; + + int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPI_Request *request) { - return MPI_SUCCESS; + MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_iwrite_shared.c b/src/mpi/c/file_iwrite_shared.c index 8c3b0e517b..be0d509e82 100644 --- a/src/mpi/c/file_iwrite_shared.c +++ b/src/mpi/c/file_iwrite_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_iwrite_shared = PMPI_File_iwrite_shared @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_iwrite_shared"; + + int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Request *request) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_open.c b/src/mpi/c/file_open.c index bc80fcecb9..dbb3ad4caa 100644 --- a/src/mpi/c/file_open.c +++ b/src/mpi/c/file_open.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_open = PMPI_File_open @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_open"; + + int MPI_File_open(MPI_Comm comm, char *filename, int amode, - MPI_Info info, MPI_File *fh) { - return MPI_SUCCESS; + MPI_Info info, MPI_File *fh) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_preallocate.c b/src/mpi/c/file_preallocate.c index 51e18bc2b0..991f52a97f 100644 --- a/src/mpi/c/file_preallocate.c +++ b/src/mpi/c/file_preallocate.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_preallocate = PMPI_File_preallocate @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_preallocate(MPI_File fh, MPI_Offset size) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_preallocate"; + + +int MPI_File_preallocate(MPI_File fh, MPI_Offset size) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read.c b/src/mpi/c/file_read.c index 8b2c9dfb49..f3a39e269e 100644 --- a/src/mpi/c/file_read.c +++ b/src/mpi/c/file_read.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read = PMPI_File_read @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read"; + + int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) { - return MPI_SUCCESS; + datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_all.c b/src/mpi/c/file_read_all.c index c15f5f6e16..9291a887fb 100644 --- a/src/mpi/c/file_read_all.c +++ b/src/mpi/c/file_read_all.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_all = PMPI_File_read_all @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_all"; + + int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) { - return MPI_SUCCESS; + datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_all_begin.c b/src/mpi/c/file_read_all_begin.c index 476311becd..8560e5b6ba 100644 --- a/src/mpi/c/file_read_all_begin.c +++ b/src/mpi/c/file_read_all_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_all_begin = PMPI_File_read_all_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_all_begin"; + + int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) { - return MPI_SUCCESS; + MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_all_end.c b/src/mpi/c/file_read_all_end.c index bd1da6f23f..ef4a3d3f00 100644 --- a/src/mpi/c/file_read_all_end.c +++ b/src/mpi/c/file_read_all_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_all_end = PMPI_File_read_all_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_read_all_end"; + + +int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_at.c b/src/mpi/c/file_read_at.c index b09319da56..928fe7d932 100644 --- a/src/mpi/c/file_read_at.c +++ b/src/mpi/c/file_read_at.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_at = PMPI_File_read_at @@ -15,8 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_at"; + + int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, MPI_Status *status) { - - return MPI_SUCCESS; + int count, MPI_Datatype datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_at_all.c b/src/mpi/c/file_read_at_all.c index ec61c48304..2276f2a3f9 100644 --- a/src/mpi/c/file_read_at_all.c +++ b/src/mpi/c/file_read_at_all.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_at_all = PMPI_File_read_at_all @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_at_all"; + + int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) { - return MPI_SUCCESS; + int count, MPI_Datatype datatype, + MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_at_all_begin.c b/src/mpi/c/file_read_at_all_begin.c index d51fc71dd2..3bd2819250 100644 --- a/src/mpi/c/file_read_at_all_begin.c +++ b/src/mpi/c/file_read_at_all_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_at_all_begin = PMPI_File_read_at_all_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_at_all_begin"; + + int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype) { - return MPI_SUCCESS; + int count, MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_at_all_end.c b/src/mpi/c/file_read_at_all_end.c index fead9ad8b4..a5821b5067 100644 --- a/src/mpi/c/file_read_at_all_end.c +++ b/src/mpi/c/file_read_at_all_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_at_all_end = PMPI_File_read_at_all_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_read_at_all_end"; + + +int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_ordered.c b/src/mpi/c/file_read_ordered.c index 528c1f94f7..f92fb1e929 100644 --- a/src/mpi/c/file_read_ordered.c +++ b/src/mpi/c/file_read_ordered.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_ordered = PMPI_File_read_ordered @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_ordered"; + + int MPI_File_read_ordered(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_ordered_begin.c b/src/mpi/c/file_read_ordered_begin.c index 4d87e793b4..2f0b9c705d 100644 --- a/src/mpi/c/file_read_ordered_begin.c +++ b/src/mpi/c/file_read_ordered_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_ordered_begin = PMPI_File_read_ordered_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_ordered_begin"; + + int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) { - return MPI_SUCCESS; + MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_ordered_end.c b/src/mpi/c/file_read_ordered_end.c index 8ca60ec207..ca10fd79ea 100644 --- a/src/mpi/c/file_read_ordered_end.c +++ b/src/mpi/c/file_read_ordered_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_ordered_end = PMPI_File_read_ordered_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_read_ordered_end"; + + +int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_read_shared.c b/src/mpi/c/file_read_shared.c index d30f33b1c7..a15ed6507a 100644 --- a/src/mpi/c/file_read_shared.c +++ b/src/mpi/c/file_read_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_read_shared = PMPI_File_read_shared @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_read_shared"; + + int MPI_File_read_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_seek.c b/src/mpi/c/file_seek.c index b7e37389e0..11c5ae4a93 100644 --- a/src/mpi/c/file_seek.c +++ b/src/mpi/c/file_seek.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_seek = PMPI_File_seek @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_seek"; + + +int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_seek_shared.c b/src/mpi/c/file_seek_shared.c index 3f41d75e47..a1a3eca1f8 100644 --- a/src/mpi/c/file_seek_shared.c +++ b/src/mpi/c/file_seek_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_seek_shared = PMPI_File_seek_shared @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_seek_shared"; + + +int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_set_atomicity.c b/src/mpi/c/file_set_atomicity.c index d9e3739f86..3980401a11 100644 --- a/src/mpi/c/file_set_atomicity.c +++ b/src/mpi/c/file_set_atomicity.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_set_atomicity = PMPI_File_set_atomicity @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_set_atomicity(MPI_File fh, int flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_set_atomicity"; + + +int MPI_File_set_atomicity(MPI_File fh, int flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_set_errhandler.c b/src/mpi/c/file_set_errhandler.c index f94afe9543..257619babc 100644 --- a/src/mpi/c/file_set_errhandler.c +++ b/src/mpi/c/file_set_errhandler.c @@ -18,19 +18,23 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler) { +static const char FUNC_NAME[] = "MPI_File_set_errhandler"; + + +int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler) +{ /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == file || MPI_FILE_NULL == file) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_File_set_errhandler"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_FILE, + FUNC_NAME); } else if (NULL == errhandler || MPI_ERRHANDLER_NULL == errhandler || OMPI_ERRHANDLER_TYPE_FILE != errhandler->eh_mpi_object_type) { - return OMPI_ERRHANDLER_INVOKE(file, MPI_ERR_ARG, - "MPI_File_set_errhandler"); + return OMPI_ERRHANDLER_INVOKE(file, MPI_ERR_ARG, FUNC_NAME); } } @@ -44,5 +48,6 @@ int MPI_File_set_errhandler( MPI_File file, MPI_Errhandler errhandler) { OBJ_RETAIN(file->error_handler); /* All done */ + return MPI_SUCCESS; } diff --git a/src/mpi/c/file_set_info.c b/src/mpi/c/file_set_info.c index 17dc729ca8..27ba98fb80 100644 --- a/src/mpi/c/file_set_info.c +++ b/src/mpi/c/file_set_info.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_set_info = PMPI_File_set_info @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_set_info(MPI_File fh, MPI_Info info) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_set_info"; + + +int MPI_File_set_info(MPI_File fh, MPI_Info info) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_set_size.c b/src/mpi/c/file_set_size.c index fc0c1cfc23..b3991e892b 100644 --- a/src/mpi/c/file_set_size.c +++ b/src/mpi/c/file_set_size.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_set_size = PMPI_File_set_size @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_set_size(MPI_File fh, MPI_Offset size) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_set_size"; + + +int MPI_File_set_size(MPI_File fh, MPI_Offset size) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_set_view.c b/src/mpi/c/file_set_view.c index f05f67decb..34781a8b7e 100644 --- a/src/mpi/c/file_set_view.c +++ b/src/mpi/c/file_set_view.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_set_view = PMPI_File_set_view @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_set_view"; + + int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, - MPI_Datatype filetype, char *datarep, MPI_Info info) { - return MPI_SUCCESS; + MPI_Datatype filetype, char *datarep, MPI_Info info) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_sync.c b/src/mpi/c/file_sync.c index 9f3337f424..6780bd2bb1 100644 --- a/src/mpi/c/file_sync.c +++ b/src/mpi/c/file_sync.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_sync = PMPI_File_sync @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_sync(MPI_File fh) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_sync"; + + +int MPI_File_sync(MPI_File fh) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write.c b/src/mpi/c/file_write.c index 15623836a0..08c58d9943 100644 --- a/src/mpi/c/file_write.c +++ b/src/mpi/c/file_write.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write = PMPI_File_write @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write"; + + int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) { - return MPI_SUCCESS; + datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_all.c b/src/mpi/c/file_write_all.c index 2cbfbf3da4..c212d8317d 100644 --- a/src/mpi/c/file_write_all.c +++ b/src/mpi/c/file_write_all.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_all = PMPI_File_write_all @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_all"; + + int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype - datatype, MPI_Status *status) { - return MPI_SUCCESS; + datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_all_begin.c b/src/mpi/c/file_write_all_begin.c index 175439c844..7097f051e1 100644 --- a/src/mpi/c/file_write_all_begin.c +++ b/src/mpi/c/file_write_all_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_all_begin = PMPI_File_write_all_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_all_begin"; + + int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) { - return MPI_SUCCESS; + MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_all_end.c b/src/mpi/c/file_write_all_end.c index 286b81bcf7..7edb8eccde 100644 --- a/src/mpi/c/file_write_all_end.c +++ b/src/mpi/c/file_write_all_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_all_end = PMPI_File_write_all_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_write_all_end"; + + +int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_at.c b/src/mpi/c/file_write_at.c index 20a70cdd6e..f94931fc78 100644 --- a/src/mpi/c/file_write_at.c +++ b/src/mpi/c/file_write_at.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_at = PMPI_File_write_at @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_at"; + + int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, - MPI_Status *status) { - return MPI_SUCCESS; + MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_at_all.c b/src/mpi/c/file_write_at_all.c index c394bbafa0..10e15f254a 100644 --- a/src/mpi/c/file_write_at_all.c +++ b/src/mpi/c/file_write_at_all.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_at_all = PMPI_File_write_at_all @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_at_all"; + + int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype, - MPI_Status *status) { - return MPI_SUCCESS; + int count, MPI_Datatype datatype, + MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_at_all_begin.c b/src/mpi/c/file_write_at_all_begin.c index e619d4b9d6..b413302974 100644 --- a/src/mpi/c/file_write_at_all_begin.c +++ b/src/mpi/c/file_write_at_all_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_at_all_begin = PMPI_File_write_at_all_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_at_all_begin"; + + int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf, - int count, MPI_Datatype datatype) { - return MPI_SUCCESS; + int count, MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_at_all_end.c b/src/mpi/c/file_write_at_all_end.c index 0dc633d768..5ae8bfdef9 100644 --- a/src/mpi/c/file_write_at_all_end.c +++ b/src/mpi/c/file_write_at_all_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_at_all_end = PMPI_File_write_at_all_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_write_at_all_end"; + + +int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_ordered.c b/src/mpi/c/file_write_ordered.c index 5786926e39..a0aba799cf 100644 --- a/src/mpi/c/file_write_ordered.c +++ b/src/mpi/c/file_write_ordered.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_ordered = PMPI_File_write_ordered @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_ordered"; + + int MPI_File_write_ordered(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_ordered_begin.c b/src/mpi/c/file_write_ordered_begin.c index 52fc3cd81b..17d53dcfd6 100644 --- a/src/mpi/c/file_write_ordered_begin.c +++ b/src/mpi/c/file_write_ordered_begin.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_ordered_begin = PMPI_File_write_ordered_begin @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_ordered_begin"; + + int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, - MPI_Datatype datatype) { - return MPI_SUCCESS; + MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_ordered_end.c b/src/mpi/c/file_write_ordered_end.c index c08d90b12e..1fc144fe67 100644 --- a/src/mpi/c/file_write_ordered_end.c +++ b/src/mpi/c/file_write_ordered_end.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_ordered_end = PMPI_File_write_ordered_end @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_File_write_ordered_end"; + + +int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/file_write_shared.c b/src/mpi/c/file_write_shared.c index 0bc66c269c..684745cf1e 100644 --- a/src/mpi/c/file_write_shared.c +++ b/src/mpi/c/file_write_shared.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_File_write_shared = PMPI_File_write_shared @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_File_write_shared"; + + int MPI_File_write_shared(MPI_File fh, void *buf, int count, - MPI_Datatype datatype, MPI_Status *status) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/finalize.c b/src/mpi/c/finalize.c index c6ce1bb758..e4938c9e55 100644 --- a/src/mpi/c/finalize.c +++ b/src/mpi/c/finalize.c @@ -7,6 +7,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" #include "runtime/runtime.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Finalize = PMPI_Finalize @@ -16,9 +18,15 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Finalize"; + int MPI_Finalize(void) { + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + /* Pretty simple */ return ompi_mpi_finalize(); diff --git a/src/mpi/c/finalized.c b/src/mpi/c/finalized.c index 34e535b6ed..d691963fe4 100644 --- a/src/mpi/c/finalized.c +++ b/src/mpi/c/finalized.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Finalized = PMPI_Finalized @@ -15,6 +17,20 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Finalized(int *flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Finalized"; + + +int MPI_Finalized(int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == flag) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* Pretty simple */ + + *flag = ompi_mpi_finalized; + return MPI_SUCCESS; } diff --git a/src/mpi/c/free_mem.c b/src/mpi/c/free_mem.c index cec23b68d5..5c76a72b75 100644 --- a/src/mpi/c/free_mem.c +++ b/src/mpi/c/free_mem.c @@ -8,6 +8,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Free_mem = PMPI_Free_mem @@ -17,6 +19,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Free_mem"; + int MPI_Free_mem(void *baseptr) { @@ -31,5 +35,7 @@ int MPI_Free_mem(void *baseptr) If either fails, return an error on MPI_COMM_WORLD. */ - return MPI_SUCCESS; + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/gatherv.c b/src/mpi/c/gatherv.c index 7103c27116..91aadcdf2c 100644 --- a/src/mpi/c/gatherv.c +++ b/src/mpi/c/gatherv.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Gatherv"; +static const char FUNC_NAME[] = "MPI_Gatherv"; int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, diff --git a/src/mpi/c/get.c b/src/mpi/c/get.c index 5f32e2f5f5..37f5072950 100644 --- a/src/mpi/c/get.c +++ b/src/mpi/c/get.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get = PMPI_Get @@ -15,9 +17,19 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Get"; + + int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win) { - return MPI_SUCCESS; + MPI_Datatype target_datatype, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/get_address.c b/src/mpi/c/get_address.c index 2c589be28d..654447389c 100644 --- a/src/mpi/c/get_address.c +++ b/src/mpi/c/get_address.c @@ -19,14 +19,16 @@ static const char FUNC_NAME[] = "MPI_Get_address"; + int MPI_Get_address(void *location, MPI_Aint *address) { if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == location || NULL == address) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } + *address = (MPI_Aint)location; return MPI_SUCCESS; } diff --git a/src/mpi/c/get_count.c b/src/mpi/c/get_count.c index e2e93e6a77..7fce63dd8c 100644 --- a/src/mpi/c/get_count.c +++ b/src/mpi/c/get_count.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get_count = PMPI_Get_count @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Get_count"; + + +int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/get_elements.c b/src/mpi/c/get_elements.c index 2115c84459..e09f62056d 100644 --- a/src/mpi/c/get_elements.c +++ b/src/mpi/c/get_elements.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get_elements = PMPI_Get_elements @@ -15,7 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, - int *count) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Get_elements"; + + +int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/get_processor_name.c b/src/mpi/c/get_processor_name.c index c76a8187f9..430fdf70be 100644 --- a/src/mpi/c/get_processor_name.c +++ b/src/mpi/c/get_processor_name.c @@ -10,6 +10,7 @@ #include "mpi/c/bindings.h" #include "runtime/runtime.h" #include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get_processor_name = PMPI_Get_processor_name @@ -19,21 +20,24 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Get_processor_name"; + + int MPI_Get_processor_name(char *name, int *resultlen) { char tmp[MPI_MAX_PROCESSOR_NAME]; int len; if ( MPI_PARAM_CHECK) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Get_processor_name"); - if ( NULL == name ) + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if ( NULL == name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Get_processor_name"); - if ( NULL == resultlen ) + FUNC_NAME); + } + if ( NULL == resultlen ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Get_processor_name"); + FUNC_NAME); + } } /* A simple implementation of this function using gethostname*/ diff --git a/src/mpi/c/get_version.c b/src/mpi/c/get_version.c index 871dfb25e0..f9fa4e90e6 100644 --- a/src/mpi/c/get_version.c +++ b/src/mpi/c/get_version.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Get_version = PMPI_Get_version @@ -15,10 +17,22 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Get_version(int *version, int *subversion) { - /* According to the MPI-2 specification */ - *version = 2; - *subversion = 0; +static const char FUNC_NAME[] = "MPI_Get_version"; - return MPI_SUCCESS; + +int MPI_Get_version(int *version, int *subversion) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == version || NULL == subversion) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* According to the MPI-2 specification */ + + *version = 2; + *subversion = 0; + + return MPI_SUCCESS; } diff --git a/src/mpi/c/graph_create.c b/src/mpi/c/graph_create.c index ec38e9241d..34960ac3a0 100644 --- a/src/mpi/c/graph_create.c +++ b/src/mpi/c/graph_create.c @@ -18,35 +18,40 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Graph_create"; + + int MPI_Graph_create(MPI_Comm old_comm, int nnodes, int *index, - int *edges, int reorder, MPI_Comm *comm_graph) { + int *edges, int reorder, MPI_Comm *comm_graph) +{ int err; bool re_order = false; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == old_comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_create"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(old_comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_create"); + FUNC_NAME); } if (1 > nnodes || NULL == index || NULL == edges) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_create"); + FUNC_NAME); } if (nnodes > ompi_comm_size(old_comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_create"); + FUNC_NAME); } if (0 > reorder || 1 < reorder) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_create: boo"); + FUNC_NAME); } } @@ -68,7 +73,7 @@ int MPI_Graph_create(MPI_Comm old_comm, int nnodes, int *index, /* check the error status */ if (MPI_SUCCESS != err) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_create"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/graph_get.c b/src/mpi/c/graph_get.c index 78e352a9c5..982f514ce4 100644 --- a/src/mpi/c/graph_get.c +++ b/src/mpi/c/graph_get.c @@ -18,8 +18,12 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Graph_get"; + + int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, - int *index, int *edges) { + int *index, int *edges) +{ int err; mca_topo_base_graph_get_fn_t func; @@ -27,32 +31,32 @@ int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, if (MPI_PARAM_CHECK) { if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_get"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_get"); + FUNC_NAME); } if (!OMPI_COMM_IS_GRAPH(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Graph_get"); + FUNC_NAME); } if (0 > maxindex || 0 > maxedges || NULL == index || NULL == edges) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_get"); + FUNC_NAME); } } /* get the function pointer to do the right thing */ func = comm->c_topo->topo_graph_get; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Graph_get"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, maxindex, maxedges, index, edges))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_get"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/graph_map.c b/src/mpi/c/graph_map.c index 127e1d45c7..85b3bc230f 100644 --- a/src/mpi/c/graph_map.c +++ b/src/mpi/c/graph_map.c @@ -18,37 +18,42 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Graph_map"; + + int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges, - int *newrank) { + int *newrank) +{ int err; mca_topo_base_graph_map_fn_t func; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_map"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_map"); + FUNC_NAME); } if (1 > nnodes || NULL == index || NULL == edges || NULL == newrank) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_map"); + FUNC_NAME); } } /* map the function pointer to do the right thing */ func = comm->c_topo->topo_graph_map; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Graph_map"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, nnodes, index, edges, newrank))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_map"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/graph_neighbors.c b/src/mpi/c/graph_neighbors.c index 3a74bad519..24ac53cedb 100644 --- a/src/mpi/c/graph_neighbors.c +++ b/src/mpi/c/graph_neighbors.c @@ -18,46 +18,51 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Graph_neighbors"; + + int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, - int *neighbors) { + int *neighbors) +{ int err; mca_topo_base_graph_neighbors_fn_t func; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_neighbors"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_neighbors"); + FUNC_NAME); } if (!OMPI_COMM_IS_GRAPH(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Graph_neighbors"); + FUNC_NAME); } if ((0 > maxneighbors) || ((0 < maxneighbors) && NULL == neighbors)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_neighbors"); + FUNC_NAME); } if ((0 > rank) || (rank > ompi_group_size(comm->c_local_group))) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK, - "MPI_Graph_neighbors"); + FUNC_NAME); } } /* neighbors the function pointer to do the right thing */ func = comm->c_topo->topo_graph_neighbors; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Graph_neighbors"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, rank, maxneighbors, neighbors))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_neighbors"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/graph_neighbors_count.c b/src/mpi/c/graph_neighbors_count.c index bb61b6fceb..311b5b531d 100644 --- a/src/mpi/c/graph_neighbors_count.c +++ b/src/mpi/c/graph_neighbors_count.c @@ -18,44 +18,48 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Graph_neighbors_count"; + + int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) { int err; mca_topo_base_graph_neighbors_count_fn_t func; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_neighbors_count"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graph_neighbors_count"); + FUNC_NAME); } if (!OMPI_COMM_IS_GRAPH(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Graph_neighbors_count"); + FUNC_NAME); } if ((0 > rank) || (rank > ompi_group_size(comm->c_local_group))) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK, - "MPI_Graph_neighbors"); + FUNC_NAME); } if (NULL == nneighbors) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graph_neighbors_count"); + FUNC_NAME); } } /* get the function pointer to do the right thing */ func = comm->c_topo->topo_graph_neighbors_count; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Graph_neighbors_count"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, rank, nneighbors))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_neighbors_count"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/graphdims_get.c b/src/mpi/c/graphdims_get.c index 4f05d75dd4..0240c9f047 100644 --- a/src/mpi/c/graphdims_get.c +++ b/src/mpi/c/graphdims_get.c @@ -18,40 +18,45 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) { +static const char FUNC_NAME[] = "MPI_Graphdims_get"; + + +int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) +{ int err; mca_topo_base_graphdims_get_fn_t func; /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graphdims_get"); + FUNC_NAME); } if (OMPI_COMM_IS_INTER(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Graphdims_get"); + FUNC_NAME); } if (!OMPI_COMM_IS_GRAPH(comm)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY, - "MPI_Graphdims_get"); + FUNC_NAME); } if (NULL == nnodes || NULL == nedges) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Graphdims_get"); + FUNC_NAME); } } /* get the function pointer to do the right thing */ func = comm->c_topo->topo_graphdims_get; if (NULL == func) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, - "MPI_Graphdims_get"); + FUNC_NAME); } /* call the function */ if ( MPI_SUCCESS != (err = func(comm, nnodes, nedges))) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graphdims_get"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, FUNC_NAME); } /* All done */ diff --git a/src/mpi/c/grequest_complete.c b/src/mpi/c/grequest_complete.c index adbc303604..2c62bdd5b1 100644 --- a/src/mpi/c/grequest_complete.c +++ b/src/mpi/c/grequest_complete.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Grequest_complete = PMPI_Grequest_complete @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Grequest_complete(MPI_Request request) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Grequest_complete"; + + +int MPI_Grequest_complete(MPI_Request request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/grequest_start.c b/src/mpi/c/grequest_start.c index 5ef668375e..acc9e62a60 100644 --- a/src/mpi/c/grequest_start.c +++ b/src/mpi/c/grequest_start.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Grequest_start = PMPI_Grequest_start @@ -15,9 +17,19 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Grequest_start"; + + int MPI_Grequest_start(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, - void *extra_state, MPI_Request *request) { - return MPI_SUCCESS; + void *extra_state, MPI_Request *request) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/group_c2f.c b/src/mpi/c/group_c2f.c index 0bf89909de..4d89427945 100644 --- a/src/mpi/c/group_c2f.c +++ b/src/mpi/c/group_c2f.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Group_c2f"; + + MPI_Fint MPI_Group_c2f(MPI_Group group) { /* local variables */ @@ -25,11 +28,12 @@ MPI_Fint MPI_Group_c2f(MPI_Group group) { /* error checking */ if( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); /* check for MPI_GROUP_NULL */ if( (NULL == group) ) { return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, - "MPI_Group_c2f"); + FUNC_NAME); } } diff --git a/src/mpi/c/group_compare.c b/src/mpi/c/group_compare.c index 9d83784fbd..2d03da8b2d 100644 --- a/src/mpi/c/group_compare.c +++ b/src/mpi/c/group_compare.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_compare"; +static const char FUNC_NAME[] = "MPI_Group_compare"; int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) { @@ -28,7 +28,6 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result) { ompi_group_t *group1_pointer, *group2_pointer; ompi_proc_t *proc1_pointer, *proc2_pointer; - /* initialization */ return_value=MPI_SUCCESS; diff --git a/src/mpi/c/group_difference.c b/src/mpi/c/group_difference.c index 8051cfcdad..bfc2be511d 100644 --- a/src/mpi/c/group_difference.c +++ b/src/mpi/c/group_difference.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_difference"; +static const char FUNC_NAME[] = "MPI_Group_difference"; int MPI_Group_difference(MPI_Group group1, MPI_Group group2, diff --git a/src/mpi/c/group_excl.c b/src/mpi/c/group_excl.c index abd1cddeac..7f6eaa36dc 100644 --- a/src/mpi/c/group_excl.c +++ b/src/mpi/c/group_excl.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_excl"; +static const char FUNC_NAME[] = "MPI_Group_excl"; int MPI_Group_excl(MPI_Group group, int n, int *ranks, diff --git a/src/mpi/c/group_f2c.c b/src/mpi/c/group_f2c.c index f6a0df1785..24a00908ca 100644 --- a/src/mpi/c/group_f2c.c +++ b/src/mpi/c/group_f2c.c @@ -17,6 +17,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Group_f2c"; + MPI_Group MPI_Group_f2c(MPI_Fint group_f) { @@ -28,19 +30,19 @@ MPI_Group MPI_Group_f2c(MPI_Fint group_f) /* error checks */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (0 > group_index) { (void) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, - "MPI_Group_f2c"); + FUNC_NAME); return MPI_GROUP_NULL; } if (group_index >= ompi_group_f_to_c_table->size) { (void) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP, - "MPI_Group_f2c - II"); + FUNC_NAME); return MPI_GROUP_NULL; } } group_c = ompi_group_f_to_c_table->addr[group_index]; - return (MPI_Group) group_c; } diff --git a/src/mpi/c/group_free.c b/src/mpi/c/group_free.c index 236b4aa038..050d07e94f 100644 --- a/src/mpi/c/group_free.c +++ b/src/mpi/c/group_free.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_free"; +static const char FUNC_NAME[] = "MPI_Group_free"; int MPI_Group_free(MPI_Group *group) diff --git a/src/mpi/c/group_incl.c b/src/mpi/c/group_incl.c index 844dde9761..6dccff23c1 100644 --- a/src/mpi/c/group_incl.c +++ b/src/mpi/c/group_incl.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_incl"; +static const char FUNC_NAME[] = "MPI_Group_incl"; int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *new_group) diff --git a/src/mpi/c/group_intersection.c b/src/mpi/c/group_intersection.c index d38a5b214f..ea6e861ac1 100644 --- a/src/mpi/c/group_intersection.c +++ b/src/mpi/c/group_intersection.c @@ -18,12 +18,12 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_intersection"; +static const char FUNC_NAME[] = "MPI_Group_intersection"; int MPI_Group_intersection(MPI_Group group1, MPI_Group group2, - MPI_Group *new_group) { - + MPI_Group *new_group) +{ /* local variables */ int my_group_rank; int group_size,proc1,proc2,cnt; diff --git a/src/mpi/c/group_range_excl.c b/src/mpi/c/group_range_excl.c index 100cafde70..92829dfb22 100644 --- a/src/mpi/c/group_range_excl.c +++ b/src/mpi/c/group_range_excl.c @@ -18,12 +18,12 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_range_excl"; +static const char FUNC_NAME[] = "MPI_Group_range_excl"; int MPI_Group_range_excl(MPI_Group group, int n_triplets, int ranges[][3], - MPI_Group *new_group) { - + MPI_Group *new_group) +{ /* local variables */ int new_group_size, proc, first_rank, last_rank; int stride, triplet, index, *elements_int_list, my_group_rank; diff --git a/src/mpi/c/group_range_incl.c b/src/mpi/c/group_range_incl.c index eb444fb0bf..3538b8918f 100644 --- a/src/mpi/c/group_range_incl.c +++ b/src/mpi/c/group_range_incl.c @@ -18,11 +18,12 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_range_incl"; +static const char FUNC_NAME[] = "MPI_Group_range_incl"; int MPI_Group_range_incl(MPI_Group group, int n_triplets, int ranges[][3], - MPI_Group *new_group) { + MPI_Group *new_group) +{ /* local variables */ int new_group_size, proc, first_rank, last_rank; int stride, triplet, index, *elements_int_list, my_group_rank; diff --git a/src/mpi/c/group_rank.c b/src/mpi/c/group_rank.c index 85c4b946e0..4cf75cea24 100644 --- a/src/mpi/c/group_rank.c +++ b/src/mpi/c/group_rank.c @@ -18,11 +18,11 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_rank"; +static const char FUNC_NAME[] = "MPI_Group_rank"; -int MPI_Group_rank(MPI_Group group, int *rank) { - +int MPI_Group_rank(MPI_Group group, int *rank) +{ /* error checking */ if( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/src/mpi/c/group_size.c b/src/mpi/c/group_size.c index 335a85760a..d4fc7226a1 100644 --- a/src/mpi/c/group_size.c +++ b/src/mpi/c/group_size.c @@ -18,11 +18,11 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_size"; +static const char FUNC_NAME[] = "MPI_Group_size"; -int MPI_Group_size(MPI_Group group, int *size) { - +int MPI_Group_size(MPI_Group group, int *size) +{ /* error checking */ if( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); diff --git a/src/mpi/c/group_translate_ranks.c b/src/mpi/c/group_translate_ranks.c index 28e0db8767..1653ce2bb3 100644 --- a/src/mpi/c/group_translate_ranks.c +++ b/src/mpi/c/group_translate_ranks.c @@ -18,12 +18,12 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_translate_ranks"; +static const char FUNC_NAME[] = "MPI_Group_translate_ranks"; int MPI_Group_translate_ranks(MPI_Group group1, int n_ranks, int *ranks1, - MPI_Group group2, int *ranks2) { - + MPI_Group group2, int *ranks2) +{ int rank, proc, proc2; ompi_proc_t *proc1_pointer, *proc2_pointer; ompi_group_t *group1_pointer, *group2_pointer; diff --git a/src/mpi/c/group_union.c b/src/mpi/c/group_union.c index 27abf7e91d..16dc4e47a1 100644 --- a/src/mpi/c/group_union.c +++ b/src/mpi/c/group_union.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Group_union"; +static const char FUNC_NAME[] = "MPI_Group_union"; int MPI_Group_union(MPI_Group group1, MPI_Group group2, MPI_Group *new_group) diff --git a/src/mpi/c/info_c2f.c b/src/mpi/c/info_c2f.c index f10d58cd8b..270b324e84 100644 --- a/src/mpi/c/info_c2f.c +++ b/src/mpi/c/info_c2f.c @@ -19,6 +19,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_c2f"; + + /** * Converts info into a fortan handle * @@ -28,15 +31,18 @@ * If info is a valid C handle, the MPI_Info_c2f returns a valid * fortran handle to the same MPI_INFO object. */ -MPI_Fint MPI_Info_c2f(MPI_Info info) { - +MPI_Fint MPI_Info_c2f(MPI_Info info) +{ /* check the arguments */ if (MPI_PARAM_CHECK) { - if (NULL == info) { - return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_c2f"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, + MPI_ERR_INFO, + FUNC_NAME); } } + /* return the index */ return (MPI_Fint)(info->i_fhandle); } diff --git a/src/mpi/c/info_create.c b/src/mpi/c/info_create.c index 65633c0f7e..54ebb37e23 100644 --- a/src/mpi/c/info_create.c +++ b/src/mpi/c/info_create.c @@ -19,6 +19,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_create"; + /** * Create a new info object * @@ -39,9 +41,10 @@ int MPI_Info_create(MPI_Info *info) { * Yet to add stuff for fortran handles */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == info) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_create"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); } } @@ -52,10 +55,9 @@ int MPI_Info_create(MPI_Info *info) { * handle is valid */ (*info) = OBJ_NEW(ompi_info_t); - if (NULL == (*info)) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_SYSRESOURCE, - "MPI_Info_create"); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, + FUNC_NAME); } return MPI_SUCCESS; diff --git a/src/mpi/c/info_delete.c b/src/mpi/c/info_delete.c index c86060f857..64b725acf5 100644 --- a/src/mpi/c/info_delete.c +++ b/src/mpi/c/info_delete.c @@ -21,6 +21,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_delete"; + + /** * Delete a (key,value) pair from "info" * @@ -39,23 +42,20 @@ int MPI_Info_delete(MPI_Info info, char *key) { * This function merely deletes the (key,val) pair in info */ if (MPI_PARAM_CHECK) { - if (NULL == info || NULL == key){ - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_delete"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + + key_length = (key) ? strlen (key) : 0; + if ((NULL == key) || (0 == key_length) || + (MPI_MAX_INFO_KEY <= key_length)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_KEY, + FUNC_NAME); } } - key_length = (key) ? strlen (key) : 0; - if ( (0 == key_length) || (MPI_MAX_INFO_KEY <= key_length)) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_KEY, - "MPI_Info_delete"); - } - err = ompi_info_delete (info, key); - - if (MPI_ERR_INFO_NOKEY == err) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_NOKEY, - "MPI_Info_delete"); - } - return err; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_dup.c b/src/mpi/c/info_dup.c index 77d4106ca7..c9e630e87b 100644 --- a/src/mpi/c/info_dup.c +++ b/src/mpi/c/info_dup.c @@ -19,6 +19,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_dup"; + + /** * MPI_Info_dup - Duplicate an 'MPI_Info' object * @@ -47,25 +50,22 @@ int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo) { */ if (MPI_PARAM_CHECK) { - if (NULL == info){ - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_dup"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info || NULL == newinfo) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); } } - err = MPI_Info_create(newinfo); - if (MPI_SUCCESS != err) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, - "MPI_Info_dup"); + *newinfo = OBJ_NEW(ompi_info_t); + if (NULL == *newinfo) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM, + FUNC_NAME); } + /* * Now to actually duplicate all the values */ err = ompi_info_dup (info, newinfo); - if (err == MPI_ERR_SYSRESOURCE) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, - "MPI_Info_dup"); - } - - return MPI_SUCCESS; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_f2c.c b/src/mpi/c/info_f2c.c index 761033a001..7973e442fb 100644 --- a/src/mpi/c/info_f2c.c +++ b/src/mpi/c/info_f2c.c @@ -19,19 +19,26 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_f2c"; + + /** * Converts the MPI_Fint info into a valid C MPI_Info handle * * @param info Integer handle to an MPI_INFO object * @retval C handle corresponding to MPI_INFOO object */ -MPI_Info MPI_Info_f2c(MPI_Fint info) { +MPI_Info MPI_Info_f2c(MPI_Fint info) +{ /* check the arguments */ if (MPI_PARAM_CHECK) { - if (0 > info || info >= ompi_pointer_array_get_size(ompi_info_f_to_c_table)) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (0 > info || + info >= ompi_pointer_array_get_size(ompi_info_f_to_c_table)) { return MPI_INFO_NULL; } } + /* return the index */ return ompi_info_f_to_c_table->addr[info]; } diff --git a/src/mpi/c/info_free.c b/src/mpi/c/info_free.c index 5fdbcf0ff2..ed0e1efddb 100644 --- a/src/mpi/c/info_free.c +++ b/src/mpi/c/info_free.c @@ -19,6 +19,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_free"; + + /** * MPI_Info_free - Free an 'MPI_Info' object. * @@ -29,28 +32,22 @@ * * Upon successful completion, 'info' will be set to 'MPI_INFO_NULL'. */ -int MPI_Info_free(MPI_Info *info) { +int MPI_Info_free(MPI_Info *info) +{ int err; /* * Free all the alloced items from MPI_Info info. * Make sure the items are freed in an orderly * fashion so that there are no dangling pointers. - * Also, something needs to be done about the - * fortran handle. */ if (MPI_PARAM_CHECK) { - if (NULL == info){ + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_free"); + FUNC_NAME); } } - /* - * Now call the back end. Once again, it does not look like - * there can be any error from this, but then who knows. Have - * to recheck this part too. - */ - err = ompi_info_free (info); - - return MPI_SUCCESS; + err = ompi_info_free(info); + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_get.c b/src/mpi/c/info_get.c index 1407f3af3b..7dfed49698 100644 --- a/src/mpi/c/info_get.c +++ b/src/mpi/c/info_get.c @@ -22,6 +22,8 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_get"; + /** * MPI_Info_get - Get a (key, value) pair from an 'MPI_Info' object * @@ -40,8 +42,8 @@ * to allow for for the null terminator. */ int MPI_Info_get(MPI_Info info, char *key, int valuelen, - char *value, int *flag) { - + char *value, int *flag) +{ int err; int key_length; @@ -51,24 +53,32 @@ int MPI_Info_get(MPI_Info info, char *key, int valuelen, * necessary structures. */ if (MPI_PARAM_CHECK) { - if (NULL == info || NULL == key || 0 > valuelen){ + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + if (0 > valuelen){ return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_get"); + FUNC_NAME); } key_length = (key) ? strlen (key) : 0; - if ( (0 == key_length) || (MPI_MAX_INFO_KEY <= key_length)) { + if ((NULL == key) || (0 == key_length) || + (MPI_MAX_INFO_KEY <= key_length)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_KEY, - "MPI_Info_get"); + FUNC_NAME); + } + if (NULL == value) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_VALUE, + FUNC_NAME); + } + if (NULL == flag) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); } } err = ompi_info_get (info, key, valuelen, value, flag); - - /* - * Once again, ompi_info_get does not return any error. So, as of - * now there is no error condition to check for. But maybe this - * needs to be re-evaluated and then something can be done - */ - return MPI_SUCCESS; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_get_nkeys.c b/src/mpi/c/info_get_nkeys.c index f255414373..0c88edc118 100644 --- a/src/mpi/c/info_get_nkeys.c +++ b/src/mpi/c/info_get_nkeys.c @@ -19,6 +19,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_get_nkeys"; + + /** * MPI_Info_get_nkeys - Returns the number of keys defined on an * 'MPI_Info' object @@ -32,21 +35,22 @@ * This function returns the number of elements in the list * containing the key-value pairs */ -int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) { +int MPI_Info_get_nkeys(MPI_Info info, int *nkeys) +{ int err; if (MPI_PARAM_CHECK) { - if (NULL == info){ + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + if (NULL == nkeys) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_nkeys"); + FUNC_NAME); } } + err = ompi_info_get_nkeys(info, nkeys); - - /* - * check if there are any errors. There does not seem to be any - * error possible in this. But have to look at it again - */ - - return MPI_SUCCESS; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_get_nthkey.c b/src/mpi/c/info_get_nthkey.c index 4469373f13..e6b1a9da01 100644 --- a/src/mpi/c/info_get_nthkey.c +++ b/src/mpi/c/info_get_nthkey.c @@ -20,6 +20,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_get_nthkey"; + + /** * MPI_Info_get_nthkey - Get a key indexed by integer from an 'MPI_Info' obje * @@ -30,7 +33,8 @@ * @retval MPI_SUCCESS * @retval MPI_ERR_ARG */ -int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) { +int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) +{ int nkeys; int err; @@ -40,28 +44,30 @@ int MPI_Info_get_nthkey(MPI_Info info, int n, char *key) { * 3. If so, give the nth defined key */ if (MPI_PARAM_CHECK) { - if (NULL == info || 0 > n){ + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); + } + if (0 > n) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_get_nthkey"); + FUNC_NAME); + } + if (NULL == key) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_KEY, + FUNC_NAME); } } - MPI_Info_get_nkeys(info, &nkeys); - + err = ompi_info_get_nkeys(info, &nkeys); + OMPI_ERRHANDLER_CHECK(err, MPI_COMM_WORLD, err, FUNC_NAME); if (nkeys < n) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_KEY, - "MPI_Info_get_nthkey"); - - } else { - /* - * Everything seems alright. Call the back end key copy - */ - err = ompi_info_get_nthkey (info, n, key); + FUNC_NAME); } + + /* Everything seems alright. Call the back end key copy */ - /* - * Have to check whether there are any error condditions. It appears - * that there are not too many error conditions from the look of it - */ - return MPI_SUCCESS; + err = ompi_info_get_nthkey (info, n, key); + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_get_valuelen.c b/src/mpi/c/info_get_valuelen.c index c53f80bd7c..ef38162380 100644 --- a/src/mpi/c/info_get_valuelen.c +++ b/src/mpi/c/info_get_valuelen.c @@ -21,6 +21,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_get_valuelen"; + + /** * MPI_Info_get_valuelen - Get the length of a value for a given key in an 'M * @@ -39,8 +42,8 @@ * alone. */ int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, - int *flag) { - + int *flag) +{ int key_length; int err; @@ -49,21 +52,23 @@ int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, * having the "key" associated with it and return the length */ if (MPI_PARAM_CHECK) { - if (NULL == info || NULL == key){ - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_get_valuelen"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); } key_length = (key) ? strlen (key) : 0; - if ( (0 == key_length) || (MPI_MAX_INFO_KEY <= key_length)) { + if ((NULL == key) || (0 == key_length) || + (MPI_MAX_INFO_KEY <= key_length)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INFO_KEY, - "MPI_Info_get_valuelen"); + FUNC_NAME); + } + if (NULL == flag || NULL == valuelen) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); } } err = ompi_info_get_valuelen (info, key, valuelen, flag); - /* - * Once again, the error problem. ompi_info_get_valuelen - * does not have an obvious error return. - */ - return err; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/info_set.c b/src/mpi/c/info_set.c index 9ccaa468ec..0850379485 100644 --- a/src/mpi/c/info_set.c +++ b/src/mpi/c/info_set.c @@ -21,6 +21,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Info_set"; + + /** * MPI_Info_set - Set a (key, value) pair in an 'MPI_Info' object * @@ -42,39 +45,39 @@ * key or value is greater than the allowed maxima, MPI_ERR_INFO_KEY * and MPI_ERR_INFO_VALUE are raised */ -int MPI_Info_set(MPI_Info info, char *key, char *value) { +int MPI_Info_set(MPI_Info info, char *key, char *value) +{ int err; int key_length; int value_length; /* * Error conditions are - * 1. MPI_ERR_ARG if * - info is NULL - * 2. MPI_ERR_SYSRESOURCE * - No storage space available for the new value - * 3. MPI_ERR_INFO_KEY * - Key length exceeded MPI_MAX_KEY_VAL - * 3. MPI_ERR_INFO_VAL * - value length exceeded MPI_MAX_KEY_VAL */ if (MPI_PARAM_CHECK) { - if (NULL == info){ - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Info_set"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == info || MPI_INFO_NULL == info) { + return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO, + FUNC_NAME); } key_length = (key) ? strlen (key) : 0; - if ( (0 == key_length) || (MPI_MAX_INFO_KEY <= key_length)) { + if ((NULL == key) || (0 == key_length) || + (MPI_MAX_INFO_KEY <= key_length)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_KEY, - "MPI_Info_set"); + FUNC_NAME); } value_length = (value) ? strlen (value) : 0; - if ( (0 == value_length) || (MPI_MAX_INFO_KEY <= value_length)) { + if ((NULL == value) || (0 == value_length) || + (MPI_MAX_INFO_KEY <= value_length)) { return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_VALUE, - "MPI_Info_set"); + FUNC_NAME); } } @@ -84,11 +87,5 @@ int MPI_Info_set(MPI_Info info, char *key, char *value) { */ err = ompi_info_set (info, key, value); - - if (MPI_ERR_SYSRESOURCE == err) { - return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_SYSRESOURCE, - "MPI_Info_set"); - } - - return err; + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME); } diff --git a/src/mpi/c/init.c b/src/mpi/c/init.c index 58b51b80b1..95fdce8c55 100644 --- a/src/mpi/c/init.c +++ b/src/mpi/c/init.c @@ -21,7 +21,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Init"; +static const char FUNC_NAME[] = "MPI_Init"; int MPI_Init(int *argc, char ***argv) @@ -32,6 +32,16 @@ int MPI_Init(int *argc, char ***argv) int required = MPI_THREAD_SINGLE; MPI_Comm null = NULL; + /* Ensure that we were not already initialized or finalized */ + + if (ompi_mpi_finalized) { + /* JMS show_help */ + return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_OTHER, FUNC_NAME); + } else if (ompi_mpi_initialized) { + /* JMS show_help */ + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); + } + /* check for environment overrides for required thread level. If there is, check to see that it is a valid/supported thread level. If not, default to MPI_THREAD_SINGLE. */ @@ -40,7 +50,7 @@ int MPI_Init(int *argc, char ***argv) required = atoi(env); if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) { /* JMS show_help */ - OMPI_ERRHANDLER_INVOKE(null, err, FUNC_NAME); + return OMPI_ERRHANDLER_INVOKE(null, err, FUNC_NAME); } } diff --git a/src/mpi/c/init_thread.c b/src/mpi/c/init_thread.c index a905673f11..842010f466 100644 --- a/src/mpi/c/init_thread.c +++ b/src/mpi/c/init_thread.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Init_thread"; +static const char FUNC_NAME[] = "MPI_Init_thread"; int MPI_Init_thread(int *argc, char ***argv, int required, @@ -28,6 +28,16 @@ int MPI_Init_thread(int *argc, char ***argv, int required, int err; MPI_Comm null = NULL; + /* Ensure that we were not already initialized or finalized */ + + if (ompi_mpi_finalized) { + /* JMS show_help */ + return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_OTHER, FUNC_NAME); + } else if (ompi_mpi_initialized) { + /* JMS show_help */ + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); + } + /* Call the back-end initialization function (we need to put as little in this function as possible so that if it's profiled, we don't lose anything) */ diff --git a/src/mpi/c/initialized.c b/src/mpi/c/initialized.c index 80f375626c..8ecc94b648 100644 --- a/src/mpi/c/initialized.c +++ b/src/mpi/c/initialized.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Initialized = PMPI_Initialized @@ -15,6 +17,20 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Initialized(int *flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Initialized"; + + +int MPI_Initialized(int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == flag) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* Pretty simple */ + + *flag = ompi_mpi_initialized; + return MPI_SUCCESS; } diff --git a/src/mpi/c/intercomm_create.c b/src/mpi/c/intercomm_create.c index 71d0530871..474472d570 100644 --- a/src/mpi/c/intercomm_create.c +++ b/src/mpi/c/intercomm_create.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Intercomm_create"; +static const char FUNC_NAME[] = "MPI_Intercomm_create"; int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, diff --git a/src/mpi/c/intercomm_merge.c b/src/mpi/c/intercomm_merge.c index 0cc74c6418..09341126ec 100644 --- a/src/mpi/c/intercomm_merge.c +++ b/src/mpi/c/intercomm_merge.c @@ -19,7 +19,7 @@ #define INTERCOMM_MERGE_TAG 1010 -static char FUNC_NAME[] = "MPI_Intercomm_merge"; +static const char FUNC_NAME[] = "MPI_Intercomm_merge"; int MPI_Intercomm_merge(MPI_Comm intercomm, int high, diff --git a/src/mpi/c/iprobe.c b/src/mpi/c/iprobe.c index e24858223a..3c7e28cdca 100644 --- a/src/mpi/c/iprobe.c +++ b/src/mpi/c/iprobe.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Iprobe"; + + int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) { int rc; @@ -30,22 +33,21 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status } return MPI_SUCCESS; } - + if ( MPI_PARAM_CHECK ) { rc = MPI_SUCCESS; - if ( OMPI_MPI_INVALID_STATE ) { - rc = MPI_ERR_INTERN; - } else if (tag < 0 || tag > MPI_TAG_UB_VALUE) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (tag < 0 || tag > MPI_TAG_UB_VALUE) { rc = MPI_ERR_TAG; } else if (ompi_comm_invalid(comm)) { rc = MPI_ERR_COMM; } else if (source != MPI_ANY_SOURCE && ompi_comm_peer_invalid(comm, source)) { rc = MPI_ERR_RANK; } - OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Iprobe"); + OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME); } - + rc = mca_pml.pml_iprobe(source, tag, comm, flag, status); - OMPI_ERRHANDLER_RETURN(rc, comm, rc, "MPI_Iprobe"); + OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME); } diff --git a/src/mpi/c/is_thread_main.c b/src/mpi/c/is_thread_main.c index 0d100ab599..7841f846d4 100644 --- a/src/mpi/c/is_thread_main.c +++ b/src/mpi/c/is_thread_main.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Is_thread_main = PMPI_Is_thread_main @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Is_thread_main(int *flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Is_thread_main"; + + +int MPI_Is_thread_main(int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/keyval_create.c b/src/mpi/c/keyval_create.c index b74b8534ac..56056e29df 100644 --- a/src/mpi/c/keyval_create.c +++ b/src/mpi/c/keyval_create.c @@ -18,6 +18,7 @@ static const char FUNC_NAME[] = "MPI_Keyval_create"; + int MPI_Keyval_create(MPI_Copy_function *copy_attr_fn, MPI_Delete_function *delete_attr_fn, int *keyval, void *extra_state) @@ -27,17 +28,19 @@ int MPI_Keyval_create(MPI_Copy_function *copy_attr_fn, ompi_attribute_fn_ptr_union_t del_fn; if (MPI_PARAM_CHECK) { - if ((NULL == copy_attr_fn) || (NULL == delete_attr_fn) || - (NULL == keyval)) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == keyval) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_KEYVAL, + FUNC_NAME); + } else if ((NULL == copy_attr_fn) || (NULL == delete_attr_fn)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - } + } } copy_fn.attr_communicator_copy_fn = copy_attr_fn; del_fn.attr_communicator_delete_fn = delete_attr_fn; ret = ompi_attr_create_keyval(COMM_ATTR, copy_fn, del_fn, keyval, extra_state, 0); - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/keyval_free.c b/src/mpi/c/keyval_free.c index ffa3b0fa35..90c017f45c 100644 --- a/src/mpi/c/keyval_free.c +++ b/src/mpi/c/keyval_free.c @@ -18,6 +18,7 @@ static const char FUNC_NAME[] = "MPI_Keyval_free"; + int MPI_Keyval_free(int *keyval) { int ret; @@ -25,12 +26,11 @@ int MPI_Keyval_free(int *keyval) /* Check for valid key pointer */ if (MPI_PARAM_CHECK) { if (NULL == keyval) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_KEYVAL, FUNC_NAME); } } ret = ompi_attr_free_keyval(COMM_ATTR, keyval, 0); - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/lookup_name.c b/src/mpi/c/lookup_name.c index e435839835..fc49122690 100644 --- a/src/mpi/c/lookup_name.c +++ b/src/mpi/c/lookup_name.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Lookup_name"; +static const char FUNC_NAME[] = "MPI_Lookup_name"; int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name) @@ -28,12 +28,14 @@ int MPI_Lookup_name(char *service_name, MPI_Info info, char *port_name) if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == port_name ) + if ( NULL == port_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == service_name ) + } + if ( NULL == service_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } /* diff --git a/src/mpi/c/op_c2f.c b/src/mpi/c/op_c2f.c index b6a9ca6c36..0493a442b5 100644 --- a/src/mpi/c/op_c2f.c +++ b/src/mpi/c/op_c2f.c @@ -18,15 +18,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Op_c2f"; + + MPI_Fint MPI_Op_c2f(MPI_Op op) { /* Error checking */ if (MPI_PARAM_CHECK) { - if (NULL == op || - MPI_OP_NULL == op) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Op_c2f"); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == op || MPI_OP_NULL == op) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OP, + FUNC_NAME); } } diff --git a/src/mpi/c/op_create.c b/src/mpi/c/op_create.c index 940cb0753c..6df02cb900 100644 --- a/src/mpi/c/op_create.c +++ b/src/mpi/c/op_create.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Op_create"; +static const char FUNC_NAME[] = "MPI_Op_create"; int MPI_Op_create(MPI_User_function *function, int commute, @@ -30,10 +30,10 @@ int MPI_Op_create(MPI_User_function *function, int commute, 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, - FUNC_NAME); + if (NULL == op) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OP, FUNC_NAME); + } else if (NULL == function) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } } @@ -44,7 +44,5 @@ int MPI_Op_create(MPI_User_function *function, int commute, if (NULL == *op) { err = MPI_ERR_INTERN; } - - OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, - FUNC_NAME); + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/op_f2c.c b/src/mpi/c/op_f2c.c index e874773020..b7ba8e64a4 100644 --- a/src/mpi/c/op_f2c.c +++ b/src/mpi/c/op_f2c.c @@ -18,6 +18,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Op_f2c"; + + MPI_Op MPI_Op_f2c(MPI_Fint op_f) { size_t o_index = (size_t) op_f; @@ -25,6 +28,7 @@ MPI_Op MPI_Op_f2c(MPI_Fint op_f) /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (0 > o_index || o_index >= ompi_pointer_array_get_size(ompi_op_f_to_c_table)) { return MPI_OP_NULL; diff --git a/src/mpi/c/op_free.c b/src/mpi/c/op_free.c index bb0e9146c9..5718291f71 100644 --- a/src/mpi/c/op_free.c +++ b/src/mpi/c/op_free.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Op_free"; +static const char FUNC_NAME[] = "MPI_Op_free"; int MPI_Op_free(MPI_Op *op) diff --git a/src/mpi/c/open_port.c b/src/mpi/c/open_port.c index e5b71a389a..df9853bbf8 100644 --- a/src/mpi/c/open_port.c +++ b/src/mpi/c/open_port.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Open_port"; +static const char FUNC_NAME[] = "MPI_Open_port"; int MPI_Open_port(MPI_Info info, char *port_name) @@ -26,9 +26,10 @@ int MPI_Open_port(MPI_Info info, char *port_name) if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == port_name ) + if ( NULL == port_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } if ( MPI_INFO_NULL != info ) { @@ -50,5 +51,7 @@ int MPI_Open_port(MPI_Info info, char *port_name) memcpy ( port_name, oob-whatever-fcnt, strlen(oob-whatever-fctn)); */ - return MPI_SUCCESS; + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/pack.c b/src/mpi/c/pack.c index 8f8cf90a58..90115be825 100644 --- a/src/mpi/c/pack.c +++ b/src/mpi/c/pack.c @@ -33,24 +33,16 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, struct iovec invec; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } - - if ((NULL == inbuf) || (NULL == outbuf) || (NULL == position)) { + } else if ((NULL == inbuf) || (NULL == outbuf) || (NULL == position)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - } -#if 0 - if (count < 0) { + } else if (incount < 0) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME); - } -#endif - - if (outsize < 0) { + } else if (outsize < 0) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - } - - if (MPI_DATATYPE_NULL == datatype) { + } else if (MPI_DATATYPE_NULL == datatype) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME); } } @@ -81,6 +73,5 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype, * OBJ_RELEASE. */ OBJ_RELEASE(local_convertor); - OMPI_ERRHANDLER_RETURN(rc, comm, MPI_ERR_UNKNOWN, FUNC_NAME); } diff --git a/src/mpi/c/pack_external.c b/src/mpi/c/pack_external.c index e597904b71..206cbcc9f0 100644 --- a/src/mpi/c/pack_external.c +++ b/src/mpi/c/pack_external.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Pack_external = PMPI_Pack_external @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Pack_external"; + + int MPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, - MPI_Aint outsize, MPI_Aint *position) { - return MPI_SUCCESS; + MPI_Aint outsize, MPI_Aint *position) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/pack_external_size.c b/src/mpi/c/pack_external_size.c index 490d6c99ef..20c2da965d 100644 --- a/src/mpi/c/pack_external_size.c +++ b/src/mpi/c/pack_external_size.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Pack_external_size = PMPI_Pack_external_size @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Pack_external_size"; + + int MPI_Pack_external_size(char *datarep, int incount, - MPI_Datatype datatype, MPI_Aint *size) { - return MPI_SUCCESS; + MPI_Datatype datatype, MPI_Aint *size) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/pack_size.c b/src/mpi/c/pack_size.c index ab0dff9ffe..1052d092cd 100644 --- a/src/mpi/c/pack_size.c +++ b/src/mpi/c/pack_size.c @@ -28,15 +28,12 @@ int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, ompi_convertor_t *local_convertor; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_COMM_NULL == comm) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } - - if (NULL == size) { + } else if (NULL == size) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); - } - - if (MPI_DATATYPE_NULL == datatype) { + } else if (MPI_DATATYPE_NULL == datatype) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME); } } diff --git a/src/mpi/c/pcontrol.c b/src/mpi/c/pcontrol.c index 6a7ec46687..45b49ee849 100644 --- a/src/mpi/c/pcontrol.c +++ b/src/mpi/c/pcontrol.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Pcontrol = PMPI_Pcontrol @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Pcontrol(const int level, ...) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Pcontrol"; + + +int MPI_Pcontrol(const int level, ...) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/probe.c b/src/mpi/c/probe.c index 7847ae9c0c..b16be1e688 100644 --- a/src/mpi/c/probe.c +++ b/src/mpi/c/probe.c @@ -17,6 +17,9 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Probe"; + + int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) { int rc; @@ -29,12 +32,11 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) } return MPI_SUCCESS; } - + if ( MPI_PARAM_CHECK ) { rc = MPI_SUCCESS; - if ( OMPI_MPI_INVALID_STATE ) { - rc = MPI_ERR_INTERN; - } else if (tag < 0 || tag > MPI_TAG_UB_VALUE) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (tag < 0 || tag > MPI_TAG_UB_VALUE) { rc = MPI_ERR_TAG; } else if (ompi_comm_invalid(comm)) { rc = MPI_ERR_COMM; @@ -43,8 +45,7 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) } OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Probe"); } - + rc = mca_pml.pml_probe(source, tag, comm, status); OMPI_ERRHANDLER_RETURN(rc, comm, rc, "MPI_Probe"); } - diff --git a/src/mpi/c/publish_name.c b/src/mpi/c/publish_name.c index 4e903722f1..4472ace67e 100644 --- a/src/mpi/c/publish_name.c +++ b/src/mpi/c/publish_name.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Publish_name"; +static const char FUNC_NAME[] = "MPI_Publish_name"; int MPI_Publish_name(char *service_name, MPI_Info info, @@ -29,12 +29,14 @@ int MPI_Publish_name(char *service_name, MPI_Info info, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == port_name ) + if ( NULL == port_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == service_name ) + } + if ( NULL == service_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } /* diff --git a/src/mpi/c/put.c b/src/mpi/c/put.c index b29cb22630..fbaf31e93a 100644 --- a/src/mpi/c/put.c +++ b/src/mpi/c/put.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Put = PMPI_Put @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Put"; + + int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, - MPI_Datatype target_datatype, MPI_Win win) { - return MPI_SUCCESS; + MPI_Datatype target_datatype, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/query_thread.c b/src/mpi/c/query_thread.c index cd570014fa..9603202e2b 100644 --- a/src/mpi/c/query_thread.c +++ b/src/mpi/c/query_thread.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Query_thread = PMPI_Query_thread @@ -15,6 +17,20 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Query_thread(int *provided) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Query_thread"; + + +int MPI_Query_thread(int *provided) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == provided) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* Simple */ + + *provided = ompi_mpi_thread_provided; + return MPI_SUCCESS; } diff --git a/src/mpi/c/reduce.c b/src/mpi/c/reduce.c index b37d438693..6fc7920997 100644 --- a/src/mpi/c/reduce.c +++ b/src/mpi/c/reduce.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Reduce"; +static const char FUNC_NAME[] = "MPI_Reduce"; int MPI_Reduce(void *sendbuf, void *recvbuf, int count, diff --git a/src/mpi/c/reduce_scatter.c b/src/mpi/c/reduce_scatter.c index c22c097445..d785ad2b9b 100644 --- a/src/mpi/c/reduce_scatter.c +++ b/src/mpi/c/reduce_scatter.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Reduce_scatter"; +static const char FUNC_NAME[] = "MPI_Reduce_scatter"; int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, diff --git a/src/mpi/c/register_datarep.c b/src/mpi/c/register_datarep.c index 04da55d16e..ef7a38bf63 100644 --- a/src/mpi/c/register_datarep.c +++ b/src/mpi/c/register_datarep.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Register_datarep = PMPI_Register_datarep @@ -15,10 +17,20 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Register_datarep"; + + int MPI_Register_datarep(char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, - void *extra_state) { - return MPI_SUCCESS; + void *extra_state) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/request_c2f.c b/src/mpi/c/request_c2f.c index 169e436603..32d3d3f3d2 100644 --- a/src/mpi/c/request_c2f.c +++ b/src/mpi/c/request_c2f.c @@ -18,17 +18,21 @@ #include "mpi/c/profile/defines.h" #endif -MPI_Fint MPI_Request_c2f(MPI_Request request) { +static const char FUNC_NAME[] = "MPI_Request_f2c"; + + +MPI_Fint MPI_Request_c2f(MPI_Request request) +{ /* local variables */ ompi_request_t *request_c; /* error checking */ if( MPI_PARAM_CHECK ) { - /* check for MPI_REQUEST_NULL */ + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( (NULL == request) ) { return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, - "MPI_Request_c2f"); + FUNC_NAME); } } diff --git a/src/mpi/c/request_f2c.c b/src/mpi/c/request_f2c.c index 8687c1261c..3615172b86 100644 --- a/src/mpi/c/request_f2c.c +++ b/src/mpi/c/request_f2c.c @@ -18,7 +18,11 @@ #include "mpi/c/profile/defines.h" #endif -MPI_Request MPI_Request_f2c(MPI_Fint request) { +static const char FUNC_NAME[] = "MPI_Request_f2c"; + + +MPI_Request MPI_Request_f2c(MPI_Fint request) +{ /* local variables */ ompi_request_t *request_c; size_t request_index; @@ -27,18 +31,18 @@ MPI_Request MPI_Request_f2c(MPI_Fint request) { /* Error checks */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (0 > request_index) { (void)OMPI_ERRHANDLER_INVOKE( MPI_COMM_WORLD, MPI_ERR_REQUEST, - "MPI_Request_f2c"); + FUNC_NAME); } } if (request_index >= ompi_req_f_to_c_table->size) { (void) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, - "MPI_Request_f2c - II"); + FUNC_NAME); return MPI_REQUEST_NULL; } request_c = ompi_req_f_to_c_table->addr[request_index]; - return (MPI_Request) request_c; } diff --git a/src/mpi/c/request_free.c b/src/mpi/c/request_free.c index 08b0c92671..74b31599e2 100644 --- a/src/mpi/c/request_free.c +++ b/src/mpi/c/request_free.c @@ -23,9 +23,12 @@ static const char FUNC_NAME[] = "MPI_Request_free"; int MPI_Request_free(MPI_Request *request) { int rc; - if( request == NULL ) { + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if( request == NULL ) { rc = OMPI_ERR_BAD_PARAM; goto error_return; + } } if( *request == NULL ) { return MPI_SUCCESS; diff --git a/src/mpi/c/request_get_status.c b/src/mpi/c/request_get_status.c index b363bef52b..c48c89e479 100644 --- a/src/mpi/c/request_get_status.c +++ b/src/mpi/c/request_get_status.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Request_get_status = PMPI_Request_get_status @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Request_get_status"; + + int MPI_Request_get_status(MPI_Request request, int *flag, - MPI_Status *status) { - return MPI_SUCCESS; + MPI_Status *status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/scan.c b/src/mpi/c/scan.c index 442e6874fc..63672dff4f 100644 --- a/src/mpi/c/scan.c +++ b/src/mpi/c/scan.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Scan"; +static const char FUNC_NAME[] = "MPI_Scan"; int MPI_Scan(void *sendbuf, void *recvbuf, int count, diff --git a/src/mpi/c/scatter.c b/src/mpi/c/scatter.c index b373c6b734..5a77a9ef5d 100644 --- a/src/mpi/c/scatter.c +++ b/src/mpi/c/scatter.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Scatter"; +static const char FUNC_NAME[] = "MPI_Scatter"; int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, diff --git a/src/mpi/c/scatterv.c b/src/mpi/c/scatterv.c index f6fb59f86c..ad6db3524a 100644 --- a/src/mpi/c/scatterv.c +++ b/src/mpi/c/scatterv.c @@ -18,7 +18,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Scatterv"; +static const char FUNC_NAME[] = "MPI_Scatterv"; int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, diff --git a/src/mpi/c/sendrecv_replace.c b/src/mpi/c/sendrecv_replace.c index 7db31a1212..c12b84f980 100644 --- a/src/mpi/c/sendrecv_replace.c +++ b/src/mpi/c/sendrecv_replace.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Sendrecv_replace = PMPI_Sendrecv_replace @@ -15,9 +17,19 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Sendrecv_replace"; + + int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status *status) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/start.c b/src/mpi/c/start.c index aeda0a2ba4..096939de4a 100644 --- a/src/mpi/c/start.c +++ b/src/mpi/c/start.c @@ -18,18 +18,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Start"; + + int MPI_Start(MPI_Request *request) { if ( MPI_PARAM_CHECK ) { int rc = MPI_SUCCESS; - if (ompi_mpi_finalized) { - rc = MPI_ERR_INTERN; - } else if (request == NULL || *request == NULL) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (request == NULL) { rc = MPI_ERR_REQUEST; } - if (rc != MPI_SUCCESS) { - return rc; - } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); } return mca_pml.pml_start(1, request); } diff --git a/src/mpi/c/startall.c b/src/mpi/c/startall.c index 1210d88fc3..a3091fa99d 100644 --- a/src/mpi/c/startall.c +++ b/src/mpi/c/startall.c @@ -18,19 +18,20 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Startall"; + int MPI_Startall(int count, MPI_Request *requests) { if ( MPI_PARAM_CHECK ) { int rc = MPI_SUCCESS; - if (ompi_mpi_finalized) { - rc = MPI_ERR_INTERN; - } else if (requests == NULL) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == requests) { rc = MPI_ERR_REQUEST; + } else if (count < 0) { + rc = MPI_ERR_ARG; } - if (rc != MPI_SUCCESS) { - return rc; - } + OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME); } return mca_pml.pml_start(count, requests); } diff --git a/src/mpi/c/status_c2f.c b/src/mpi/c/status_c2f.c index 771f95d268..5970056e44 100644 --- a/src/mpi/c/status_c2f.c +++ b/src/mpi/c/status_c2f.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Status_c2f = PMPI_Status_c2f @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Status_c2f"; + + +int MPI_Status_c2f(MPI_Status *c_status, MPI_Fint *f_status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/status_f2c.c b/src/mpi/c/status_f2c.c index d00747e0e7..ada9ca36fe 100644 --- a/src/mpi/c/status_f2c.c +++ b/src/mpi/c/status_f2c.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Status_f2c = PMPI_Status_f2c @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Status_f2c"; + + +int MPI_Status_f2c(MPI_Fint *f_status, MPI_Status *c_status) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/status_set_cancelled.c b/src/mpi/c/status_set_cancelled.c index 094a7a920e..30cf9c71bb 100644 --- a/src/mpi/c/status_set_cancelled.c +++ b/src/mpi/c/status_set_cancelled.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Status_set_cancelled = PMPI_Status_set_cancelled @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Status_set_cancelled(MPI_Status *status, int flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Status_set_cancelled"; + + +int MPI_Status_set_cancelled(MPI_Status *status, int flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/status_set_elements.c b/src/mpi/c/status_set_elements.c index bd09ac7604..814b1ee598 100644 --- a/src/mpi/c/status_set_elements.c +++ b/src/mpi/c/status_set_elements.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Status_set_elements = PMPI_Status_set_elements @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Status_set_elements"; + + int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype *datatype, - int count) { - return MPI_SUCCESS; + int count) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/test_cancelled.c b/src/mpi/c/test_cancelled.c index 322aa3b79e..444c9a2e77 100644 --- a/src/mpi/c/test_cancelled.c +++ b/src/mpi/c/test_cancelled.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Test_cancelled = PMPI_Test_cancelled @@ -15,7 +17,22 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Test_cancelled(MPI_Status *status, int *flag) { - *flag = 0; - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Test_cancelled"; + + +int MPI_Test_cancelled(MPI_Status *status, int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == flag || NULL == status) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* JMS clearly something else needs to be done here... */ + *flag = 0; + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/testall.c b/src/mpi/c/testall.c index 87a16909f1..86efbc3f7d 100644 --- a/src/mpi/c/testall.c +++ b/src/mpi/c/testall.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Testall = PMPI_Testall @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Testall"; + + int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, MPI_Status array_of_statuses[]) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/topo_test.c b/src/mpi/c/topo_test.c index c6aea34383..ceecf81cb4 100644 --- a/src/mpi/c/topo_test.c +++ b/src/mpi/c/topo_test.c @@ -17,29 +17,28 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Topo_test"; + + int MPI_Topo_test(MPI_Comm comm, int *status) { - if ( MPI_PARAM_CHECK ) { - if ( ompi_mpi_finalized ) - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Topo_test"); - - if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm)) + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid (comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Topo_test"); - - if ( NULL == status ) - return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, - "MPI_Topo_test"); + FUNC_NAME); + } else if ( NULL == status ) { + return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); + } } - if ( comm->c_flags & OMPI_COMM_CART ) + if ( comm->c_flags & OMPI_COMM_CART ) { *status = MPI_CART; - else if ( comm->c_flags & OMPI_COMM_GRAPH ) + } else if ( comm->c_flags & OMPI_COMM_GRAPH ) { *status = MPI_GRAPH; - else + } else { *status = MPI_UNDEFINED; + } return MPI_SUCCESS; } diff --git a/src/mpi/c/type_c2f.c b/src/mpi/c/type_c2f.c index 88e46345a4..c9e58daf85 100644 --- a/src/mpi/c/type_c2f.c +++ b/src/mpi/c/type_c2f.c @@ -7,6 +7,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" #include "datatype/datatype.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_c2f = PMPI_Type_c2f @@ -16,7 +18,20 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Type_c2f"; + + MPI_Fint MPI_Type_c2f(MPI_Datatype datatype) { - return (MPI_Fint)(datatype->d_f_to_c_index); + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == datatype || MPI_DATATYPE_NULL == datatype) { + return (MPI_Fint) + OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } + } + + /* Simple */ + + return (MPI_Fint)(datatype->d_f_to_c_index); } diff --git a/src/mpi/c/type_commit.c b/src/mpi/c/type_commit.c index 11a689d721..934e00721f 100644 --- a/src/mpi/c/type_commit.c +++ b/src/mpi/c/type_commit.c @@ -21,18 +21,18 @@ static const char FUNC_NAME[] = "MPI_Type_commit"; -int -MPI_Type_commit(MPI_Datatype *type) + +int MPI_Type_commit(MPI_Datatype *type) { - int rc; + int rc; - if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - } + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == *type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } + } - rc = ompi_ddt_commit( type ); - OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); + rc = ompi_ddt_commit( type ); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); } diff --git a/src/mpi/c/type_contiguous.c b/src/mpi/c/type_contiguous.c index 8674aef495..f71beffe79 100644 --- a/src/mpi/c/type_contiguous.c +++ b/src/mpi/c/type_contiguous.c @@ -21,21 +21,20 @@ static const char FUNC_NAME[] = "MPI_Type_contiguous"; -int -MPI_Type_contiguous(int count, - MPI_Datatype oldtype, - MPI_Datatype *newtype) + +int MPI_Type_contiguous(int count, + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (MPI_DATATYPE_NULL == oldtype || NULL == newtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if( count < 0 ) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, FUNC_NAME); } } diff --git a/src/mpi/c/type_create_darray.c b/src/mpi/c/type_create_darray.c index 27a6230c93..5ec048d9e9 100644 --- a/src/mpi/c/type_create_darray.c +++ b/src/mpi/c/type_create_darray.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_create_darray = PMPI_Type_create_darray @@ -15,17 +17,26 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_create_darray(int size, - int rank, - int ndims, - int gsize_array[], - int distrib_array[], - int darg_array[], - int psize_array[], - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_create_darray"; + + +int MPI_Type_create_darray(int size, + int rank, + int ndims, + int gsize_array[], + int distrib_array[], + int darg_array[], + int psize_array[], + int order, + MPI_Datatype oldtype, + MPI_Datatype *newtype) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_create_f90_complex.c b/src/mpi/c/type_create_f90_complex.c index 32a519b6d2..05b6437114 100644 --- a/src/mpi/c/type_create_f90_complex.c +++ b/src/mpi/c/type_create_f90_complex.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_create_f90_complex = PMPI_Type_create_f90_complex @@ -15,8 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_create_f90_complex"; + + +int MPI_Type_create_f90_complex(int p, int r, MPI_Datatype *newtype) { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_create_f90_integer.c b/src/mpi/c/type_create_f90_integer.c index 639d83242c..c220a720f8 100644 --- a/src/mpi/c/type_create_f90_integer.c +++ b/src/mpi/c/type_create_f90_integer.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_create_f90_integer = PMPI_Type_create_f90_integer @@ -15,8 +17,17 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_create_f90_integer"; + + +int MPI_Type_create_f90_integer(int r, MPI_Datatype *newtype) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_create_f90_real.c b/src/mpi/c/type_create_f90_real.c index aae6b80294..1894b101f6 100644 --- a/src/mpi/c/type_create_f90_real.c +++ b/src/mpi/c/type_create_f90_real.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_create_f90_real = PMPI_Type_create_f90_real @@ -15,8 +17,17 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_create_f90_real"; + + +int MPI_Type_create_f90_real(int p, int r, MPI_Datatype *newtype) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_create_hindexed.c b/src/mpi/c/type_create_hindexed.c index cc9031fe3a..b73ecafb51 100644 --- a/src/mpi/c/type_create_hindexed.c +++ b/src/mpi/c/type_create_hindexed.c @@ -21,28 +21,33 @@ static const char FUNC_NAME[] = "MPI_Type_create_hindexed"; -int -MPI_Type_create_hindexed(int count, - int array_of_blocklengths[], - MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) + +int MPI_Type_create_hindexed(int count, + int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc, i; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME); + } else if (NULL == array_of_blocklengths || + NULL == array_of_displacements) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); + } else if (MPI_DATATYPE_NULL == oldtype || NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME); } - for( i = 0; i < count; i++ ) { - if(array_of_blocklengths[i] < 0) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME ); + for ( i = 0; i < count; i++ ) { + if (array_of_blocklengths[i] < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); } } } diff --git a/src/mpi/c/type_create_hvector.c b/src/mpi/c/type_create_hvector.c index 65a6500f35..fcb98d81a7 100644 --- a/src/mpi/c/type_create_hvector.c +++ b/src/mpi/c/type_create_hvector.c @@ -21,31 +21,32 @@ static const char FUNC_NAME[] = "MPI_Type_create_hvector"; -int -MPI_Type_create_hvector(int count, - int blocklength, - MPI_Aint stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) + +int MPI_Type_create_hvector(int count, + int blocklength, + MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); - } - if( blocklength < 0) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME ); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME ); + } else if( blocklength < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } else if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); } } - rc = ompi_ddt_create_hvector ( count, blocklength, stride, oldtype, newtype ); + rc = ompi_ddt_create_hvector ( count, blocklength, stride, oldtype, + newtype ); OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); { diff --git a/src/mpi/c/type_create_indexed_block.c b/src/mpi/c/type_create_indexed_block.c index 68820fb3ec..e420c9243b 100644 --- a/src/mpi/c/type_create_indexed_block.c +++ b/src/mpi/c/type_create_indexed_block.c @@ -21,27 +21,27 @@ static const char FUNC_NAME[] = "MPI_Type_create_indexed_block"; -int -MPI_Type_create_indexed_block(int count, - int blocklength, - int array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) + +int MPI_Type_create_indexed_block(int count, + int blocklength, + int array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); - } - if( blocklength < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME ); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME); + } else if( blocklength < 0 || NULL == array_of_displacements) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } else if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); } } rc = ompi_ddt_create_indexed_block( count, blocklength, array_of_displacements, diff --git a/src/mpi/c/type_create_keyval.c b/src/mpi/c/type_create_keyval.c index c98ab52f44..53828804b2 100644 --- a/src/mpi/c/type_create_keyval.c +++ b/src/mpi/c/type_create_keyval.c @@ -18,17 +18,18 @@ static const char FUNC_NAME[] = "MPI_Type_create_keyval"; -int -MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, - MPI_Type_delete_attr_function *type_delete_attr_fn, - int *type_keyval, - void *extra_state) + +int MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, + MPI_Type_delete_attr_function *type_delete_attr_fn, + int *type_keyval, + void *extra_state) { int ret; ompi_attribute_fn_ptr_union_t copy_fn; ompi_attribute_fn_ptr_union_t del_fn; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == type_copy_attr_fn) || (NULL == type_delete_attr_fn) || (NULL == type_keyval)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, @@ -42,9 +43,7 @@ MPI_Type_create_keyval(MPI_Type_copy_attr_function *type_copy_attr_fn, ret = ompi_attr_create_keyval(TYPE_ATTR, copy_fn, del_fn, type_keyval, extra_state, 0); - - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, - MPI_ERR_OTHER, FUNC_NAME); + OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, ret, FUNC_NAME); } diff --git a/src/mpi/c/type_create_resized.c b/src/mpi/c/type_create_resized.c index 7eef0407ff..1b78a5c071 100644 --- a/src/mpi/c/type_create_resized.c +++ b/src/mpi/c/type_create_resized.c @@ -21,18 +21,20 @@ static const char FUNC_NAME[] = "MPI_Type_create_resized"; -int -MPI_Type_create_resized(MPI_Datatype oldtype, - MPI_Aint lb, - MPI_Aint extent, - MPI_Datatype *newtype) + +int MPI_Type_create_resized(MPI_Datatype oldtype, + MPI_Aint lb, + MPI_Aint extent, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); } } diff --git a/src/mpi/c/type_create_struct.c b/src/mpi/c/type_create_struct.c index a5449135dc..948aecd744 100644 --- a/src/mpi/c/type_create_struct.c +++ b/src/mpi/c/type_create_struct.c @@ -21,28 +21,35 @@ static const char FUNC_NAME[] = "MPI_Type_create_struct"; -int -MPI_Type_create_struct(int count, - int array_of_blocklengths[], - MPI_Aint array_of_displacements[], - MPI_Datatype array_of_types[], - MPI_Datatype *newtype) + +int MPI_Type_create_struct(int count, + int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype) { int i, rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME); + } else if(NULL == array_of_blocklengths || + NULL == array_of_displacements || + NULL == array_of_types) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } else if (NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); } for ( i = 0; i < count; i++ ){ - if(array_of_blocklengths[i] < 0) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME ); + if (NULL == array_of_types[i] || + MPI_DATATYPE_NULL == array_of_types[i]) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME); + } else if (array_of_blocklengths[i] < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); } } } diff --git a/src/mpi/c/type_create_subarray.c b/src/mpi/c/type_create_subarray.c index 3428e526b4..ea2ed16334 100644 --- a/src/mpi/c/type_create_subarray.c +++ b/src/mpi/c/type_create_subarray.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_create_subarray = PMPI_Type_create_subarray @@ -15,14 +17,23 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_create_subarray(int ndims, - int size_array[], - int subsize_array[], - int start_array[], - int order, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_create_subarray"; + + +int MPI_Type_create_subarray(int ndims, + int size_array[], + int subsize_array[], + int start_array[], + int order, + MPI_Datatype oldtype, + MPI_Datatype *newtype) + { - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_delete_attr.c b/src/mpi/c/type_delete_attr.c index d7b5e7181a..fb037a895b 100644 --- a/src/mpi/c/type_delete_attr.c +++ b/src/mpi/c/type_delete_attr.c @@ -18,13 +18,14 @@ static const char FUNC_NAME[] = "MPI_Type_delete_attr"; -int -MPI_Type_delete_attr (MPI_Datatype type, int type_keyval) + +int MPI_Type_delete_attr (MPI_Datatype type, int type_keyval) { int ret; if (MPI_PARAM_CHECK) { - if (MPI_DATATYPE_NULL == type) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); @@ -32,7 +33,6 @@ MPI_Type_delete_attr (MPI_Datatype type, int type_keyval) } ret = ompi_attr_delete(TYPE_ATTR, type, type->d_keyhash, type_keyval, 0); - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_dup.c b/src/mpi/c/type_dup.c index e27bb58051..5f76ae0beb 100644 --- a/src/mpi/c/type_dup.c +++ b/src/mpi/c/type_dup.c @@ -21,16 +21,18 @@ static const char FUNC_NAME[] = "MPI_Type_dup"; -int -MPI_Type_dup (MPI_Datatype type, - MPI_Datatype *newtype) + +int MPI_Type_dup (MPI_Datatype type, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); } } @@ -42,6 +44,5 @@ MPI_Type_dup (MPI_Datatype type, } ompi_ddt_set_args( *newtype, 0, NULL, 0, NULL, 1, &type, MPI_COMBINER_DUP ); - return MPI_SUCCESS; } diff --git a/src/mpi/c/type_extent.c b/src/mpi/c/type_extent.c index 48e850034d..aa4f10c360 100644 --- a/src/mpi/c/type_extent.c +++ b/src/mpi/c/type_extent.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_extent = PMPI_Type_extent @@ -15,10 +17,23 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) -{ - MPI_Aint lb; +static const char FUNC_NAME[] = "MPI_Type_extent"; - return MPI_Type_get_extent(type, &lb, extent); + +int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) +{ + int rc; + MPI_Aint lb; + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == extent) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + rc = ompi_ddt_get_extent( type, &lb, extent ); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); } diff --git a/src/mpi/c/type_f2c.c b/src/mpi/c/type_f2c.c index 88e2939955..1c0a45ab91 100644 --- a/src/mpi/c/type_f2c.c +++ b/src/mpi/c/type_f2c.c @@ -18,10 +18,14 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Type_f2c"; + + MPI_Datatype MPI_Type_f2c(MPI_Fint datatype) { /* check the arguments */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (0 > datatype || datatype >= ompi_pointer_array_get_size(ompi_datatype_f_to_c_table)) { return MPI_DATATYPE_NULL; } diff --git a/src/mpi/c/type_free.c b/src/mpi/c/type_free.c index 9b892a6695..4ec9dd919c 100644 --- a/src/mpi/c/type_free.c +++ b/src/mpi/c/type_free.c @@ -21,15 +21,16 @@ static const char FUNC_NAME[] = "MPI_Type_free"; -int -MPI_Type_free(MPI_Datatype *type) + +int MPI_Type_free(MPI_Datatype *type) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || NULL == *type || MPI_DATATYPE_NULL == *type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); } } diff --git a/src/mpi/c/type_free_keyval.c b/src/mpi/c/type_free_keyval.c index 2b4e0f9d8c..c3c7f16918 100644 --- a/src/mpi/c/type_free_keyval.c +++ b/src/mpi/c/type_free_keyval.c @@ -18,14 +18,15 @@ static const char FUNC_NAME[] = "MPI_Type_free_keyval"; -int -MPI_Type_free_keyval(int *type_keyval) + +int MPI_Type_free_keyval(int *type_keyval) { int ret; /* Check for valid key pointer */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == type_keyval) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, diff --git a/src/mpi/c/type_get_attr.c b/src/mpi/c/type_get_attr.c index daffaaa8e3..55e100a9a6 100644 --- a/src/mpi/c/type_get_attr.c +++ b/src/mpi/c/type_get_attr.c @@ -18,25 +18,28 @@ static const char FUNC_NAME[] = "MPI_Type_get_attr"; -int -MPI_Type_get_attr (MPI_Datatype type, - int type_keyval, - void *attribute_val, - int *flag) + +int MPI_Type_get_attr (MPI_Datatype type, + int type_keyval, + void *attribute_val, + int *flag) { int ret; if (MPI_PARAM_CHECK) { - if ((NULL == attribute_val) || (NULL == flag)) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - MPI_ERR_ARG, - FUNC_NAME); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if ((NULL == attribute_val) || (NULL == flag)) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, + MPI_ERR_ARG, + FUNC_NAME); } } ret = ompi_attr_get(type->d_keyhash, type_keyval, - attribute_val, flag); - + attribute_val, flag); OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, - MPI_ERR_OTHER, FUNC_NAME); + MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/type_get_contents.c b/src/mpi/c/type_get_contents.c index 46bc78a880..7ba9394057 100644 --- a/src/mpi/c/type_get_contents.c +++ b/src/mpi/c/type_get_contents.c @@ -21,21 +21,26 @@ static const char FUNC_NAME[] = "MPI_Type_get_contents"; -int -MPI_Type_get_contents(MPI_Datatype mtype, - int max_integers, - int max_addresses, - int max_datatypes, - int array_of_integers[], - MPI_Aint array_of_addresses[], - MPI_Datatype array_of_datatypes[]) + +int MPI_Type_get_contents(MPI_Datatype mtype, + int max_integers, + int max_addresses, + int max_datatypes, + int array_of_integers[], + MPI_Aint array_of_addresses[], + MPI_Datatype array_of_datatypes[]) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == mtype || MPI_DATATYPE_NULL == mtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == array_of_integers || NULL == array_of_addresses || + NULL == array_of_datatypes) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); } } @@ -47,6 +52,9 @@ MPI_Type_get_contents(MPI_Datatype mtype, MPI_ERR_INTERN, FUNC_NAME ); } - /* TODO: we have to return a copy of the datatypes not the original datatypes */ - return MPI_SUCCESS; + /* TODO: we have to return a copy of the datatypes not the original + datatypes */ + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/type_get_envelope.c b/src/mpi/c/type_get_envelope.c index c67de6f410..cd6ada7546 100644 --- a/src/mpi/c/type_get_envelope.c +++ b/src/mpi/c/type_get_envelope.c @@ -21,24 +21,28 @@ static const char FUNC_NAME[] = "MPI_Type_get_envelope"; -int -MPI_Type_get_envelope(MPI_Datatype type, - int *num_integers, - int *num_addresses, - int *num_datatypes, - int *combiner) + +int MPI_Type_get_envelope(MPI_Datatype type, + int *num_integers, + int *num_addresses, + int *num_datatypes, + int *combiner) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == num_integers || NULL == num_addresses || + NULL == num_datatypes || NULL == combiner) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); } } - rc = ompi_ddt_get_args( type, 0, num_integers, NULL, num_addresses, NULL, num_datatypes, - NULL, combiner ); - + rc = ompi_ddt_get_args( type, 0, num_integers, NULL, num_addresses, NULL, + num_datatypes, NULL, combiner ); OMPI_ERRHANDLER_RETURN( rc, MPI_COMM_WORLD, rc, FUNC_NAME ); } diff --git a/src/mpi/c/type_get_extent.c b/src/mpi/c/type_get_extent.c index 95fba1c6f9..b1a7e7ebd8 100644 --- a/src/mpi/c/type_get_extent.c +++ b/src/mpi/c/type_get_extent.c @@ -21,18 +21,20 @@ static const char FUNC_NAME[] = "MPI_Type_get_extent"; -int -MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent) + +int MPI_Type_get_extent(MPI_Datatype type, MPI_Aint *lb, MPI_Aint *extent) { - int rc; + int rc; + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == lb || NULL == extent) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } - if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - } - - rc = ompi_ddt_get_extent( type, lb, extent ); - OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); + rc = ompi_ddt_get_extent( type, lb, extent ); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); } diff --git a/src/mpi/c/type_get_name.c b/src/mpi/c/type_get_name.c index db5912408b..7621e38e83 100644 --- a/src/mpi/c/type_get_name.c +++ b/src/mpi/c/type_get_name.c @@ -4,10 +4,13 @@ #include "ompi_config.h" +#include + #include "mpi.h" #include "mpi/c/bindings.h" -#include #include "datatype/datatype.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_get_name = PMPI_Type_get_name @@ -17,9 +20,24 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen) +static const char FUNC_NAME[] = "MPI_Type_get_name"; + + +int MPI_Type_get_name(MPI_Datatype type, char *type_name, int *resultlen) { + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == type_name || NULL == resultlen) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + } + + /* Simple */ + *resultlen = strlen(type->name); strncpy( type_name, type->name, *resultlen ); return MPI_SUCCESS; diff --git a/src/mpi/c/type_get_true_extent.c b/src/mpi/c/type_get_true_extent.c index 1750926270..817f789077 100644 --- a/src/mpi/c/type_get_true_extent.c +++ b/src/mpi/c/type_get_true_extent.c @@ -21,17 +21,21 @@ static const char FUNC_NAME[] = "MPI_Type_get_true_extent"; -int -MPI_Type_get_true_extent(MPI_Datatype datatype, - MPI_Aint *true_lb, - MPI_Aint *true_extent) + +int MPI_Type_get_true_extent(MPI_Datatype datatype, + MPI_Aint *true_lb, + MPI_Aint *true_extent) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == datatype || MPI_DATATYPE_NULL == datatype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (NULL == true_lb || NULL == true_extent) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); } } diff --git a/src/mpi/c/type_hindexed.c b/src/mpi/c/type_hindexed.c index 6a811b80d6..0c8d2a301b 100644 --- a/src/mpi/c/type_hindexed.c +++ b/src/mpi/c/type_hindexed.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_hindexed = PMPI_Type_hindexed @@ -15,16 +17,42 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_hindexed(int count, - int array_of_blocklengths[], - MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_hindexed"; + + +int MPI_Type_hindexed(int count, + int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype) { - return MPI_Type_create_hindexed(count, - array_of_blocklengths, - array_of_displacements, - oldtype, - newtype); + int i; + + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (count < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME ); + } else if (NULL == array_of_blocklengths || + NULL == array_of_displacements) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + for (i = 0; i < count; ++i) { + if (array_of_blocklengths[i] < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + } + } + + return MPI_Type_create_hindexed(count, + array_of_blocklengths, + array_of_displacements, + oldtype, + newtype); } diff --git a/src/mpi/c/type_hvector.c b/src/mpi/c/type_hvector.c index a324d1f993..1ac0e19dbe 100644 --- a/src/mpi/c/type_hvector.c +++ b/src/mpi/c/type_hvector.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_hvector = PMPI_Type_hvector @@ -15,16 +17,33 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_hvector(int count, - int blocklength, - MPI_Aint stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_hvector"; + + +int MPI_Type_hvector(int count, + int blocklength, + MPI_Aint stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype) { - return MPI_Type_create_hvector(count, - blocklength, - stride, - oldtype, - newtype); + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (count < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME ); + } else if (blocklength < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + } + + return MPI_Type_create_hvector(count, + blocklength, + stride, + oldtype, + newtype); } diff --git a/src/mpi/c/type_indexed.c b/src/mpi/c/type_indexed.c index 21079f2316..dec1b103b3 100644 --- a/src/mpi/c/type_indexed.c +++ b/src/mpi/c/type_indexed.c @@ -21,28 +21,32 @@ static const char FUNC_NAME[] = "MPI_Type_indexed"; -int -MPI_Type_indexed(int count, - int array_of_blocklengths[], - int array_of_displacements[], - MPI_Datatype oldtype, - MPI_Datatype *newtype) +int MPI_Type_indexed(int count, + int array_of_blocklengths[], + int array_of_displacements[], + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc, i; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - if( count < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, - MPI_ERR_COUNT, FUNC_NAME ); + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME); + } else if( count < 0 ) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME); + } else if (NULL == array_of_blocklengths || + NULL == array_of_displacements) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); } for( i = 0; i < count; i++ ) { if( array_of_blocklengths[i] < 0 ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, - MPI_ERR_ARG, FUNC_NAME ); + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME); } } } diff --git a/src/mpi/c/type_lb.c b/src/mpi/c/type_lb.c index 9722e7ead9..b0ee52f397 100644 --- a/src/mpi/c/type_lb.c +++ b/src/mpi/c/type_lb.c @@ -6,6 +6,9 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "datatype/datatype.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_lb = PMPI_Type_lb @@ -15,10 +18,23 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) -{ - MPI_Aint extent; +static const char FUNC_NAME[] = "MPI_Type_lb"; - return MPI_Type_get_extent(type, lb, &extent); + +int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) +{ + int rc; + MPI_Aint extent; + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == lb) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + rc = ompi_ddt_get_extent( type, lb, &extent ); + OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME ); } diff --git a/src/mpi/c/type_match_size.c b/src/mpi/c/type_match_size.c index 5dd3a0c8d9..c5f1de14b0 100644 --- a/src/mpi/c/type_match_size.c +++ b/src/mpi/c/type_match_size.c @@ -21,9 +21,14 @@ static const char FUNC_NAME[] = "MPI_Type_match_size"; -int -MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type) + +int MPI_Type_match_size(int typeclass, int size, MPI_Datatype *type) { - /* TODO */ - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/type_set_attr.c b/src/mpi/c/type_set_attr.c index aad02e5f44..44c94ef1ca 100644 --- a/src/mpi/c/type_set_attr.c +++ b/src/mpi/c/type_set_attr.c @@ -18,20 +18,21 @@ static const char FUNC_NAME[] = "MPI_Type_set_attr"; -int -MPI_Type_set_attr (MPI_Datatype type, - int type_keyval, - void *attribute_val) + +int MPI_Type_set_attr (MPI_Datatype type, + int type_keyval, + void *attribute_val) { int ret; - if (MPI_PARAM_CHECK) { - if (MPI_DATATYPE_NULL == type) { - return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, - MPI_ERR_TYPE, - FUNC_NAME); - } + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == attribute_val) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } + } ret = ompi_attr_set(TYPE_ATTR, type, type->d_keyhash, type_keyval, attribute_val, 0); diff --git a/src/mpi/c/type_set_name.c b/src/mpi/c/type_set_name.c index 94570dd99e..2f866cc6d7 100644 --- a/src/mpi/c/type_set_name.c +++ b/src/mpi/c/type_set_name.c @@ -4,10 +4,13 @@ #include "ompi_config.h" +#include + #include "mpi.h" #include "mpi/c/bindings.h" -#include #include "datatype/datatype.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_set_name = PMPI_Type_set_name @@ -17,18 +20,27 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_set_name (MPI_Datatype type, char *type_name) -{ - int length; +static const char FUNC_NAME[] = "MPI_Type_set_name"; - /* TODO in C the maximum length is MPI_MAX_OBJECT_NAME - 1 - * when in FORTRAN is MPI_MAX_OBJECT_NAME - */ - length = strlen( type_name ); - if( length >= MPI_MAX_OBJECT_NAME ) - length = MPI_MAX_OBJECT_NAME - 1; - strncpy( type->name, type_name, length ); - type->name[length + 1] = '\0'; - return MPI_SUCCESS; + +int MPI_Type_set_name (MPI_Datatype type, char *type_name) +{ + int length; + + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == type_name) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + length = strlen( type_name ); + if( length >= MPI_MAX_OBJECT_NAME ) { + length = MPI_MAX_OBJECT_NAME - 1; + } + strncpy( type->name, type_name, length ); + type->name[length + 1] = '\0'; + return MPI_SUCCESS; } diff --git a/src/mpi/c/type_size.c b/src/mpi/c/type_size.c index af646123bc..f3d9d97a24 100644 --- a/src/mpi/c/type_size.c +++ b/src/mpi/c/type_size.c @@ -20,13 +20,20 @@ static const char FUNC_NAME[] = "MPI_Type_size"; -int -MPI_Type_size(MPI_Datatype type, int *size) + +int MPI_Type_size(MPI_Datatype type, int *size) { - if( type == MPI_DATATYPE_NULL ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_TYPE, MPI_COMM_WORLD, - MPI_ERR_TYPE, FUNC_NAME ); - } - *size = type->size; - return MPI_SUCCESS; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == type || MPI_DATATYPE_NULL == type) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == size) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } + } + + /* Simple */ + + *size = type->size; + return MPI_SUCCESS; } diff --git a/src/mpi/c/type_struct.c b/src/mpi/c/type_struct.c index d5a92c63f9..7ac01841ee 100644 --- a/src/mpi/c/type_struct.c +++ b/src/mpi/c/type_struct.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_struct = PMPI_Type_struct @@ -15,16 +17,45 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_struct(int count, - int array_of_blocklengths[], - MPI_Aint array_of_displacements[], - MPI_Datatype array_of_types[], - MPI_Datatype *newtype) +static const char FUNC_NAME[] = "MPI_Type_struct"; + + +int MPI_Type_struct(int count, + int array_of_blocklengths[], + MPI_Aint array_of_displacements[], + MPI_Datatype array_of_types[], + MPI_Datatype *newtype) { - return MPI_Type_create_struct(count, - array_of_blocklengths, - array_of_displacements, - array_of_types, - newtype); + int i; + + if ( MPI_PARAM_CHECK ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == newtype || NULL == array_of_types) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (count < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT, + FUNC_NAME ); + } else if (NULL == array_of_blocklengths || + NULL == array_of_displacements) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + for (i = 0; i < count; ++i) { + if (NULL == array_of_types[i] || + MPI_DATATYPE_NULL == array_of_types[i]) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if (array_of_blocklengths[i] < 0) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, + FUNC_NAME ); + } + } + } + + return MPI_Type_create_struct(count, + array_of_blocklengths, + array_of_displacements, + array_of_types, + newtype); } diff --git a/src/mpi/c/type_ub.c b/src/mpi/c/type_ub.c index 9d83974031..85e1f73377 100644 --- a/src/mpi/c/type_ub.c +++ b/src/mpi/c/type_ub.c @@ -6,6 +6,9 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "datatype/datatype.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Type_ub = PMPI_Type_ub @@ -15,17 +18,27 @@ #include "mpi/c/profile/defines.h" #endif -int -MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) +static const char FUNC_NAME[] = "MPI_Type_ub"; + + +int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) { - MPI_Aint lb; - MPI_Aint extent; - int status; + MPI_Aint lb; + MPI_Aint extent; + int status; - status = MPI_Type_get_extent(mtype, &lb, &extent); - if (MPI_SUCCESS == status) { - *ub = lb + extent; + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == mtype || MPI_DATATYPE_NULL == mtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME); + } else if (NULL == ub) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } + } - return status; + status = ompi_ddt_get_extent( mtype, &lb, &extent ); + if (MPI_SUCCESS == status) { + *ub = lb + extent; + } + OMPI_ERRHANDLER_RETURN(status, MPI_COMM_WORLD, status, FUNC_NAME); } diff --git a/src/mpi/c/type_vector.c b/src/mpi/c/type_vector.c index 70382f37bf..088baf6c22 100644 --- a/src/mpi/c/type_vector.c +++ b/src/mpi/c/type_vector.c @@ -21,25 +21,24 @@ static const char FUNC_NAME[] = "MPI_Type_vector"; -int -MPI_Type_vector(int count, - int blocklength, - int stride, - MPI_Datatype oldtype, - MPI_Datatype *newtype) +int MPI_Type_vector(int count, + int blocklength, + int stride, + MPI_Datatype oldtype, + MPI_Datatype *newtype) { int rc; if( MPI_PARAM_CHECK ) { - if( OMPI_MPI_INVALID_STATE ) { - OMPI_ERRHANDLER_RETURN( MPI_ERR_INTERN, MPI_COMM_WORLD, - MPI_ERR_INTERN, FUNC_NAME ); - } - if( count < 0 ) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype || + NULL == newtype) { + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, + FUNC_NAME ); + } else if( count < 0 ) { OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD, MPI_ERR_COUNT, FUNC_NAME ); - } - if( blocklength < 0) { + } else if( blocklength < 0) { OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME ); } diff --git a/src/mpi/c/unpack.c b/src/mpi/c/unpack.c index bb9512e864..153c50235c 100644 --- a/src/mpi/c/unpack.c +++ b/src/mpi/c/unpack.c @@ -31,9 +31,10 @@ int MPI_Unpack(void *inbuf, int insize, int *position, struct iovec outvec; if (MPI_PARAM_CHECK) { - if (MPI_COMM_NULL == comm) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_comm_invalid(comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, - "MPI_Unpack"); + FUNC_NAME); } if ((NULL == inbuf) || (NULL == outbuf) || (NULL == position)) { diff --git a/src/mpi/c/unpack_external.c b/src/mpi/c/unpack_external.c index 9f433848b0..29ff2580ee 100644 --- a/src/mpi/c/unpack_external.c +++ b/src/mpi/c/unpack_external.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Unpack_external = PMPI_Unpack_external @@ -15,8 +17,18 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Unpack_external "; + + int MPI_Unpack_external (char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, - MPI_Datatype datatype) { - return MPI_SUCCESS; + MPI_Datatype datatype) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/unpublish_name.c b/src/mpi/c/unpublish_name.c index a55b2da140..772342b902 100644 --- a/src/mpi/c/unpublish_name.c +++ b/src/mpi/c/unpublish_name.c @@ -19,7 +19,7 @@ #include "mpi/c/profile/defines.h" #endif -static char FUNC_NAME[] = "MPI_Unpublish_name"; +static const char FUNC_NAME[] = "MPI_Unpublish_name"; int MPI_Unpublish_name(char *service_name, MPI_Info info, @@ -30,12 +30,14 @@ int MPI_Unpublish_name(char *service_name, MPI_Info info, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == port_name ) + if ( NULL == port_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); - if ( NULL == service_name ) + } + if ( NULL == service_name ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); + } } /* diff --git a/src/mpi/c/win_c2f.c b/src/mpi/c/win_c2f.c index 56d6fae7a7..d9f3073a52 100644 --- a/src/mpi/c/win_c2f.c +++ b/src/mpi/c/win_c2f.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_c2f = PMPI_Win_c2f @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -MPI_Fint MPI_Win_c2f(MPI_Win win) { - return (MPI_Fint)0; +static const char FUNC_NAME[] = "MPI_Win_c2f"; + + +MPI_Fint MPI_Win_c2f(MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return (MPI_Fint) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_call_errhandler.c b/src/mpi/c/win_call_errhandler.c index 855e8f231a..337879df9b 100644 --- a/src/mpi/c/win_call_errhandler.c +++ b/src/mpi/c/win_call_errhandler.c @@ -18,19 +18,23 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_call_errhandler(MPI_Win win, int errorcode) { +static const char FUNC_NAME[] = "MPI_Win_call_errhandler"; + + +int MPI_Win_call_errhandler(MPI_Win win, int errorcode) +{ /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == win || MPI_WIN_NULL == win) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Win_call_errhandler"); + FUNC_NAME); } } /* Invoke the errhandler */ - return OMPI_ERRHANDLER_INVOKE(win, errorcode, - "MPI_Win_call_errhandler"); + return OMPI_ERRHANDLER_INVOKE(win, errorcode, FUNC_NAME); } diff --git a/src/mpi/c/win_complete.c b/src/mpi/c/win_complete.c index 056eeca896..552ccd427d 100644 --- a/src/mpi/c/win_complete.c +++ b/src/mpi/c/win_complete.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_complete = PMPI_Win_complete @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_complete(MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_complete"; + + +int MPI_Win_complete(MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_create.c b/src/mpi/c/win_create.c index 81d9930498..fc5353e1f3 100644 --- a/src/mpi/c/win_create.c +++ b/src/mpi/c/win_create.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_create = PMPI_Win_create @@ -15,7 +17,17 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Win_create"; + + int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, - MPI_Info info, MPI_Comm comm, MPI_Win *win) { - return MPI_SUCCESS; + MPI_Info info, MPI_Comm comm, MPI_Win *win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_create_errhandler.c b/src/mpi/c/win_create_errhandler.c index 90ee24ab6c..f0b88730c8 100644 --- a/src/mpi/c/win_create_errhandler.c +++ b/src/mpi/c/win_create_errhandler.c @@ -18,17 +18,22 @@ #include "mpi/c/profile/defines.h" #endif +static const char FUNC_NAME[] = "MPI_Win_create_errhandler"; + + int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, - MPI_Errhandler *errhandler) { + MPI_Errhandler *errhandler) +{ int err = MPI_SUCCESS; /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == function || NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Win_create_errhandler"); + FUNC_NAME); } } @@ -41,6 +46,5 @@ int MPI_Win_create_errhandler(MPI_Win_errhandler_fn *function, err = MPI_ERR_INTERN; } - OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, - "MPI_Win_create_errhandler"); + OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, MPI_ERR_INTERN, FUNC_NAME); } diff --git a/src/mpi/c/win_create_keyval.c b/src/mpi/c/win_create_keyval.c index 6a3022770b..309fa99ce5 100644 --- a/src/mpi/c/win_create_keyval.c +++ b/src/mpi/c/win_create_keyval.c @@ -18,15 +18,17 @@ static const char FUNC_NAME[] = "MPI_Win_create_keyval"; + int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, MPI_Win_delete_attr_function *win_delete_attr_fn, - int *win_keyval, void *extra_state) { - + int *win_keyval, void *extra_state) +{ int ret; ompi_attribute_fn_ptr_union_t copy_fn; ompi_attribute_fn_ptr_union_t del_fn; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == win_copy_attr_fn) || (NULL == win_delete_attr_fn) || (NULL == win_keyval)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, @@ -38,6 +40,5 @@ int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, ret = ompi_attr_create_keyval(WIN_ATTR, copy_fn, del_fn, win_keyval, extra_state, 0); - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_delete_attr.c b/src/mpi/c/win_delete_attr.c index 0f46311272..7e75d186e8 100644 --- a/src/mpi/c/win_delete_attr.c +++ b/src/mpi/c/win_delete_attr.c @@ -18,11 +18,13 @@ static const char FUNC_NAME[] = "MPI_Win_delete_attr"; + int MPI_Win_delete_attr(MPI_Win win, int win_keyval) { int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_WIN_NULL == win) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_WIN, FUNC_NAME); @@ -30,6 +32,5 @@ int MPI_Win_delete_attr(MPI_Win win, int win_keyval) } ret = ompi_attr_delete(WIN_ATTR, win, win->w_keyhash, win_keyval, 0); - OMPI_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_f2c.c b/src/mpi/c/win_f2c.c index 980062807b..e7a41847cc 100644 --- a/src/mpi/c/win_f2c.c +++ b/src/mpi/c/win_f2c.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "communicator/communicator.h" +#include "errhandler/errhandler.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_f2c = PMPI_Win_f2c @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -MPI_Win MPI_Win_f2c(MPI_Fint win) { - return (MPI_Win)0; +static const char FUNC_NAME[] = "MPI_Win_f2c"; + + +MPI_Win MPI_Win_f2c(MPI_Fint win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return (MPI_Win) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_fence.c b/src/mpi/c/win_fence.c index 06060460d7..9971c487dc 100644 --- a/src/mpi/c/win_fence.c +++ b/src/mpi/c/win_fence.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_fence = PMPI_Win_fence @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_fence(int assert, MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_fence"; + + +int MPI_Win_fence(int assert, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_free.c b/src/mpi/c/win_free.c index 4bf7139db3..e6cc51c710 100644 --- a/src/mpi/c/win_free.c +++ b/src/mpi/c/win_free.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_free = PMPI_Win_free @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_free(MPI_Win *win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_free"; + + +int MPI_Win_free(MPI_Win *win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_free_keyval.c b/src/mpi/c/win_free_keyval.c index 6813897758..6b7a47c63d 100644 --- a/src/mpi/c/win_free_keyval.c +++ b/src/mpi/c/win_free_keyval.c @@ -18,13 +18,15 @@ static const char FUNC_NAME[] = "MPI_Win_free_keyval"; -int MPI_Win_free_keyval(int *win_keyval) { - + +int MPI_Win_free_keyval(int *win_keyval) +{ int ret; /* Check for valid key pointer */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == win_keyval) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); @@ -32,6 +34,5 @@ int MPI_Win_free_keyval(int *win_keyval) { } ret = ompi_attr_free_keyval(WIN_ATTR, win_keyval, 0); - OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_get_attr.c b/src/mpi/c/win_get_attr.c index 99bdfab677..226f79233f 100644 --- a/src/mpi/c/win_get_attr.c +++ b/src/mpi/c/win_get_attr.c @@ -18,11 +18,14 @@ static const char FUNC_NAME[] = "MPI_Win_get_attr"; + int MPI_Win_get_attr(MPI_Win win, int win_keyval, - void *attribute_val, int *flag) { + void *attribute_val, int *flag) +{ int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if ((NULL == attribute_val) || (NULL == flag)) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_ARG, FUNC_NAME); @@ -31,7 +34,5 @@ int MPI_Win_get_attr(MPI_Win win, int win_keyval, ret = ompi_attr_get(win->w_keyhash, win_keyval, attribute_val, flag); - OMPI_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME); - } diff --git a/src/mpi/c/win_get_errhandler.c b/src/mpi/c/win_get_errhandler.c index 84ae7b1a64..a4d8a73203 100644 --- a/src/mpi/c/win_get_errhandler.c +++ b/src/mpi/c/win_get_errhandler.c @@ -9,6 +9,8 @@ #include "errhandler/errhandler.h" #include "communicator/communicator.h" #include "win/win.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_get_errhandler = PMPI_Win_get_errhandler @@ -18,17 +20,22 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler) { +static const char FUNC_NAME[] = "MPI_Win_get_errhandler"; + + +int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandler) +{ /* Error checking */ if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (NULL == win || MPI_WIN_NULL == win) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Win_get_errhandler"); + FUNC_NAME); } else if (NULL == errhandler) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, - "MPI_Win_get_errhandler"); + FUNC_NAME); } } diff --git a/src/mpi/c/win_get_group.c b/src/mpi/c/win_get_group.c index 7e46913527..cf70ff840f 100644 --- a/src/mpi/c/win_get_group.c +++ b/src/mpi/c/win_get_group.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_get_group = PMPI_Win_get_group @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_get_group(MPI_Win win, MPI_Group *group) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_get_group"; + + +int MPI_Win_get_group(MPI_Win win, MPI_Group *group) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_get_name.c b/src/mpi/c/win_get_name.c index c3c001ae52..26018c8f38 100644 --- a/src/mpi/c/win_get_name.c +++ b/src/mpi/c/win_get_name.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_get_name = PMPI_Win_get_name @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_get_name"; + + +int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_lock.c b/src/mpi/c/win_lock.c index 13da73233c..58fe059819 100644 --- a/src/mpi/c/win_lock.c +++ b/src/mpi/c/win_lock.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_lock = PMPI_Win_lock @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_lock"; + + +int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_post.c b/src/mpi/c/win_post.c index 3e7c7ac454..e287f92258 100644 --- a/src/mpi/c/win_post.c +++ b/src/mpi/c/win_post.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_post = PMPI_Win_post @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_post(MPI_Group group, int assert, MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_post"; + + +int MPI_Win_post(MPI_Group group, int assert, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_set_attr.c b/src/mpi/c/win_set_attr.c index c07659e2a7..8257d9135a 100644 --- a/src/mpi/c/win_set_attr.c +++ b/src/mpi/c/win_set_attr.c @@ -7,6 +7,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" #include "attribute/attribute.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_set_attr = PMPI_Win_set_attr @@ -18,11 +20,13 @@ static const char FUNC_NAME[] = "MPI_Win_set_attr"; -int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) { +int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) +{ int ret; if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); if (MPI_WIN_NULL == win) { return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_WIN, FUNC_NAME); @@ -31,6 +35,5 @@ int MPI_Win_set_attr(MPI_Win win, int win_keyval, void *attribute_val) { ret = ompi_attr_set(WIN_ATTR, win, win->w_keyhash, win_keyval, attribute_val, 0); - OMPI_ERRHANDLER_RETURN(ret, win, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_set_errhandler.c b/src/mpi/c/win_set_errhandler.c index 4dc2460b4c..adbe2e3daa 100644 --- a/src/mpi/c/win_set_errhandler.c +++ b/src/mpi/c/win_set_errhandler.c @@ -9,6 +9,8 @@ #include "errhandler/errhandler.h" #include "communicator/communicator.h" #include "win/win.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_set_errhandler = PMPI_Win_set_errhandler @@ -18,8 +20,18 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler) { - /* Error checking */ +static const char FUNC_NAME[] = "MPI_Win_set_errhandler"; + + +int MPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); if (MPI_PARAM_CHECK) { if (NULL == win || diff --git a/src/mpi/c/win_set_name.c b/src/mpi/c/win_set_name.c index 76eb7fc92b..7bd5516f0c 100644 --- a/src/mpi/c/win_set_name.c +++ b/src/mpi/c/win_set_name.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_set_name = PMPI_Win_set_name @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_set_name(MPI_Win win, char *win_name) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_set_name"; + + +int MPI_Win_set_name(MPI_Win win, char *win_name) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_start.c b/src/mpi/c/win_start.c index b028a35579..75a86c5584 100644 --- a/src/mpi/c/win_start.c +++ b/src/mpi/c/win_start.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_start = PMPI_Win_start @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_start(MPI_Group group, int assert, MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_start"; + + +int MPI_Win_start(MPI_Group group, int assert, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_test.c b/src/mpi/c/win_test.c index 0423fb258d..986c29a0e0 100644 --- a/src/mpi/c/win_test.c +++ b/src/mpi/c/win_test.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_test = PMPI_Win_test @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_test(MPI_Win win, int *flag) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_test"; + + +int MPI_Win_test(MPI_Win win, int *flag) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_unlock.c b/src/mpi/c/win_unlock.c index 243286ce1e..72be179124 100644 --- a/src/mpi/c/win_unlock.c +++ b/src/mpi/c/win_unlock.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_unlock = PMPI_Win_unlock @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Win_unlock(int rank, MPI_Win win) { - return MPI_SUCCESS; +static const char FUNC_NAME[] = "MPI_Win_unlock"; + + +int MPI_Win_unlock(int rank, MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/win_wait.c b/src/mpi/c/win_wait.c index 8bf10ee68d..ca1e3d1a08 100644 --- a/src/mpi/c/win_wait.c +++ b/src/mpi/c/win_wait.c @@ -6,6 +6,8 @@ #include "mpi.h" #include "mpi/c/bindings.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Win_wait = PMPI_Win_wait @@ -18,6 +20,13 @@ static const char FUNC_NAME[] = "MPI_Win_wait"; -int MPI_Win_wait(MPI_Win win) { - return MPI_SUCCESS; +int MPI_Win_wait(MPI_Win win) +{ + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + } + + /* This function is not yet implemented */ + + return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME); } diff --git a/src/mpi/c/wtick.c b/src/mpi/c/wtick.c index 1b5e573de2..88a451896f 100644 --- a/src/mpi/c/wtick.c +++ b/src/mpi/c/wtick.c @@ -15,6 +15,10 @@ #include "mpi/c/profile/defines.h" #endif -double MPI_Wtick(void) { +static const char FUNC_NAME[] = "MPI_Wtick"; + + +double MPI_Wtick(void) +{ return (double)0.000001; } diff --git a/src/mpi/c/wtime.c b/src/mpi/c/wtime.c index 2f12fdf01e..982ecfb78c 100644 --- a/src/mpi/c/wtime.c +++ b/src/mpi/c/wtime.c @@ -16,7 +16,11 @@ #include "mpi/c/profile/defines.h" #endif -double MPI_Wtime(void) { +static const char FUNC_NAME[] = "MPI_Wtime"; + + +double MPI_Wtime(void) +{ struct timeval tv; double wtime; gettimeofday(&tv, NULL);