diff --git a/ompi/mpi/c/iprobe.c b/ompi/mpi/c/iprobe.c index d51274b2c0..a256ac6028 100644 --- a/ompi/mpi/c/iprobe.c +++ b/ompi/mpi/c/iprobe.c @@ -20,6 +20,7 @@ #include "ompi/mpi/c/bindings.h" #include "ompi/mca/pml/pml.h" +#include "ompi/request/request.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Iprobe = PMPI_Iprobe @@ -32,7 +33,7 @@ static const char FUNC_NAME[] = "MPI_Iprobe"; -int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) +int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) { int rc; @@ -54,12 +55,8 @@ int MPI_Iprobe(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status } if (MPI_PROC_NULL == source) { - if (status) { - status->MPI_SOURCE = MPI_PROC_NULL; - status->MPI_TAG = MPI_ANY_TAG; - status->MPI_ERROR = MPI_SUCCESS; - status->_count = 0; - status->_cancelled = 0; + if (MPI_STATUS_IGNORE != status) { + *status = ompi_request_empty.req_status; } return MPI_SUCCESS; } diff --git a/ompi/mpi/c/probe.c b/ompi/mpi/c/probe.c index 484db3637b..4cae00c67b 100644 --- a/ompi/mpi/c/probe.c +++ b/ompi/mpi/c/probe.c @@ -20,6 +20,7 @@ #include "ompi/mpi/c/bindings.h" #include "ompi/mca/pml/pml.h" +#include "ompi/request/request.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Probe = PMPI_Probe @@ -54,12 +55,8 @@ int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) } if (MPI_PROC_NULL == source) { - if (status) { - status->MPI_SOURCE = MPI_PROC_NULL; - status->MPI_TAG = MPI_ANY_TAG; - status->MPI_ERROR = MPI_SUCCESS; - status->_count = 0; - status->_cancelled = 0; + if (MPI_STATUS_IGNORE != status) { + *status = ompi_request_empty.req_status; } return MPI_SUCCESS; } diff --git a/ompi/mpi/c/recv.c b/ompi/mpi/c/recv.c index adfd3b30db..ac0fc378be 100644 --- a/ompi/mpi/c/recv.c +++ b/ompi/mpi/c/recv.c @@ -20,6 +20,7 @@ #include "ompi/mpi/c/bindings.h" #include "ompi/mca/pml/pml.h" +#include "ompi/request/request.h" #if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES #pragma weak MPI_Recv = PMPI_Recv @@ -59,11 +60,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype type, int source, if (MPI_PROC_NULL == source) { if (MPI_STATUS_IGNORE != status) { - status->MPI_SOURCE = MPI_PROC_NULL; - status->MPI_TAG = MPI_ANY_TAG; - status->MPI_ERROR = MPI_SUCCESS; - status->_count = 0; - status->_cancelled = 0; + *status = ompi_request_empty.req_status; } return MPI_SUCCESS; } diff --git a/ompi/mpi/c/sendrecv.c b/ompi/mpi/c/sendrecv.c index 494a10f085..a5d4a49234 100644 --- a/ompi/mpi/c/sendrecv.c +++ b/ompi/mpi/c/sendrecv.c @@ -79,11 +79,7 @@ int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, rc = ompi_request_wait(&req, status); } else { if (MPI_STATUS_IGNORE != status) { - status->MPI_SOURCE = MPI_PROC_NULL; - status->MPI_TAG = MPI_ANY_TAG; - status->MPI_ERROR = MPI_SUCCESS; - status->_count = 0; - status->_cancelled = 0; + *status = ompi_request_empty.req_status; } rc = MPI_SUCCESS; } diff --git a/ompi/mpi/c/wait.c b/ompi/mpi/c/wait.c index 8b2d0d5f24..4b5d186d5c 100644 --- a/ompi/mpi/c/wait.c +++ b/ompi/mpi/c/wait.c @@ -50,11 +50,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) if (MPI_REQUEST_NULL == *request) { if (MPI_STATUS_IGNORE != status) { - status->MPI_SOURCE = MPI_PROC_NULL; - status->MPI_TAG = MPI_ANY_TAG; - status->MPI_ERROR = MPI_SUCCESS; - status->_count = 0; - status->_cancelled = 0; + *status = ompi_request_empty.req_status; } return MPI_SUCCESS; }