fixed correct matrix count when using MPI