Skip to content

Commit b0001e9

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]> (back-ported from commit 68ac950)
1 parent 2ed2a68 commit b0001e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ompi/mca/coll/base/coll_base_alltoallv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2013 Los Alamos National Security, LLC. All Rights
1515
* reserved.
1616
* Copyright (c) 2013 FUJITSU LIMITED. All rights reserved.
17-
* Copyright (c) 2014-2016 Research Organization for Information Science
17+
* Copyright (c) 2014-2017 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
1919
* $COPYRIGHT$
2020
*
@@ -78,7 +78,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
7878
/* in-place alltoallv slow algorithm (but works) */
7979
for (i = 0 ; i < size ; ++i) {
8080
for (j = i+1 ; j < size ; ++j) {
81-
if (i == rank && rcounts[j]) {
81+
if (i == rank && 0 != rcounts[j] && 0 != rdtype_size) {
8282
/* Copy the data into the temporary buffer */
8383
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[j],
8484
tmp_buffer, (char *) rbuf + rdisps[j] * ext);
@@ -93,7 +93,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
9393
j, MCA_COLL_BASE_TAG_ALLTOALLV, MCA_PML_BASE_SEND_STANDARD,
9494
comm));
9595
if (MPI_SUCCESS != err) { goto error_hndl; }
96-
} else if (j == rank && rcounts[i]) {
96+
} else if (j == rank && 0 != rcounts[i] && 0 != rdtype_size) {
9797
/* Copy the data into the temporary buffer */
9898
err = ompi_datatype_copy_content_same_ddt (rdtype, rcounts[i],
9999
tmp_buffer, (char *) rbuf + rdisps[i] * ext);

0 commit comments

Comments
 (0)