diff --git a/src/main.cpp b/src/main.cpp index 8e8e1ee3b0..26f12683b9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,9 +64,15 @@ int main(int argc, char **argv) exit(1); } #else - LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD); - lammps->input->file(); - delete lammps; + try { + LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD); + lammps->input->file(); + delete lammps; + } catch(fmt::format_error &fe) { + fprintf(stderr,"fmt::format_error: %s\n", fe.what()); + MPI_Abort(MPI_COMM_WORLD, 1); + exit(1); + } #endif MPI_Barrier(MPI_COMM_WORLD); MPI_Finalize();