What exactly does MPI_IN_PLACE
do when given as an argument to MPI_Scatter
and how should it be used? I can't make sense of man MPI_Scatter
:
When the communicator is an intracommunicator, you can perform a gather operation in-place (the output buffer is used as the input buffer). Use the variable MPI_IN_PLACE as the value of the root process recvbuf. In this case, recvcount and recvtype are ignored, and the root process sends no data to itself. Because the in-place option converts the receive buffer into a send-and-receive buffer, a Fortran binding that includes INTENT must mark these as INOUT, not OUT.
What I want to do is use the same buffer that contains the data on the root as the receive buffer at each other process (like in MPI_Bcast
). Will MPI_Scatter
with MPI_IN_PLACE
let me do this?
NULL
as it is never read from. – Ironbark