Newsgroups: comp.parallel.mpi
From: neely@crevasse.llnl.gov (Rob Neely)
Subject: Overlapping send and receive buffers in collective comm
Organization: Lawrence Livermore Nat'l Laboratory, CA
Date: 2 Nov 1994 20:41:39 GMT
Message-ID: <398ti3$2g5@lll-winken.llnl.gov>

Is it legal to do "in place" gathering using the gather/gatherv
functions?   That is, I want my send buffer to overlap with my receive
buffer on the root node.

For example, each processor contains an array "A" which is of the
complete problem size, but only computes an independent piece of it
(say, 10 elements). One would like to be able to gather the entire array
"A" at the root using something like (fortran-style):

call mpi_gather(A((me+1)*10), 10, type, A, 10, type, 0, MPI_COMM_WORLD, ierr)

thus avoiding the extra buffers and copying which would be required if
the send and receive buffers must not overlap on the root.

Is this allowed?  All of the examples I've seen use separate send and
receive buffers, but the standard does not explicitly say (at least that
I can find).  

Thanks.

--Rob Neely, LLNL
--rneely@llnl.gov

