Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch4: Fix anysrc recv cancel #7217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/mpid/ch4/src/mpidig_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_anysrc_try_cancel_partner(MPIR_Request * rreq
* ref count here to prevent free since here we will check
* the request status */
MPIR_Request_add_ref(anysrc_partner);
/* unset partner request to prevent recursive cancellation */
anysrc_partner->dev.anysrc_partner = NULL;
mpi_errno = MPIDI_NM_mpi_cancel_recv(anysrc_partner, true); /* blocking */
MPIR_ERR_CHECK(mpi_errno);
if (!MPIR_STATUS_GET_CANCEL_BIT(anysrc_partner->status)) {
Expand All @@ -113,6 +115,15 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_anysrc_try_cancel_partner(MPIR_Request * rreq
*/
MPIR_STATUS_SET_CANCEL_BIT(rreq->status, TRUE);
*is_cancelled = 0;
if (MPIR_Request_is_complete(anysrc_partner)) {
rreq->dev.anysrc_partner = NULL;
rreq->status = anysrc_partner->status;
MPIDI_CH4_REQUEST_FREE(anysrc_partner);
MPID_Request_complete(rreq);
} else {
/* request not yet complete. reset partner for later free. */
anysrc_partner->dev.anysrc_partner = rreq;
}
} else {
/* NM partner is not user-visible, free it now, which means
* explicit SHM code can skip MPIDI_anysrc_free_partner
Expand Down