diff --git a/ompi/mpi/c/gather.c b/ompi/mpi/c/gather.c index 898579f62e..38275a383d 100644 --- a/ompi/mpi/c/gather.c +++ b/ompi/mpi/c/gather.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,7 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } else if ((ompi_comm_rank(comm) != root && MPI_IN_PLACE == sendbuf) || - MPI_IN_PLACE == recvbuf) { + (ompi_comm_rank(comm) == root && MPI_IN_PLACE == recvbuf)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } @@ -118,7 +119,7 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, (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)) { + 0 == recvcount)) { return MPI_SUCCESS; } diff --git a/ompi/mpi/c/gatherv.c b/ompi/mpi/c/gatherv.c index 66befe91fa..3a5be2aaf5 100644 --- a/ompi/mpi/c/gatherv.c +++ b/ompi/mpi/c/gatherv.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,7 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } else if ((ompi_comm_rank(comm) != root && MPI_IN_PLACE == sendbuf) || - MPI_IN_PLACE == recvbuf) { + (ompi_comm_rank(comm) == root && MPI_IN_PLACE == recvbuf)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } diff --git a/ompi/mpi/c/reduce.c b/ompi/mpi/c/reduce.c index c3e24ac72b..0a0ef3d0d0 100644 --- a/ompi/mpi/c/reduce.c +++ b/ompi/mpi/c/reduce.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -55,8 +56,8 @@ int MPI_Reduce(void *sendbuf, void *recvbuf, int count, int ret = OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OP, msg); free(msg); return ret; - } else if ((root != ompi_comm_rank(comm) && MPI_IN_PLACE == sendbuf) || - MPI_IN_PLACE == recvbuf) { + } else if ((ompi_comm_rank(comm) != root && MPI_IN_PLACE == sendbuf) || + (ompi_comm_rank(comm) == root && MPI_IN_PLACE == recvbuf)) { err = MPI_ERR_ARG; } else { OMPI_CHECK_DATATYPE_FOR_SEND(err, datatype, count); diff --git a/ompi/mpi/c/scatter.c b/ompi/mpi/c/scatter.c index d3881a19c9..441c9e2069 100644 --- a/ompi/mpi/c/scatter.c +++ b/ompi/mpi/c/scatter.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -46,7 +47,7 @@ int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } else if ((ompi_comm_rank(comm) != root && MPI_IN_PLACE == recvbuf) || - MPI_IN_PLACE == sendbuf) { + (ompi_comm_rank(comm) == root && MPI_IN_PLACE == sendbuf)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); } diff --git a/ompi/mpi/c/scatterv.c b/ompi/mpi/c/scatterv.c index 608c613e81..7ace4b8ccd 100644 --- a/ompi/mpi/c/scatterv.c +++ b/ompi/mpi/c/scatterv.c @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +46,7 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME); } else if ((ompi_comm_rank(comm) != root && MPI_IN_PLACE == recvbuf) || - MPI_IN_PLACE == sendbuf) { + (ompi_comm_rank(comm) == root && MPI_IN_PLACE == sendbuf)) { return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME); }