Skip to content

Commit e64a16e

Browse files
bosilcaggouaillardet
authored andcommitted
Fix Coverity CIDs 1341584-1341589.
(cherry picked from commit 3a9664a)
1 parent 9d0fac3 commit e64a16e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ompi/mca/coll/base/coll_base_allgather.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ int ompi_coll_base_allgather_intra_bruck(const void *sbuf, int scount,
170170
char *free_buf = NULL, *shift_buf = NULL;
171171
ptrdiff_t span, gap;
172172

173-
span = opal_datatype_span(&rdtype->super, (size - rank) * rcount, &gap);
173+
span = opal_datatype_span(&rdtype->super, (int64_t)(size - rank) * rcount, &gap);
174174

175175
free_buf = (char*)calloc(span, sizeof(char));
176176
if (NULL == free_buf) {

ompi/mca/coll/base/coll_base_alltoall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ int ompi_coll_base_alltoall_intra_bruck(const void *sbuf, int scount,
222222
err = ompi_datatype_type_extent (rdtype, &rext);
223223
if (err != MPI_SUCCESS) { line = __LINE__; goto err_hndl; }
224224

225-
span = opal_datatype_span(&sdtype->super, size * scount, &gap);
225+
span = opal_datatype_span(&sdtype->super, (int64_t)size * scount, &gap);
226226

227227
displs = (int *) malloc(size * sizeof(int));
228228
if (displs == NULL) { line = __LINE__; err = -1; goto err_hndl; }

ompi/mca/coll/base/coll_base_gather.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ ompi_coll_base_gather_intra_binomial(const void *sbuf, int scount,
6666

6767
ompi_datatype_type_extent(sdtype, &sextent);
6868
ompi_datatype_type_extent(rdtype, &rextent);
69-
ssize = opal_datatype_span(&sdtype->super, scount * size, &sgap);
70-
rsize = opal_datatype_span(&rdtype->super, rcount * size, &rgap);
69+
ssize = opal_datatype_span(&sdtype->super, (int64_t)scount * size, &sgap);
70+
rsize = opal_datatype_span(&rdtype->super, (int64_t)rcount * size, &rgap);
7171

7272
vrank = (rank - root + size) % size;
7373

ompi/mca/coll/base/coll_base_scatter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ ompi_coll_base_scatter_intra_binomial( const void *sbuf, int scount,
6565
ompi_datatype_type_extent(sdtype, &sextent);
6666
ompi_datatype_type_extent(rdtype, &rextent);
6767

68-
ssize = opal_datatype_span(&sdtype->super, scount * size, &sgap);
69-
rsize = opal_datatype_span(&rdtype->super, rcount * size, &rgap);
68+
ssize = opal_datatype_span(&sdtype->super, (int64_t)scount * size, &sgap);
69+
rsize = opal_datatype_span(&rdtype->super, (int64_t)rcount * size, &rgap);
7070

7171
vrank = (rank - root + size) % size;
7272
ptmp = (char *) rbuf; /* by default suppose leaf nodes, just use rbuf */

0 commit comments

Comments
 (0)