Fix BEAST not checkpointing using the BEAUti checkpoint XML block #1221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for the issue of BEAST not generating any checkpoint files if specified via XML.
To test this, I used the
YFV.xml
example file and added the following checkpointing logger in the mcmc blockPROBLEM: current behavior
Currently BEAST does not generate any checkpoint files from the BEAUTi XML because:
release_parsers.properties
does not haveCheckpointLoggerParser
The
checkpointOverrule
variable is always set totrue
in BeastMainFixing the XML checkpointing
To make BEAST use the checkpointing settings in the XML I did the following:
CheckpointLoggerParser
torelease_parsers.properties
checkpointOverrule
property tofalse
in BeastMain:Fixing the fix
Changing the default to
false
opens up a new problem, because the checkpoint overrule needs to now be set totrue
when the appropriate flags are passed in the command line. So we need to decide on which command line options/flags would result in overruling the XML checkpointingBelow are all of the checkpointing related options and flags I found in BeastMain:
-full_checkpoint_precision
and-force_resume
shouldn't overrule the XML settings because they are not specified in the XML block, so I didn't do anything with them.-load_state
and-save_stem
should not overrule the XML settings so that one can resume a run from the command line without changing anything. However, they were being ignored and BEAST would always start from scratch with the XML settings instead (would not load the file nor add a checkpoint file stem).To fix this behavior, I changed the following variables from
null
in the else block of theBeastCheckpointer
constructor:Additionally, I modified the
saveState
method inBeastCheckpointer.java
so that it adds the stem to the checkpoint file name if it exists. The previous version was always saving to a new checkpoint file with name<save stem>_<state number>
:Thus, I made it so that if any of the remaining options is set, we override the XML specification:
Doing this I was able to successfully do the following:
-load_state <chkp> -save_stem <stem>
and have it continue checkpointing using the frequency and filename in the XML settings