From c0978165d09ce07d8a18d568afdb5687c2076df6 Mon Sep 17 00:00:00 2001 From: hzhou-muse Date: Fri, 16 Oct 2026 21:18:44 +0000 Subject: [PATCH] sched: return the receive status for MPI_Isendrecv When the receive entry of an MPI_Isendrecv or MPI_Isendrecv_replace schedule completes, copy its source, tag, count, and cancel bit into the schedule request so MPI_Wait/MPI_Test report them. Previously the status returned to the user was left unset. Fixes #8005 Co-Authored-By: Claude Opus 5.5 --- src/mpid/common/sched/mpidu_sched.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mpid/common/sched/mpidu_sched.c b/src/mpid/common/sched/mpidu_sched.c index 76ce1b5ffbd..a82e94058ad 100644 --- a/src/mpid/common/sched/mpidu_sched.c +++ b/src/mpid/common/sched/mpidu_sched.c @@ -1065,6 +1065,14 @@ static int MPIDU_Sched_progress_state(struct MPIDU_Sched_state *state, int *made break; case MPIDU_SCHED_ENTRY_PT2PT_RECV: if (e->u.recv.rreq != NULL && MPIR_Request_is_complete(e->u.recv.rreq)) { + /* pass the receive status (source, tag, count, cancel bit) to the + * schedule request, which is what MPI_Isendrecv(_replace) returns */ + MPI_Status *rstatus = &e->u.recv.rreq->status; + MPIR_Process_status(rstatus); + s->req->status.MPI_SOURCE = rstatus->MPI_SOURCE; + s->req->status.MPI_TAG = rstatus->MPI_TAG; + s->req->status.count_lo = rstatus->count_lo; + s->req->status.count_hi_and_cancelled = rstatus->count_hi_and_cancelled; if (s->req->status.MPI_ERROR) { e->status = MPIDU_SCHED_ENTRY_STATUS_FAILED; } else {