Fixes trac:430. Fix a few places where optimization checking conflicted
with the use of MPI_IN_PLACE, and make some optimization checks more correct. Thanks to Lisandro Dalcin for reporting the problems. This commit was SVN r11904. The following Trac tickets were found above: Ticket 430 --> https://svn.open-mpi.org/trac/ompi/ticket/430
Этот коммит содержится в:
родитель
35376e7afc
Коммит
17539dc154
5
NEWS
5
NEWS
@ -68,8 +68,9 @@ version 1.0.
|
||||
|
||||
- Fix for large-sized Fortran LOGICAL datatypes.
|
||||
- Fix various error checking in MPI_INFO_GET_NTHKEY and
|
||||
MPI_GROUP_TRANSLATE_RANKS. Thanks to Lisandro Dalcin for reporting
|
||||
the problem.
|
||||
MPI_GROUP_TRANSLATE_RANKS, and some collective operations
|
||||
(particularly with regards to MPI_IN_PLACE). Thanks to Lisandro
|
||||
Dalcin for reporting the problems.
|
||||
- Fix receiving messages to buffers allocated by MPI_ALLOC_MEM.
|
||||
- Fix the "tuned" collective componenete where some cases where
|
||||
MPI_BCAST could hang.
|
||||
|
@ -60,12 +60,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. */
|
||||
/* Do we need to do anything? 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 we're doing
|
||||
IN_PLACE, however, check recvcount, not sendcount. */
|
||||
|
||||
if (sendcount == 0) {
|
||||
return MPI_SUCCESS;
|
||||
if ((MPI_IN_PLACE != sendbuf && 0 == sendcount) ||
|
||||
(0 == recvcount)) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Invoke the coll component to perform the back-end operation */
|
||||
|
@ -61,10 +61,9 @@ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
|
||||
/* If the sendcount is 0, since everyone gave the same value, then
|
||||
we don't need to do anything */
|
||||
/* Do we need to do anything? */
|
||||
|
||||
if (0 == sendcount) {
|
||||
if (0 == sendcount && 0 == recvcount) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -71,17 +71,12 @@ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
|
||||
}
|
||||
}
|
||||
|
||||
/* If there's only one node, we're done */
|
||||
/* If there's only one node, or if the count is 0, we're done */
|
||||
|
||||
if (OMPI_COMM_IS_INTRA(comm) && ompi_comm_size(comm) <= 1) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Can we optimize? */
|
||||
|
||||
if (count == 0) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
if ((OMPI_COMM_IS_INTRA(comm) && ompi_comm_size(comm) <= 1) ||
|
||||
0 == count) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Invoke the coll component to perform the back-end operation */
|
||||
|
||||
|
@ -62,6 +62,14 @@ int MPI_Exscan(void *sendbuf, void *recvbuf, int count,
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
|
||||
/* Do we need to do anything? (MPI says that reductions have to
|
||||
have a count of at least 1, but at least IMB calls reduce with
|
||||
a count of 0 -- blah!) */
|
||||
|
||||
if (0 == count) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Invoke the coll component to perform the back-end operation */
|
||||
|
||||
OBJ_RETAIN(op);
|
||||
|
@ -112,12 +112,14 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
||||
}
|
||||
}
|
||||
|
||||
/* 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. */
|
||||
/* Do we need to do anything? */
|
||||
|
||||
if (sendcount == 0) {
|
||||
return MPI_SUCCESS;
|
||||
if ((0 == sendcount &&
|
||||
(ompi_comm_rank(comm) != root ||
|
||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE != sendbuf))) ||
|
||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE == sendbuf &&
|
||||
0 == recvbuf)) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* Invoke the coll component to perform the back-end operation */
|
||||
|
@ -128,12 +128,6 @@ 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,
|
||||
|
@ -81,10 +81,10 @@ int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
|
||||
}
|
||||
}
|
||||
|
||||
/* MPI-1, p114, says that each process must supply at least
|
||||
one element. But at least the Pallas benchmarks call
|
||||
MPI_REDUCE with a count of 0. So be sure to handle it. */
|
||||
|
||||
/* Do we need to do anything? (MPI says that reductions have to
|
||||
have a count of at least 1, but at least IMB calls reduce with
|
||||
a count of 0 -- blah!) */
|
||||
|
||||
if (0 == count) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
|
||||
if (size == count) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* Invoke the coll component to perform the back-end operation */
|
||||
|
||||
OBJ_RETAIN(op);
|
||||
|
@ -70,7 +70,9 @@ int MPI_Scan(void *sendbuf, void *recvbuf, int count,
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
|
||||
/* If everyone supplied count == 0, we can just return */
|
||||
/* Do we need to do anything? (MPI says that reductions have to
|
||||
have a count of at least 1, but at least IMB calls reduce with
|
||||
a count of 0 -- blah!) */
|
||||
|
||||
if (0 == count) {
|
||||
return MPI_SUCCESS;
|
||||
|
@ -107,10 +107,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) */
|
||||
/* Do we need to do anything? */
|
||||
|
||||
if (0 == recvcount) {
|
||||
if ((0 == recvcount &&
|
||||
(ompi_comm_rank(comm) != root ||
|
||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE != recvbuf))) ||
|
||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE == recvbuf &&
|
||||
0 == sendcount)) {
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -136,12 +136,6 @@ 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,
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user