MPI implementation of Map-reduce