Commit cc4b0952 authored by Igor Ivanov's avatar Igor Ivanov Committed by Pavan Balaji
Browse files

mpi/coll: Fix incorrect parameter check



Fixed wrong parameter check condition for MPI_Iallgather and MPI_Iallgatherv
-1 is valid value for sendcount in case MPI_IN_PLACE
MPI spec says:
The in place option for intracommunicators is specified by passing the value
MPI_IN_PLACE to the argument sendbuf at all processes. In such a case, sendcount and
sendtype are ignored, and the input data of each process is assumed to be in the area where
that process would receive its own contribution to the receive buffer.
Signed-off-by: default avatarIgor Ivanov <Igor.Ivanov@itseez.com>
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent f38b5131
...@@ -675,9 +675,10 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, ...@@ -675,9 +675,10 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{ {
MPID_BEGIN_ERROR_CHECKS MPID_BEGIN_ERROR_CHECKS
{ {
if (sendbuf != MPI_IN_PLACE) if (sendbuf != MPI_IN_PLACE) {
MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno); MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno);
MPIR_ERRTEST_COUNT(sendcount, mpi_errno); MPIR_ERRTEST_COUNT(sendcount, mpi_errno);
}
MPIR_ERRTEST_DATATYPE(recvtype, "recvtype", mpi_errno); MPIR_ERRTEST_DATATYPE(recvtype, "recvtype", mpi_errno);
MPIR_ERRTEST_COMM(comm, mpi_errno); MPIR_ERRTEST_COMM(comm, mpi_errno);
......
...@@ -779,8 +779,10 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v ...@@ -779,8 +779,10 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, v
{ {
MPID_BEGIN_ERROR_CHECKS MPID_BEGIN_ERROR_CHECKS
{ {
if (sendbuf != MPI_IN_PLACE) if (sendbuf != MPI_IN_PLACE) {
MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno); MPIR_ERRTEST_DATATYPE(sendtype, "sendtype", mpi_errno);
MPIR_ERRTEST_COUNT(sendcount, mpi_errno);
}
MPIR_ERRTEST_DATATYPE(recvtype, "recvtype", mpi_errno); MPIR_ERRTEST_DATATYPE(recvtype, "recvtype", mpi_errno);
MPIR_ERRTEST_COMM(comm, mpi_errno); MPIR_ERRTEST_COMM(comm, mpi_errno);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment