Sendbuf MPI_scatter is only relevant for the root according to mpich ,
sendbuf - send buffer address (selection significant only in the root directory)
From this discussion,
For scatter / scatter, MPI_IN_PLACE must be passed as recvbuf. For collection and most other collectives, MPI_IN_PLACE must be passed as sendbuf.
, MPI_IN_PLACE recv , .
if (rank == iroot)
MPI_Scatter(buf, sendcount, MPI_Datatype, MPI_IN_PLACE, sendcount,
MPI_Datatype, iroot, MPI_COMM_WORLD);
else
MPI_Scatter(dummy, sendcount, MPI_Datatype, buf, sendcount, MPI_Datatype,
iroot, MPI_COMM_WORLD);
buf buf recv . dummy MPI_IN_PLACE.