From acda5319a4a1451ccba2fb0a0135058ce325f535 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Thu, 12 Dec 2024 11:06:53 -0600 Subject: [PATCH] ch4: assert group before communicator commit Add assertions to make sure the local_group and remote_group (for inter communicators) are always set before MPID_Comm_commit_pre_hook. --- src/mpid/ch4/src/ch4_comm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mpid/ch4/src/ch4_comm.c b/src/mpid/ch4/src/ch4_comm.c index 2ca6c693cfa..8429acb8290 100644 --- a/src/mpid/ch4/src/ch4_comm.c +++ b/src/mpid/ch4/src/ch4_comm.c @@ -140,6 +140,9 @@ int MPID_Comm_commit_pre_hook(MPIR_Comm * comm) int mpi_errno; MPIR_FUNC_ENTER; + MPIR_Assert(comm->local_group); + MPIR_Assert(comm->comm_kind == MPIR_COMM_KIND__INTRACOMM || comm->remote_group); + if (comm == MPIR_Process.comm_world) { MPIDI_COMM(comm, map).mode = MPIDI_RANK_MAP_DIRECT_INTRA; MPIDI_COMM(comm, map).avtid = 0;