add diagnosis function to MPI Library