Feature #2651
Feature #2585: Infrastructure supporting external API
clean up mdrun log file handling
Description
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.
Associated revisions
Extract helper functions for preparing for appending
This simplifies code so we can handle the log file pointer better.
Refs #2651
Change-Id: Ifa3114d125e89bf22081b05c5e739693c996f01b
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
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
History
#1 Updated by Mark Abraham about 1 year ago
I have a patch series mostly ready that I think CLI mdrun should anyway want to have, but I'll leave it to Eric to judge whether it actually helps him integrate anything for gmxapi and 2019 release. If not, then we should not prioritize it at this stage.
#2 Updated by Gerrit Code Review Bot about 1 year ago
Gerrit received a related patchset '1' for Issue #2651.
Uploader: Mark Abraham (mark.j.abraham@gmail.com)
Change-Id: gromacs~master~I0b8c7756a08c3d786571e7936e7f8f327fd17947
Gerrit URL: https://gerrit.gromacs.org/8422
#3 Updated by Gerrit Code Review Bot about 1 year ago
Gerrit received a related DRAFT patchset '1' for Issue #2651.
Uploader: Mark Abraham (mark.j.abraham@gmail.com)
Change-Id: gromacs~master~Ifa3114d125e89bf22081b05c5e739693c996f01b
Gerrit URL: https://gerrit.gromacs.org/8425
#4 Updated by Gerrit Code Review Bot about 1 year ago
Gerrit received a related DRAFT patchset '1' for Issue #2651.
Uploader: Mark Abraham (mark.j.abraham@gmail.com)
Change-Id: gromacs~master~I23cfba550b57d169c021d72618341ff017a3e7de
Gerrit URL: https://gerrit.gromacs.org/8426
#5 Updated by Gerrit Code Review Bot about 1 year ago
Gerrit received a related DRAFT patchset '1' for Issue #2651.
Uploader: Mark Abraham (mark.j.abraham@gmail.com)
Change-Id: gromacs~master~I6105bf55a9a10aaf15ed2f11ef8955a47743bb91
Gerrit URL: https://gerrit.gromacs.org/8427
#6 Updated by Mark Abraham about 1 year ago
- Status changed from New to Resolved
Applied in changeset 539eca89e1c4b3681c1dd2c04deb805533e268f8.
#7 Updated by Mark Abraham about 1 year ago
- Status changed from Resolved to Closed
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