removed mpi all to all from method and restored it in main