diff --git a/ompi/mpi/c/allgather.c b/ompi/mpi/c/allgather.c index 6ff788ed88..72b32737cf 100644 --- a/ompi/mpi/c/allgather.c +++ b/ompi/mpi/c/allgather.c @@ -84,7 +84,8 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, err = MPI_ERR_TYPE; } else if (recvcount < 0) { err = MPI_ERR_COUNT; - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_IN_PLACE != sendbuf) { OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount); diff --git a/ompi/mpi/c/allgatherv.c b/ompi/mpi/c/allgatherv.c index 50c55dcce5..94ef1e5a8b 100644 --- a/ompi/mpi/c/allgatherv.c +++ b/ompi/mpi/c/allgatherv.c @@ -87,7 +87,8 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, if (ompi_comm_invalid(comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_DATATYPE_NULL == recvtype) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME); diff --git a/ompi/mpi/c/allreduce.c b/ompi/mpi/c/allreduce.c index 0678657392..5559b8624c 100644 --- a/ompi/mpi/c/allreduce.c +++ b/ompi/mpi/c/allreduce.c @@ -79,7 +79,8 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, int ret = OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OP, msg); free(msg); return ret; - } else if( MPI_IN_PLACE == recvbuf ) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_BUFFER, FUNC_NAME); } else if( (sendbuf == recvbuf) && diff --git a/ompi/mpi/c/alltoall.c b/ompi/mpi/c/alltoall.c index 54b0884265..35b9f1372e 100644 --- a/ompi/mpi/c/alltoall.c +++ b/ompi/mpi/c/alltoall.c @@ -74,7 +74,8 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, if (ompi_comm_invalid(comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } else { diff --git a/ompi/mpi/c/alltoallv.c b/ompi/mpi/c/alltoallv.c index 71450775fb..8e12c33eb3 100644 --- a/ompi/mpi/c/alltoallv.c +++ b/ompi/mpi/c/alltoallv.c @@ -96,6 +96,7 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[], if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == recvcounts) || (NULL == rdispls) || + (MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } diff --git a/ompi/mpi/c/alltoallw.c b/ompi/mpi/c/alltoallw.c index c5482c74ea..e75479dd25 100644 --- a/ompi/mpi/c/alltoallw.c +++ b/ompi/mpi/c/alltoallw.c @@ -91,7 +91,8 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes) || (NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes) || - MPI_IN_PLACE == recvbuf) { + (MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } diff --git a/ompi/mpi/c/iallgather.c b/ompi/mpi/c/iallgather.c index d40e774b1b..96dba88a8d 100644 --- a/ompi/mpi/c/iallgather.c +++ b/ompi/mpi/c/iallgather.c @@ -84,7 +84,8 @@ int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, err = MPI_ERR_TYPE; } else if (recvcount < 0) { err = MPI_ERR_COUNT; - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_IN_PLACE != sendbuf) { OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount); diff --git a/ompi/mpi/c/iallgatherv.c b/ompi/mpi/c/iallgatherv.c index af00947356..4d83aba408 100644 --- a/ompi/mpi/c/iallgatherv.c +++ b/ompi/mpi/c/iallgatherv.c @@ -87,7 +87,8 @@ int MPI_Iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, if (ompi_comm_invalid(comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_DATATYPE_NULL == recvtype) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME); diff --git a/ompi/mpi/c/iallreduce.c b/ompi/mpi/c/iallreduce.c index 9dddb27803..0bceeb94b1 100644 --- a/ompi/mpi/c/iallreduce.c +++ b/ompi/mpi/c/iallreduce.c @@ -79,7 +79,8 @@ int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, int ret = OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OP, msg); free(msg); return ret; - } else if( MPI_IN_PLACE == recvbuf ) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_BUFFER, FUNC_NAME); } else if( (sendbuf == recvbuf) && diff --git a/ompi/mpi/c/ialltoall.c b/ompi/mpi/c/ialltoall.c index dcafa8505c..cf0d49b20a 100644 --- a/ompi/mpi/c/ialltoall.c +++ b/ompi/mpi/c/ialltoall.c @@ -70,7 +70,8 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, if (ompi_comm_invalid(comm)) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); - } else if (MPI_IN_PLACE == recvbuf) { + } else if ((MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || + MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_IN_PLACE == sendbuf) { diff --git a/ompi/mpi/c/ialltoallv.c b/ompi/mpi/c/ialltoallv.c index 903ff12bd4..01636bd3cf 100644 --- a/ompi/mpi/c/ialltoallv.c +++ b/ompi/mpi/c/ialltoallv.c @@ -92,6 +92,7 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == recvcounts) || (NULL == rdispls) || + (MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_IN_PLACE == sendbuf) { diff --git a/ompi/mpi/c/ialltoallw.c b/ompi/mpi/c/ialltoallw.c index b88d0a6fa0..0143ef5a7c 100644 --- a/ompi/mpi/c/ialltoallw.c +++ b/ompi/mpi/c/ialltoallw.c @@ -88,6 +88,7 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes) || (NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes) || + (MPI_IN_PLACE == sendbuf && OMPI_COMM_IS_INTER(comm)) || MPI_IN_PLACE == recvbuf) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } else if (MPI_IN_PLACE == sendbuf) {