coll/base: fix mca_coll_base_alltoallv_intra_basic_inplace()
correctly handle the case when a MPI task has no data to send/recv Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
7185567d50
Коммит
26f44da429
@ -54,13 +54,15 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
|
|||||||
ompi_datatype_type_size(rdtype, &rdtype_size);
|
ompi_datatype_type_size(rdtype, &rdtype_size);
|
||||||
|
|
||||||
/* If only one process, we're done. */
|
/* If only one process, we're done. */
|
||||||
if (1 == size || 0 == rdtype_size) {
|
if (1 == size) {
|
||||||
return MPI_SUCCESS;
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the largest receive amount */
|
/* Find the largest receive amount */
|
||||||
ompi_datatype_type_extent (rdtype, &ext);
|
ompi_datatype_type_extent (rdtype, &ext);
|
||||||
for (i = 0, max_size = 0 ; i < size ; ++i) {
|
for (i = 0, max_size = 0 ; i < size ; ++i) {
|
||||||
|
if (i == rank) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
size_t size = opal_datatype_span(&rdtype->super, rcounts[i], &gap);
|
size_t size = opal_datatype_span(&rdtype->super, rcounts[i], &gap);
|
||||||
max_size = size > max_size ? size : max_size;
|
max_size = size > max_size ? size : max_size;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user