using reduce to compute sums using MPI