Merge pull request #1536 from kawashima-fj/pr/inplace-fix
mpi/c, mpi/fortran: Fix `MPI_IN_PLACE`-related bugs
Этот коммит содержится в:
Коммит
2374d8fcf7
@ -89,6 +89,12 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
|
||||
FUNC_NAME);
|
||||
}
|
||||
|
||||
if (MPI_IN_PLACE == sendbuf) {
|
||||
sendcounts = recvcounts;
|
||||
sdispls = rdispls;
|
||||
sendtype = recvtype;
|
||||
}
|
||||
|
||||
if ((NULL == sendcounts) || (NULL == sdispls) ||
|
||||
(NULL == recvcounts) || (NULL == rdispls) ||
|
||||
(MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) ||
|
||||
@ -103,10 +109,8 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
|
||||
|
||||
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (MPI_IN_PLACE != sendbuf) {
|
||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcounts[i]);
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
|
||||
memchecker_datatype(recvtypes[i]);
|
||||
ompi_datatype_type_extent(recvtypes[i], &recv_ext);
|
||||
memchecker_call(&opal_memchecker_base_isaddressable,
|
||||
(char *)(recvbuf)+sdispls[i]*recv_ext,
|
||||
(char *)(recvbuf)+rdispls[i]*recv_ext,
|
||||
recvcounts[i], recvtypes[i]);
|
||||
}
|
||||
);
|
||||
@ -85,6 +85,12 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
|
||||
FUNC_NAME);
|
||||
}
|
||||
|
||||
if (MPI_IN_PLACE == sendbuf) {
|
||||
sendcounts = recvcounts;
|
||||
sdispls = rdispls;
|
||||
sendtypes = recvtypes;
|
||||
}
|
||||
|
||||
if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes) ||
|
||||
(NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes) ||
|
||||
(MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) ||
|
||||
@ -99,10 +105,8 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
|
||||
|
||||
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (MPI_IN_PLACE != sendbuf) {
|
||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]);
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]);
|
||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ void ompi_alltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
|
||||
--size;
|
||||
}
|
||||
|
||||
/* Alltoallw does not support MPI_IN_PLACE */
|
||||
sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
|
||||
sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
|
||||
recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
|
||||
|
||||
|
@ -80,7 +80,7 @@ void ompi_exscan_f(char *sendbuf, char *recvbuf, MPI_Fint *count,
|
||||
c_type = PMPI_Type_f2c(*datatype);
|
||||
c_op = PMPI_Op_f2c(*op);
|
||||
|
||||
/* MPI_IN_PLACE is not supported */
|
||||
sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
|
||||
sendbuf = (char *) OMPI_F2C_BOTTOM (sendbuf);
|
||||
recvbuf = (char *) OMPI_F2C_BOTTOM (recvbuf);
|
||||
|
||||
|
@ -99,7 +99,7 @@ void ompi_ialltoallw_f(char *sendbuf, MPI_Fint *sendcounts,
|
||||
--size;
|
||||
}
|
||||
|
||||
/* Ialltoallw does not support MPI_IN_PLACE */
|
||||
sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
|
||||
sendbuf = (char *) OMPI_F2C_BOTTOM(sendbuf);
|
||||
recvbuf = (char *) OMPI_F2C_BOTTOM(recvbuf);
|
||||
|
||||
|
@ -81,7 +81,7 @@ void ompi_iexscan_f(char *sendbuf, char *recvbuf, MPI_Fint *count,
|
||||
c_type = PMPI_Type_f2c(*datatype);
|
||||
c_op = PMPI_Op_f2c(*op);
|
||||
|
||||
/* MPI_IN_PLACE is not supported */
|
||||
sendbuf = (char *) OMPI_F2C_IN_PLACE(sendbuf);
|
||||
sendbuf = (char *) OMPI_F2C_BOTTOM (sendbuf);
|
||||
recvbuf = (char *) OMPI_F2C_BOTTOM (recvbuf);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user