From 477424c53796cdbc4d207a4ad843ee47403dde5f Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 27 Oct 2006 12:28:07 +0000 Subject: [PATCH] Fixes trac:532 * Remove an extra OMPI_REQUEST_INIT() from the grequest constructor (it was already invoked by the parent MPI_Request constructor) * Set the state of the generalized request to ACTIVE (because this is invoked from MPI_GREQUEST_START -- analogous to MPI_START) * Before invoking the query function in MPI_REQUEST_COMPLETE, set the status on the base request to ompi_status_empty. This gives a set of default values for the request, including one for status.MPI_ERROR = MPI_SUCCESS (because we check the value of MPI_ERROR in MPI_TEST* and MPI_WAIT* processing, and use it to determine whether the upper-level API call should raise an MPI exception or not). This commit was SVN r12337. The following Trac tickets were found above: Ticket 532 --> https://svn.open-mpi.org/trac/ompi/ticket/532 --- ompi/request/grequest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ompi/request/grequest.c b/ompi/request/grequest.c index 252099610d..a3c6a8683e 100644 --- a/ompi/request/grequest.c +++ b/ompi/request/grequest.c @@ -44,7 +44,6 @@ static int ompi_grequest_cancel(ompi_request_t* req, int flag) static void ompi_grequest_construct(ompi_grequest_t* greq) { - OMPI_REQUEST_INIT(&greq->greq_base, false); greq->greq_base.req_free = ompi_grequest_free; greq->greq_base.req_cancel = ompi_grequest_cancel; greq->greq_base.req_type = OMPI_REQUEST_GEN; @@ -75,6 +74,7 @@ int ompi_grequest_start( return OMPI_ERR_OUT_OF_RESOURCE; } + greq->greq_base.req_state = OMPI_REQUEST_ACTIVE; greq->greq_state = gstate; greq->greq_query.c_query = gquery_fn; greq->greq_free.c_free = gfree_fn; @@ -88,6 +88,7 @@ int ompi_grequest_complete(ompi_grequest_t* grequest) int rc = OMPI_SUCCESS; OPAL_THREAD_LOCK(&ompi_request_lock); grequest->greq_base.req_complete = true; + grequest->greq_base.req_status = ompi_status_empty; if(grequest->greq_query.c_query != NULL) rc = grequest->greq_query.c_query(grequest->greq_state, &grequest->greq_base.req_status); if(ompi_request_waiting)