Skip to content

Commit 88d3a3b

Browse files
coll/ucc: use size_t to avoid overflow
Signed-off-by: Sergey Lebedev <sergeyle@nvidia.com>
1 parent 20151a8 commit 88d3a3b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

ompi/mca/coll/ucc/coll_ucc_gatherv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ int mca_coll_ucc_igatherv(const void *sbuf, int scount, struct ompi_datatype_t *
117117
}
118118
return ucc_module->previous_igatherv(sbuf, scount, sdtype, rbuf, rcounts,
119119
disps, rdtype, root, comm, request,
120-
ucc_module->previous_igather_module);
120+
ucc_module->previous_igatherv_module);
121121
}

ompi/mca/coll/ucc/coll_ucc_reduce_scatter.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ ucc_status_t mca_coll_ucc_reduce_scatter_init(const void *sbuf, void *rbuf, cons
1616
ucc_coll_req_h *req,
1717
mca_coll_ucc_req_t *coll_req)
1818
{
19-
ucc_datatype_t ucc_dt;
20-
ucc_reduction_op_t ucc_op;
21-
int total_count, i;
19+
ucc_datatype_t ucc_dt;
20+
ucc_reduction_op_t ucc_op;
21+
size_t total_count;
22+
int i;
2223
int comm_size = ompi_comm_size(ucc_module->comm);
2324

2425
if (MPI_IN_PLACE == sbuf) {
2526
/* TODO: UCC defines inplace differently:
2627
data in rbuf of rank R is shifted by R * rcount */
28+
UCC_VERBOSE(5, "inplace reduce_scatter is not supported");
2729
return UCC_ERR_NOT_SUPPORTED;
2830
}
2931

ompi/mca/coll/ucc/coll_ucc_reduce_scatter_block.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ ucc_status_t mca_coll_ucc_reduce_scatter_block_init(const void *sbuf, void *rbuf
1818
ucc_coll_req_h *req,
1919
mca_coll_ucc_req_t *coll_req)
2020
{
21-
ucc_datatype_t ucc_dt;
22-
ucc_reduction_op_t ucc_op;
21+
ucc_datatype_t ucc_dt;
22+
ucc_reduction_op_t ucc_op;
2323
int comm_size = ompi_comm_size(ucc_module->comm);
2424

2525
if (MPI_IN_PLACE == sbuf) {
2626
/* TODO: UCC defines inplace differently:
2727
data in rbuf of rank R is shifted by R * rcount */
28+
UCC_VERBOSE(5, "inplace reduce_scatter_block is not supported");
2829
return UCC_ERR_NOT_SUPPORTED;
2930
}
3031
ucc_dt = ompi_dtype_to_ucc_dtype(dtype);
@@ -44,7 +45,7 @@ ucc_status_t mca_coll_ucc_reduce_scatter_block_init(const void *sbuf, void *rbuf
4445
.coll_type = UCC_COLL_TYPE_REDUCE_SCATTER,
4546
.src.info = {
4647
.buffer = (void*)sbuf,
47-
.count = rcount * comm_size,
48+
.count = ((size_t)rcount) * comm_size,
4849
.datatype = ucc_dt,
4950
.mem_type = UCC_MEMORY_TYPE_UNKNOWN
5051
},

0 commit comments

Comments
 (0)