Skip to content

Commit

Permalink
Explicitly flush when writing to the terse run log (#3532)
Browse files Browse the repository at this point in the history
## Summary

The log files are block-buffered by default, so the (very small) writes
to the terse run log were only getting flushed to disk every couple
hundred lines or so.

## Additional background

The standard run log gets flushed at the end of `printGridInfo()`
whenever there's a regrid (it also prints a lot more data, so it fills
the buffer much faster).
  • Loading branch information
yut23 authored Sep 6, 2023
1 parent 30fc3f0 commit dd3bcb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/Amr/AMReX_Amr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,8 @@ Amr::coarseTimeStep (Real stop_time)
<< " DT = " << dt_level[0] << '\n';
}
if (record_run_info_terse && ParallelDescriptor::IOProcessor()) {
runlog_terse << level_steps[0] << " " << cumtime << " " << dt_level[0] << '\n';
runlog_terse << level_steps[0] << " " << cumtime << " " << dt_level[0];
runlog_terse << std::endl; // Make sure we flush!
}

int check_test = 0;
Expand Down

0 comments on commit dd3bcb8

Please sign in to comment.