Fixed wrong len resulting and made correspondences simpler by using higher level function.

They are MPI_Allreduce and MPI_Gather. They are so cool!