Add utils::flush_buffers()
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "text_file_reader.h"
|
||||
#include "tokenizer.h"
|
||||
#include "update.h"
|
||||
#include "universe.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@ -138,6 +139,14 @@ void utils::fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_ar
|
||||
}
|
||||
}
|
||||
|
||||
void utils::flush_buffers(LAMMPS *lmp)
|
||||
{
|
||||
if (lmp->screen) fflush(lmp->screen);
|
||||
if (lmp->logfile) fflush(lmp->logfile);
|
||||
if (lmp->universe->uscreen) fflush(lmp->universe->uscreen);
|
||||
if (lmp->universe->ulogfile) fflush(lmp->universe->ulogfile);
|
||||
}
|
||||
|
||||
/* define this here, so we won't have to include the headers
|
||||
everywhere and utils.h will more likely be included anyway. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user