1
1

Don't invoke back-end coll functions if the count is zero (ddt

functions don't behave well when called with 0 counts)

This commit was SVN r2889.
Этот коммит содержится в:
Jeff Squyres 2004-09-30 15:56:08 +00:00
родитель 1f668625d3
Коммит db04147154
4 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -46,6 +46,14 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
/* Can we optimize? Everyone had to give the same send signature,
which means that everyone must have given a sendcount > 0 if
there's anything to send. */
if (sendcount == 0) {
return MPI_SUCCESS;
}
/* Invoke the coll component to perform the back-end operation */
err = comm->c_coll.coll_allgather(sendbuf, sendcount, sendtype,

Просмотреть файл

@ -114,6 +114,12 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
}
/* If we have nothing to do, just return */
if (0 == sendcount && ompi_comm_rank(comm) != root) {
return MPI_SUCCESS;
}
/* Invoke the coll component to perform the back-end operation */
err = comm->c_coll.coll_gatherv(sendbuf, sendcount, sendtype, recvbuf,

Просмотреть файл

@ -90,6 +90,13 @@ int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
}
/* If we have nothing to receive, return success (everyone must
have given the same recvcount) */
if (0 == recvcount) {
return MPI_SUCCESS;
}
/* Invoke the coll component to perform the back-end operation */
err = comm->c_coll.coll_scatter(sendbuf, sendcount, sendtype, recvbuf,

Просмотреть файл

@ -118,6 +118,12 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
}
}
/* If we have nothing to do, just return */
if (0 == recvcount && ompi_comm_rank(comm) != root) {
return MPI_SUCCESS;
}
/* Invoke the coll component to perform the back-end operation */
err = comm->c_coll.coll_scatterv(sendbuf, sendcounts, displs, sendtype,