From a2ff443838d1327c8399c23816ea45f138fca159 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 4 Feb 2022 18:00:47 -0500 Subject: [PATCH] Use utils::flush_buffers() in error.cpp and thermo.cpp --- src/error.cpp | 3 +-- src/thermo.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index e2162cf661..912093c865 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -213,8 +213,7 @@ void Error::one(const std::string &file, int line, const std::string &str) throw LAMMPSAbortException(mesg, world); #else - if (screen) fflush(screen); - if (logfile) fflush(logfile); + utils::flush_buffers(lmp); KokkosLMP::finalize(); MPI_Abort(world,1); exit(1); // to trick "smart" compilers into believing this does not return diff --git a/src/thermo.cpp b/src/thermo.cpp index e39d7d7c57..27d74c58b6 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -375,8 +375,7 @@ void Thermo::compute(int flag) if (me == 0) { utils::logmesg(lmp,line); - if (screen && flushflag) fflush(screen); - if (logfile && flushflag) fflush(logfile); + if (flushflag) utils::flush_buffers(lmp); } // set to 1, so that subsequent invocations of CPU time will be non-zero