Skip to content

Commit 0d7c8c3

Browse files
committed
coll/han: fix the count of allreduce_t3_task's lower bcast operation
The lower bcast operation of t3 task was applied to current segment. Prior to this patch, the count of this operation is always seg_count, which is wrong, because this operation can be applied to last segment when there are mulitple segments. Therefore its count need to be variable. This patch addressed the issue by setting the count of this operaiton to last_seg_count when it is applied on last segment. Signed-off-by: Wei Zhang <wzam@amazon.com>
1 parent e4695b2 commit 0d7c8c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ompi/mca/coll/han/coll_han_allreduce.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,13 @@ int mca_coll_han_allreduce_t3_task(void *task_args)
391391
t->low_comm->c_coll->coll_reduce_module);
392392
}
393393
/* lb of cur_seg */
394-
t->low_comm->c_coll->coll_bcast((char *) t->rbuf, t->seg_count, t->dtype, t->root_low_rank,
394+
if (t->cur_seg == t->num_segments - 1 && t->last_seg_count != t->seg_count) {
395+
tmp_count = t->last_seg_count;
396+
} else {
397+
tmp_count = t->seg_count;
398+
}
399+
400+
t->low_comm->c_coll->coll_bcast((char *) t->rbuf, tmp_count, t->dtype, t->root_low_rank,
395401
t->low_comm, t->low_comm->c_coll->coll_bcast_module);
396402
if (!t->noop && req_count > 0) {
397403
ompi_request_wait_all(req_count, reqs, MPI_STATUSES_IGNORE);

0 commit comments

Comments
 (0)