abort when there was an error writing to the dump file

This commit is contained in:
Axel Kohlmeyer
2022-06-30 15:57:47 -04:00
parent 0ae6f1c30e
commit ff56f75fca

View File

@ -332,6 +332,7 @@ void Dump::write()
// if file per timestep, open new file
if (multifile) openfile();
if (fp) clearerr(fp);
// simulation box bounds
@ -519,6 +520,8 @@ void Dump::write()
if (filewriter && fp != nullptr) write_footer();
if (fp && ferror(fp)) error->one(FLERR,"Error writing dump {}: {}", id, utils::getsyserror());
// if file per timestep, close file if I am filewriter
if (multifile) {