Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log file/checkpoint file discord #4142

Open
camKD opened this issue Jul 12, 2023 · 2 comments
Open

log file/checkpoint file discord #4142

camKD opened this issue Jul 12, 2023 · 2 comments

Comments

@camKD
Copy link

camKD commented Jul 12, 2023

If you save checkpoint files every 1000 steps say, but the log outputs every 100 steps. Then if your simulation stops between at say 3500, your last checkpoint will be at 3000, and your log will be at 3500. Then if you restart using the checkpoint, as append to the original log file, it appears you go back in time from timestep 3500 -> 3000. Perhaps the 5 lines between 3000 and 3500 need to be deleted at this stage?

@peastman
Copy link
Member

OpenMM doesn't have any unique concept of a log file. You might choose to open a file and write information to it, perhaps with StateDataReporter or perhaps in some other way. And when restarting a simulation, you might choose to open the file in append mode. But this is really up to you. If we tried, for example, to make StateDataReporter automatically parse your existing file and identify parts to delete, that could easily lead to bad behavior and information being lost. It also isn't safe to assume that just because someone is opening a file in append mode, they're necessarily resuming from a checkpoint. The user is the only one who really knows what they want.

@sef43
Copy link
Contributor

sef43 commented Jul 13, 2023

For context this issue appeared in the workshop we ran yesterday demonstrating how you can use checkpoints: https://github.com/openmm/openmm_workshop_july2023/blob/main/section_1/protein_in_water.ipynb

openmm/openmm_workshops#10

The solution is a more sophisticated user script. The DCDReporter in append mode would have the same problem when the checkpoints are written less frequently than the trajectory frames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants