@@ -92,7 +92,7 @@ static int nbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype s
9292 sendcount = recvcount ;
9393 } else if (!persistent ) { /* for persistent, the copy must be scheduled */
9494 /* copy my data to receive buffer */
95- rbuf = (char * ) recvbuf + rank * recvcount * rcvext ;
95+ rbuf = (char * ) recvbuf + ( MPI_Aint ) rcvext * rank * recvcount ;
9696 res = NBC_Copy (sendbuf , sendcount , sendtype , rbuf , recvcount , recvtype , comm );
9797 if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
9898 return res ;
@@ -121,7 +121,7 @@ static int nbc_allgather_init(const void* sendbuf, int sendcount, MPI_Datatype s
121121 if (persistent && !inplace ) {
122122 /* for nonblocking, data has been copied already */
123123 /* copy my data to receive buffer (= send buffer of NBC_Sched_send) */
124- rbuf = (char * )recvbuf + rank * recvcount * rcvext ;
124+ rbuf = (char * )recvbuf + ( MPI_Aint ) rcvext * rank * recvcount ;
125125 res = NBC_Sched_copy ((void * )sendbuf , false, sendcount , sendtype ,
126126 rbuf , false, recvcount , recvtype , schedule , true);
127127 if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
@@ -237,7 +237,7 @@ static int nbc_allgather_inter_init(const void* sendbuf, int sendcount, MPI_Data
237237 /* do rsize - 1 rounds */
238238 for (int r = 0 ; r < rsize ; ++ r ) {
239239 /* recv from rank r */
240- rbuf = (char * ) recvbuf + r * recvcount * rcvext ;
240+ rbuf = (char * ) recvbuf + ( MPI_Aint ) rcvext * r * recvcount ;
241241 res = NBC_Sched_recv (rbuf , false, recvcount , recvtype , r , schedule , false);
242242 if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
243243 OBJ_RELEASE (schedule );
@@ -303,12 +303,12 @@ static inline int allgather_sched_linear(
303303 ptrdiff_t rlb , rext ;
304304
305305 res = ompi_datatype_get_extent (rdtype , & rlb , & rext );
306- char * sbuf = (char * )recvbuf + rank * rcount * rext ;
306+ char * sbuf = (char * )recvbuf + ( MPI_Aint ) rext * rank * rcount ;
307307
308308 for (int remote = 0 ; remote < comm_size ; ++ remote ) {
309309 if (remote != rank ) {
310310 /* Recv from rank remote */
311- char * rbuf = (char * )recvbuf + remote * rcount * rext ;
311+ char * rbuf = (char * )recvbuf + ( MPI_Aint ) rext * remote * rcount ;
312312 res = NBC_Sched_recv (rbuf , false, rcount , rdtype , remote , schedule , false);
313313 if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) { goto cleanup_and_return ; }
314314
0 commit comments