diff --git a/src/mpi/c/get_address.c b/src/mpi/c/get_address.c index 29c976f02d..f28c4c2392 100644 --- a/src/mpi/c/get_address.c +++ b/src/mpi/c/get_address.c @@ -2,10 +2,12 @@ * $HEADERS$ */ #include "lam_config.h" -#include #include "mpi.h" #include "mpi/c/bindings.h" +#include "runtime/runtime.h" +#include "errhandler/errhandler.h" +#include "communicator/communicator.h" #if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES #pragma weak MPI_Get_address = PMPI_Get_address @@ -15,6 +17,16 @@ #include "mpi/c/profile/defines.h" #endif -int MPI_Get_address(void *location, MPI_Aint *address) { +static char FUNC_NAME[] = "MPI_Get_address"; + +int MPI_Get_address(void *location, MPI_Aint *address) +{ + if( MPI_PARAM_CHECK ) { + if( LAM_MPI_INVALID_STATE ) { + LAM_ERRHANDLER_RETURN( MPI_ERR_INTERN, (lam_communicator_t*)NULL, + MPI_ERR_INTERN, FUNC_NAME ); + } + } + *address = (MPI_Aint)location; return MPI_SUCCESS; }