Skip to content

Commit 68ac950

Browse files
committed
coll/base: fix zero size datatype handling in mca_coll_base_alltoallv_intra_basic_inplace()
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent dc24f3f commit 68ac950

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ompi/mca/coll/base/coll_base_alltoallv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
7979
/* in-place alltoallv slow algorithm (but works) */
8080
for (i = 0 ; i < size ; ++i) {
8181
for (j = i+1 ; j < size ; ++j) {
82-
if (i == rank) {
82+
if (i == rank && 0 != rcounts[j] && 0 != rdtype_size) {
8383
/* Copy the data into the temporary buffer */
8484
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[j],
8585
tmp_buffer, (char *) rbuf + rdisps[j] * ext);
@@ -92,7 +92,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
9292
j, MCA_COLL_BASE_TAG_ALLTOALLV,
9393
comm, MPI_STATUS_IGNORE);
9494
if (MPI_SUCCESS != err) { goto error_hndl; }
95-
} else if (j == rank) {
95+
} else if (j == rank && 0 != rcounts[i] && 0 != rdtype_size) {
9696
/* Copy the data into the temporary buffer */
9797
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[i],
9898
tmp_buffer, (char *) rbuf + rdisps[i] * ext);

0 commit comments

Comments
 (0)