@@ -199,6 +199,7 @@ ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, co
199
199
mca_coll_base_module_t * module )
200
200
{
201
201
int line = -1 , err = 0 , rank , size , step = 0 , sendto , recvfrom ;
202
+ size_t sdtype_size , rdtype_size ;
202
203
void * psnd , * prcv ;
203
204
ptrdiff_t sext , rext ;
204
205
@@ -213,6 +214,14 @@ ompi_coll_base_alltoallv_intra_pairwise(const void *sbuf, const int *scounts, co
213
214
OPAL_OUTPUT ((ompi_coll_base_framework .framework_output ,
214
215
"coll:base:alltoallv_intra_pairwise rank %d" , rank ));
215
216
217
+ ompi_datatype_type_size (sdtype , & sdtype_size );
218
+ ompi_datatype_type_size (rdtype , & rdtype_size );
219
+
220
+ if (0 == sdtype_size || 0 == rdtype_size ) {
221
+ /* Nothing to exchange */
222
+ return MPI_SUCCESS ;
223
+ }
224
+
216
225
ompi_datatype_type_extent (sdtype , & sext );
217
226
ompi_datatype_type_extent (rdtype , & rext );
218
227
@@ -263,6 +272,7 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
263
272
mca_coll_base_module_t * module )
264
273
{
265
274
int i , size , rank , err , nreqs ;
275
+ size_t sdtype_size = 0 , rdtype_size = 0 ;
266
276
char * psnd , * prcv ;
267
277
ptrdiff_t sext , rext ;
268
278
ompi_request_t * * preq , * * reqs ;
@@ -280,13 +290,21 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
280
290
OPAL_OUTPUT ((ompi_coll_base_framework .framework_output ,
281
291
"coll:base:alltoallv_intra_basic_linear rank %d" , rank ));
282
292
293
+ ompi_datatype_type_size (rdtype , & rdtype_size );
294
+ ompi_datatype_type_size (sdtype , & sdtype_size );
295
+
296
+ if (0 == rdtype_size || 0 == sdtype_size ) {
297
+ /* Nothing to exchange */
298
+ return MPI_SUCCESS ;
299
+ }
300
+
283
301
ompi_datatype_type_extent (sdtype , & sext );
284
302
ompi_datatype_type_extent (rdtype , & rext );
285
303
286
304
/* Simple optimization - handle send to self first */
287
305
psnd = ((char * ) sbuf ) + (ptrdiff_t )sdisps [rank ] * sext ;
288
306
prcv = ((char * ) rbuf ) + (ptrdiff_t )rdisps [rank ] * rext ;
289
- if (0 != scounts [rank ]) {
307
+ if (0 < scounts [rank ]) {
290
308
err = ompi_datatype_sndrcv (psnd , scounts [rank ], sdtype ,
291
309
prcv , rcounts [rank ], rdtype );
292
310
if (MPI_SUCCESS != err ) {
@@ -310,7 +328,7 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
310
328
continue ;
311
329
}
312
330
313
- if (rcounts [i ] > 0 ) {
331
+ if (0 < rcounts [i ]) {
314
332
++ nreqs ;
315
333
prcv = ((char * ) rbuf ) + (ptrdiff_t )rdisps [i ] * rext ;
316
334
err = MCA_PML_CALL (irecv_init (prcv , rcounts [i ], rdtype ,
@@ -326,7 +344,7 @@ ompi_coll_base_alltoallv_intra_basic_linear(const void *sbuf, const int *scounts
326
344
continue ;
327
345
}
328
346
329
- if (scounts [i ] > 0 ) {
347
+ if (0 < scounts [i ]) {
330
348
++ nreqs ;
331
349
psnd = ((char * ) sbuf ) + (ptrdiff_t )sdisps [i ] * sext ;
332
350
err = MCA_PML_CALL (isend_init (psnd , scounts [i ], sdtype ,
0 commit comments