Skip to content

Commit

Permalink
ch4: assert group before communicator commit
Browse files Browse the repository at this point in the history
Add assertions to make sure the local_group and remote_group (for
inter communicators) are always set before MPID_Comm_commit_pre_hook.
  • Loading branch information
hzhou committed Dec 12, 2024
1 parent 13e16a5 commit acda531
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mpid/ch4/src/ch4_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit acda531

Please sign in to comment.