clean up mdrun log file handling - Redmine #2651
With a bit of effort, the mess that is the handling of the log file within mdrun can be cleaned up so that we open and close it in a single place, whether or not we are doing an appending restart.
This might also help implement aspects of gmxapi, or at least clarify how things can work in the long term.
(from redmine: issue id 2651, created on 2018-09-25 by mark.j.abraham, closed on 2018-10-11)
- Relations:
- parent #2585 (closed)
- Changesets:
- Revision 31f817da by Mark Abraham on 2018-09-26T19:12:53Z:
Clarify distinct paths for mdrun log file handling
Opening for appending is actually handled in the checkpointing code,
which is now explicit in mdrunner.
Also handled the error case when the log file cannot be opened.
Also removed unnecessary dependency on commrec.
Refs #2651
Change-Id: I0b8c7756a08c3d786571e7936e7f8f327fd17947
- Revision e35e44e5 by Mark Abraham on 2018-10-04T14:41:17Z:
Extract helper functions for preparing for appending
This simplifies code so we can handle the log file pointer better.
Refs #2651
Change-Id: Ifa3114d125e89bf22081b05c5e739693c996f01b
- Revision 5877facd by Mark Abraham on 2018-10-05T16:05:18Z:
Check log and other files differently during appending restart
We need to do different operations on the log file than the other
files, so it makes sense to separate those aspects of its handling,
while calling a common function for those that are common. That will
also prepare to clean up the opening of the log file in Mdrunner, so
we can do it in only one place.
Checked all the offsets were valid before doing any file operations.
Used a bit less preprocessing, too.
Refs #2651
Change-Id: I23cfba550b57d169c021d72618341ff017a3e7de
- Revision 539eca89 by Mark Abraham on 2018-10-11T08:35:38Z:
Open mdrun log file only once
The log file is now kept open with a t_fileio held RAII style, which
permits the appending restart code to truncate it if needed, so that
we don't have the opening and closing of the checkpoint file being
managed in several places.
Fixes #2651
Change-Id: I6105bf55a9a10aaf15ed2f11ef8955a47743bb91