Use the Same Buffer for MPI sendbuf and recvbuf

According to MPI_AllReduce man page and MPI doc MPI_IN_PLACE can be used to specify the same buffer for sendbuf and recvbuf as long as you are working inside the same group.

The call would look like:

// Some operations to calculate `rho` for each process.
double rho[1024] = ...;

MPI_Allreduce(MPI_IN_PLACE, rho, 1024, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);