From 2b4975de8eb05d74cbac7b3af6d299e020bb2b59 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Fri, 25 Jan 2008 12:58:59 +0000 Subject: [PATCH] - In case of MPI_REQUEST_NULL, set the *status to the empty_status, by copying structure: psendrecv.c:81 4e7: cmpl $0x0,0x34(%ebp) 4e7: cmpl $0x0,0x34(%ebp) 4eb: je 51e 4eb: je 517 psendrecv.c:85 4ed: mov 0x34(%ebp),%eax 4ed: mov 0x34(%ebp),%edx 4f0: movl $0xfffffffe,(%eax) 4f0: mov 0x38,%eax psendrecv.c:86 4f5: mov %eax,(%edx) 4f6: mov 0x34(%ebp),%eax 4f7: mov 0x3c,%eax 4f9: movl $0xffffffff,0x4(%eax) 4fc: mov %eax,0x4(%edx) psendrecv.c:87 4ff: mov 0x40,%eax 500: mov 0x34(%ebp),%eax 504: mov %eax,0x8(%edx) 503: movl $0x0,0x8(%eax) 507: mov 0x44,%eax psendrecv.c:88 50c: mov %eax,0xc(%edx) 50a: mov 0x34(%ebp),%eax 50f: mov 0x48,%eax 50d: movl $0x0,0xc(%eax) 514: mov %eax,0x10(%edx) psendrecv.c:89 514: mov 0x34(%ebp),%eax 517: movl $0x0,0x10(%eax) psendrecv.c:91 This commit was SVN r17230. --- ompi/mpi/c/iprobe.c | 11 ++++------- ompi/mpi/c/probe.c | 9 +++------ ompi/mpi/c/recv.c | 7 ++----- ompi/mpi/c/sendrecv.c | 6 +----- ompi/mpi/c/wait.c | 6 +----- 5 files changed, 11 insertions(+), 28 deletions(-) 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; }