diff --git a/ompi/mca/coll/base/coll_base_allgather.c b/ompi/mca/coll/base/coll_base_allgather.c index 4cc3d7a4799..cafc6eac3ee 100644 --- a/ompi/mca/coll/base/coll_base_allgather.c +++ b/ompi/mca/coll/base/coll_base_allgather.c @@ -170,7 +170,7 @@ int ompi_coll_base_allgather_intra_bruck(const void *sbuf, int scount, char *free_buf = NULL, *shift_buf = NULL; ptrdiff_t span, gap; - span = opal_datatype_span(&rdtype->super, (size - rank) * rcount, &gap); + span = opal_datatype_span(&rdtype->super, (int64_t)(size - rank) * rcount, &gap); free_buf = (char*)calloc(span, sizeof(char)); if (NULL == free_buf) { diff --git a/ompi/mca/coll/base/coll_base_alltoall.c b/ompi/mca/coll/base/coll_base_alltoall.c index 530036f771e..b56829e9999 100644 --- a/ompi/mca/coll/base/coll_base_alltoall.c +++ b/ompi/mca/coll/base/coll_base_alltoall.c @@ -222,7 +222,7 @@ int ompi_coll_base_alltoall_intra_bruck(const void *sbuf, int scount, err = ompi_datatype_type_extent (rdtype, &rext); if (err != MPI_SUCCESS) { line = __LINE__; goto err_hndl; } - span = opal_datatype_span(&sdtype->super, size * scount, &gap); + span = opal_datatype_span(&sdtype->super, (int64_t)size * scount, &gap); displs = (int *) malloc(size * sizeof(int)); if (displs == NULL) { line = __LINE__; err = -1; goto err_hndl; } diff --git a/ompi/mca/coll/base/coll_base_gather.c b/ompi/mca/coll/base/coll_base_gather.c index 80f7b701564..ff83c291609 100644 --- a/ompi/mca/coll/base/coll_base_gather.c +++ b/ompi/mca/coll/base/coll_base_gather.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All Rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -65,13 +65,13 @@ ompi_coll_base_gather_intra_binomial(const void *sbuf, int scount, bmtree = data->cached_in_order_bmtree; ompi_datatype_type_extent(sdtype, &sextent); - ompi_datatype_type_extent(rdtype, &rextent); - ssize = opal_datatype_span(&sdtype->super, scount * size, &sgap); - rsize = opal_datatype_span(&rdtype->super, rcount * size, &rgap); + ssize = opal_datatype_span(&sdtype->super, (int64_t)scount * size, &sgap); vrank = (rank - root + size) % size; if (rank == root) { + ompi_datatype_type_extent(rdtype, &rextent); + rsize = opal_datatype_span(&rdtype->super, (int64_t)rcount * size, &rgap); if (0 == root){ /* root on 0, just use the recv buffer */ ptmp = (char *) rbuf; diff --git a/ompi/mca/coll/base/coll_base_scatter.c b/ompi/mca/coll/base/coll_base_scatter.c index 71605595e12..b86cea4ca68 100644 --- a/ompi/mca/coll/base/coll_base_scatter.c +++ b/ompi/mca/coll/base/coll_base_scatter.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2016 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -62,16 +62,16 @@ ompi_coll_base_scatter_intra_binomial( const void *sbuf, int scount, COLL_BASE_UPDATE_IN_ORDER_BMTREE( comm, base_module, root ); bmtree = data->cached_in_order_bmtree; - ompi_datatype_type_extent(sdtype, &sextent); ompi_datatype_type_extent(rdtype, &rextent); - ssize = opal_datatype_span(&sdtype->super, scount * size, &sgap); - rsize = opal_datatype_span(&rdtype->super, rcount * size, &rgap); + rsize = opal_datatype_span(&rdtype->super, (int64_t)rcount * size, &rgap); vrank = (rank - root + size) % size; ptmp = (char *) rbuf; /* by default suppose leaf nodes, just use rbuf */ if (rank == root) { + ompi_datatype_type_extent(sdtype, &sextent); + ssize = opal_datatype_span(&sdtype->super, (int64_t)scount * size, &sgap); if (0 == root) { /* root on 0, just use the send buffer */ ptmp = (char *) sbuf;