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

Try to detect dynamics errors post-segment #116

Open
salotz opened this issue Oct 27, 2023 · 2 comments
Open

Try to detect dynamics errors post-segment #116

salotz opened this issue Oct 27, 2023 · 2 comments
Assignees

Comments

@salotz
Copy link
Collaborator

salotz commented Oct 27, 2023

In some cases dynamics segments (with OpenMM) can return NaNs which then propagate throughout the other code until something hits it that can't handle NaNs which may be far down the chain from the dynamics itself.

This happens when you've interpreted the units for an input file incorrectly (angstroms in the file, assumed to be nanometers by OpenMM), or when a simulation "explodes" when you've constructed it in an "incorrect" but structurally valid way.

In any case it would be very useful to have some simple checks for NaNs at the end of each segment.

Its unclear what the action should be though. The obvious ones are:

  • log a warning
  • raise an error

The logging one is nice in case you have specifically expected this (not sure this is a real use case) or is otherwise not actually an issue. If you do get some blowup later you can check the log and see if NaNs were observed, and where/when.

The error is nice in that you know exactly where things went "wrong", however that makes it inflexible to get around if you really need to.

Its also unclear where this check should be done. Should the runner check? Should there be an optional filter post MD (or perhaps a post_cycle hook with custom logic or common options), etc.

At minimum we could start with the runner logging this kind of observation since that is non-invasive and would aid in debugging.

@salotz salotz self-assigned this Oct 27, 2023
@alexrd
Copy link
Collaborator

alexrd commented Oct 27, 2023

In my experience OpenMM already checks and raises an error ("particle coordinate is NaN!"). But I think there could be some work to do in wepy for dealing with failed segments more gracefully.

@salotz
Copy link
Collaborator Author

salotz commented Oct 28, 2023

Yes that is true, I remembered/realized after I posted this. I might have been getting NaNs somewhere else.

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

No branches or pull requests

2 participants