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

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

Thanks for the bug report to Lisandro Dalcin (

Fixes #2129
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <>
parent aaf1d96f
......@@ -66,9 +66,12 @@ int MPID_Cancel_send(MPID_Request * sreq)
"send-to-self cancellation successful, sreq=0x%08x, rreq=0x%08x",
sreq->handle, rreq->handle));
/* Pull the message out of the unexpected queue since it's being
* cancelled */
MPIU_Object_set_ref(rreq, 0);
/* 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
if (rreq == NULL)
/* Set the refcount to 0 since the user will never have a chance to
* release their reference */
MPIU_Object_set_ref(sreq, 0);
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