5050 * and count) to send the data to the other.
5151 */
5252int
53- mca_coll_base_alltoallv_intra_basic_inplace (const void * rbuf , const int * rcounts , const int * rdisps ,
53+ mca_coll_base_alltoallv_intra_basic_inplace (const void * rbuf , ompi_count_array_t rcounts , ompi_disp_array_t rdisps ,
5454 struct ompi_datatype_t * rdtype ,
5555 struct ompi_communicator_t * comm ,
5656 mca_coll_base_module_t * module )
@@ -72,7 +72,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
7272 if (i == rank ) {
7373 continue ;
7474 }
75- packed_size = rcounts [ i ] * type_size ;
75+ packed_size = ompi_count_array_get ( rcounts , i ) * type_size ;
7676 max_size = opal_max (packed_size , max_size );
7777 }
7878
@@ -111,11 +111,11 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
111111 right = (rank + i ) % size ;
112112 left = (rank + size - i ) % size ;
113113
114- if ( 0 != rcounts [ right ] ) { /* nothing to exchange with the peer on the right */
114+ if ( 0 != ompi_count_array_get ( rcounts , right ) ) { /* nothing to exchange with the peer on the right */
115115 ompi_proc_t * right_proc = ompi_comm_peer_lookup (comm , right );
116116 opal_convertor_clone (right_proc -> super .proc_convertor , & convertor , 0 );
117- opal_convertor_prepare_for_send (& convertor , & rdtype -> super , rcounts [ right ] ,
118- (char * ) rbuf + rdisps [ right ] * extent );
117+ opal_convertor_prepare_for_send (& convertor , & rdtype -> super , ompi_count_array_get ( rcounts , right ) ,
118+ (char * ) rbuf + ompi_disp_array_get ( rdisps , right ) * extent );
119119 packed_size = max_size ;
120120 err = opal_convertor_pack (& convertor , & iov , & iov_count , & packed_size );
121121 if (1 != err ) {
@@ -124,17 +124,19 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
124124 }
125125
126126 /* Receive data from the right */
127- err = MCA_PML_CALL (irecv ((char * ) rbuf + rdisps [right ] * extent , rcounts [right ], rdtype ,
127+ err = MCA_PML_CALL (irecv ((char * ) rbuf + ompi_disp_array_get (rdisps , right ) * extent ,
128+ ompi_count_array_get (rcounts , right ), rdtype ,
128129 right , MCA_COLL_BASE_TAG_ALLTOALLV , comm , & req ));
129130 if (MPI_SUCCESS != err ) {
130131 line = __LINE__ ;
131132 goto error_hndl ;
132133 }
133134 }
134135
135- if ( (left != right ) && (0 != rcounts [ left ] ) ) {
136+ if ( (left != right ) && (0 != ompi_count_array_get ( rcounts , left ) ) ) {
136137 /* Send data to the left */
137- err = MCA_PML_CALL (send ((char * ) rbuf + rdisps [left ] * extent , rcounts [left ], rdtype ,
138+ err = MCA_PML_CALL (send ((char * ) rbuf + ompi_disp_array_get (rdisps , left ) * extent ,
139+ ompi_count_array_get (rcounts , left ), rdtype ,
138140 left , MCA_COLL_BASE_TAG_ALLTOALLV , MCA_PML_BASE_SEND_STANDARD ,
139141 comm ));
140142 if (MPI_SUCCESS != err ) {
@@ -149,15 +151,16 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
149151 }
150152
151153 /* Receive data from the left */
152- err = MCA_PML_CALL (irecv ((char * ) rbuf + rdisps [left ] * extent , rcounts [left ], rdtype ,
154+ err = MCA_PML_CALL (irecv ((char * ) rbuf + ompi_disp_array_get (rdisps , left ) * extent ,
155+ ompi_count_array_get (rcounts , left ), rdtype ,
153156 left , MCA_COLL_BASE_TAG_ALLTOALLV , comm , & req ));
154157 if (MPI_SUCCESS != err ) {
155158 line = __LINE__ ;
156159 goto error_hndl ;
157160 }
158161 }
159162
160- if ( 0 != rcounts [ right ] ) { /* nothing to exchange with the peer on the right */
163+ if ( 0 != ompi_count_array_get ( rcounts , right ) ) { /* nothing to exchange with the peer on the right */
161164 /* Send data to the right */
162165 err = MCA_PML_CALL (send ((char * ) tmp_buffer , packed_size , MPI_PACKED ,
163166 right , MCA_COLL_BASE_TAG_ALLTOALLV , MCA_PML_BASE_SEND_STANDARD ,
@@ -191,9 +194,9 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
191194}
192195
193196int
194- ompi_coll_base_alltoallv_intra_pairwise (const void * sbuf , const int * scounts , const int * sdisps ,
197+ ompi_coll_base_alltoallv_intra_pairwise (const void * sbuf , ompi_count_array_t scounts , ompi_disp_array_t sdisps ,
195198 struct ompi_datatype_t * sdtype ,
196- void * rbuf , const int * rcounts , const int * rdisps ,
199+ void * rbuf , ompi_count_array_t rcounts , ompi_disp_array_t rdisps ,
197200 struct ompi_datatype_t * rdtype ,
198201 struct ompi_communicator_t * comm ,
199202 mca_coll_base_module_t * module )
@@ -230,21 +233,21 @@ ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, co
230233 recvfrom = (rank + size - step ) % size ;
231234
232235 /* Determine sending and receiving locations */
233- psnd = (char * )sbuf + ( ptrdiff_t ) sdisps [ sendto ] * sext ;
234- prcv = (char * )rbuf + ( ptrdiff_t ) rdisps [ recvfrom ] * rext ;
236+ psnd = (char * )sbuf + ompi_disp_array_get ( sdisps , sendto ) * sext ;
237+ prcv = (char * )rbuf + ompi_disp_array_get ( rdisps , recvfrom ) * rext ;
235238
236239 /* send and receive */
237- if (0 < rcounts [ recvfrom ] && 0 < rdtype_size ) {
238- err = MCA_PML_CALL (irecv (prcv , rcounts [ recvfrom ] , rdtype , recvfrom ,
240+ if (0 < ompi_count_array_get ( rcounts , recvfrom ) && 0 < rdtype_size ) {
241+ err = MCA_PML_CALL (irecv (prcv , ompi_count_array_get ( rcounts , recvfrom ) , rdtype , recvfrom ,
239242 MCA_COLL_BASE_TAG_ALLTOALLV , comm , & req ));
240243 if (MPI_SUCCESS != err ) {
241244 line = __LINE__ ;
242245 goto err_hndl ;
243246 }
244247 }
245248
246- if (0 < scounts [ sendto ] && 0 < sdtype_size ) {
247- err = MCA_PML_CALL (send (psnd , scounts [ sendto ] , sdtype , sendto ,
249+ if (0 < ompi_count_array_get ( scounts , sendto ) && 0 < sdtype_size ) {
250+ err = MCA_PML_CALL (send (psnd , ompi_count_array_get ( scounts , sendto ) , sdtype , sendto ,
248251 MCA_COLL_BASE_TAG_ALLTOALLV , MCA_PML_BASE_SEND_STANDARD , comm ));
249252 if (MPI_SUCCESS != err ) {
250253 line = __LINE__ ;
@@ -280,9 +283,9 @@ ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, co
280283 * differently and so will not have to duplicate code.
281284 */
282285int
283- ompi_coll_base_alltoallv_intra_basic_linear (const void * sbuf , const int * scounts , const int * sdisps ,
286+ ompi_coll_base_alltoallv_intra_basic_linear (const void * sbuf , ompi_count_array_t scounts , ompi_disp_array_t sdisps ,
284287 struct ompi_datatype_t * sdtype ,
285- void * rbuf , const int * rcounts , const int * rdisps ,
288+ void * rbuf , ompi_count_array_t rcounts , ompi_disp_array_t rdisps ,
286289 struct ompi_datatype_t * rdtype ,
287290 struct ompi_communicator_t * comm ,
288291 mca_coll_base_module_t * module )
@@ -313,11 +316,11 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
313316 ompi_datatype_type_extent (rdtype , & rext );
314317
315318 /* Simple optimization - handle send to self first */
316- psnd = ((char * ) sbuf ) + ( ptrdiff_t ) sdisps [ rank ] * sext ;
317- prcv = ((char * ) rbuf ) + ( ptrdiff_t ) rdisps [ rank ] * rext ;
318- if (0 < scounts [ rank ] && 0 < sdtype_size ) {
319- err = ompi_datatype_sndrcv (psnd , scounts [ rank ] , sdtype ,
320- prcv , rcounts [ rank ] , rdtype );
319+ psnd = ((char * ) sbuf ) + ompi_disp_array_get ( sdisps , rank ) * sext ;
320+ prcv = ((char * ) rbuf ) + ompi_disp_array_get ( rdisps , rank ) * rext ;
321+ if (0 < ompi_count_array_get ( scounts , rank ) && 0 < sdtype_size ) {
322+ err = ompi_datatype_sndrcv (psnd , ompi_count_array_get ( scounts , rank ) , sdtype ,
323+ prcv , ompi_count_array_get ( rcounts , rank ) , rdtype );
321324 if (MPI_SUCCESS != err ) {
322325 return err ;
323326 }
@@ -339,10 +342,10 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
339342 continue ;
340343 }
341344
342- if (0 < rcounts [ i ] && 0 < rdtype_size ) {
345+ if (0 < ompi_count_array_get ( rcounts , i ) && 0 < rdtype_size ) {
343346 ++ nreqs ;
344- prcv = ((char * ) rbuf ) + ( ptrdiff_t ) rdisps [ i ] * rext ;
345- err = MCA_PML_CALL (irecv_init (prcv , rcounts [ i ] , rdtype ,
347+ prcv = ((char * ) rbuf ) + ompi_disp_array_get ( rdisps , i ) * rext ;
348+ err = MCA_PML_CALL (irecv_init (prcv , ompi_count_array_get ( rcounts , i ) , rdtype ,
346349 i , MCA_COLL_BASE_TAG_ALLTOALLV , comm ,
347350 preq ++ ));
348351 if (MPI_SUCCESS != err ) { goto err_hndl ; }
@@ -355,10 +358,10 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
355358 continue ;
356359 }
357360
358- if (0 < scounts [ i ] && 0 < sdtype_size ) {
361+ if (0 < ompi_count_array_get ( scounts , i ) && 0 < sdtype_size ) {
359362 ++ nreqs ;
360- psnd = ((char * ) sbuf ) + ( ptrdiff_t ) sdisps [ i ] * sext ;
361- err = MCA_PML_CALL (isend_init (psnd , scounts [ i ] , sdtype ,
363+ psnd = ((char * ) sbuf ) + ompi_disp_array_get ( sdisps , i ) * sext ;
364+ err = MCA_PML_CALL (isend_init (psnd , ompi_count_array_get ( scounts , i ) , sdtype ,
362365 i , MCA_COLL_BASE_TAG_ALLTOALLV ,
363366 MCA_PML_BASE_SEND_STANDARD , comm ,
364367 preq ++ ));
0 commit comments