catch format errors and print suitable error message

This commit is contained in:
Axel Kohlmeyer
2021-03-05 18:04:05 -05:00
parent 0e6736b614
commit 08a25af1c9

View File

@ -64,9 +64,15 @@ int main(int argc, char **argv)
exit(1);
}
#else
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();