-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove watchdog to avoid non-deterministic parsing of AMBER output. #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - shame that watchdog didn't work, but better to have a unified solution on top of pygtail.
Yes, it's one of those things that has worked better or worse over time depending on implementation changes behind the scenes in the package. It's quite tricky, since they try to do things in a cross-platform way, so not all file system events are available on all platforms. It also seems that AMBER keeps the file open for the duration of the simulation, so it's being written as I had anticipated anyway. There are other similar solutions, but these rely on polling the file, so would also suffer from data loss depending on the polling frequency. |
Co-authored-by: William (Zhiyi) Wu <[email protected]>
This PR fixes #26 by removing the use of the watchdog package that was used to automatically parse the AMBER energy (mdinfo) file. While this works fairly well for simulations that log data infrequently, it produces non-deterministic results when updates are rapid. For example, the
mtime
resolution on macOS is larger than on Linux, so fewer data points are recorded for a simulation reporting at the same time interval. (If the interval is small enough.) We now parse the AMBER log file manually using a similar approach to the one used for other engines that we support, i.e. using pygtail to get the updated log lines, then checking those for new records of interest. I've also added a simple test to verify that the correct number of records are recorded.devel
into this branch before issuing this pull request (e.g. by runninggit pull origin devel
): [y]Suggested reviewers:
@chryswoods