Skip to content

Commit

Permalink
ch4/coll: Fix reduce compositions with non-zero root
Browse files Browse the repository at this point in the history
The root information being ignored. Fixes #6540.
  • Loading branch information
raffenet committed May 30, 2023
1 parent 5969ea5 commit 3edbc77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/mpid/ch4/src/ch4_coll_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,11 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Reduce_intra_composition_alpha(const void *se
/* intranode reduce on all nodes */
if (comm->node_comm != NULL) {
#ifndef MPIDI_CH4_DIRECT_NETMOD
coll_ret = MPIDI_SHM_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm->node_comm,
errflag);
coll_ret =
MPIDI_SHM_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm->node_comm,
errflag);
#else
coll_ret = MPIDI_NM_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm->node_comm,
coll_ret = MPIDI_NM_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm->node_comm,
errflag);
#endif /* MPIDI_CH4_DIRECT_NETMOD */

Expand Down Expand Up @@ -670,11 +671,12 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_Reduce_intra_composition_beta(const void *sen
if (comm->node_comm != NULL && MPIR_Get_intranode_rank(comm, root) == -1) {
#ifndef MPIDI_CH4_DIRECT_NETMOD
coll_ret =
MPIDI_SHM_mpi_reduce(sendbuf, tmp_buf, count, datatype, op, 0, comm->node_comm,
MPIDI_SHM_mpi_reduce(sendbuf, tmp_buf, count, datatype, op, root, comm->node_comm,
errflag);
#else
coll_ret =
MPIDI_NM_mpi_reduce(sendbuf, tmp_buf, count, datatype, op, 0, comm->node_comm, errflag);
MPIDI_NM_mpi_reduce(sendbuf, tmp_buf, count, datatype, op, root, comm->node_comm,
errflag);
#endif /* MPIDI_CH4_DIRECT_NETMOD */
MPIR_ERR_COLL_CHECKANDCONT(coll_ret, errflag, mpi_errno);
}
Expand Down

0 comments on commit 3edbc77

Please sign in to comment.