From ff56f75fca7537d48a1393ea23b0c4e036fd9557 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 30 Jun 2022 15:57:47 -0400 Subject: [PATCH] abort when there was an error writing to the dump file --- src/dump.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dump.cpp b/src/dump.cpp index a354be4f04..22750ed05c 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -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) {