Commit 209a8b7d authored by Wesley Bland's avatar Wesley Bland Committed by Kenneth Raffenetti
Browse files

Fix refcounting for isends

The refcounting for isends needs to be reset to 0 sometimes if an error occurs
before passing the request back to the user. This was mistakenly cleaned up in
[1e171ff6

] and now needs to be set back (along with a better comment
explaining the problem.

Thanks for the bug report to Lisandro Dalcin (dalcinl@gmail.com).

Fixes #2129
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent aaf1d96f
......@@ -66,9 +66,12 @@ int MPID_Cancel_send(MPID_Request * sreq)
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"send-to-self cancellation successful, sreq=0x%08x, rreq=0x%08x",
sreq->handle, rreq->handle));
MPID_Request_release(rreq);
/* Pull the message out of the unexpected queue since it's being
* cancelled */
MPIU_Object_set_ref(rreq, 0);
MPIDI_CH3_Request_destroy(rreq);
MPIR_STATUS_SET_CANCEL_BIT(sreq->status, TRUE);
/* no other thread should be waiting on sreq, so it is safe to
reset ref_count and cc */
......
......@@ -45,7 +45,10 @@ int MPIDI_Isend_self(const void * buf, int count, MPI_Datatype datatype, int ran
/* --BEGIN ERROR HANDLING-- */
if (rreq == NULL)
{
MPID_Request_release(sreq);
/* Set the refcount to 0 since the user will never have a chance to
* release their reference */
MPIU_Object_set_ref(sreq, 0);
MPIDI_CH3_Request_destroy(sreq);
sreq = NULL;
MPIU_ERR_SET1(mpi_errno, MPI_ERR_OTHER, "**nomem",
"**nomemuereq %d", MPIDI_CH3U_Recvq_count_unexp());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment