add table print and fix file IO with MPI