Added check for MPI when writing restarts and lammps files