Skip to content

[WIP] Fail fast if prepare fails in external engines#1118

Open
dwhswenson wants to merge 3 commits into
openpathsampling:masterfrom
dwhswenson:gmx-fast-fail-grompp
Open

[WIP] Fail fast if prepare fails in external engines#1118
dwhswenson wants to merge 3 commits into
openpathsampling:masterfrom
dwhswenson:gmx-fast-fail-grompp

Conversation

@dwhswenson

@dwhswenson dwhswenson commented Aug 8, 2022

Copy link
Copy Markdown
Member

The prepare command in external engines can be used to, e.g, create input for a given trajectory. For example, in Gromacs, this runs the grompp command to incorporate snapshot-independent information in the mdp with the specific trr snapshot.

Previously, there was no catch for an error in prepare. This meant that the engine would try to run the trajetory, and, not finding required files, would fail with the unhelpful message "engine died unexpectedly." This PR provides a clearer error message in the case that the prepare step fails.

It provides a specific error for the Gromacs engine, and a generic error for any engine that returns a non-zero result code from prepare, but which hasn't already raised the error.

EDIT: Waiting on some test coverage here, although the actual gmx is outside our normal coverage since we don't install gmx in the test env. That said, I think we need some mechanism for also testing gmx integration in CI. I think there was no official conda-forge package when we first started with gmx integration, but there is now. (We have tests that test the integration, but they skip if there's no gmx in the $PATH.)

The `prepare` command in external engines can be used to, e.g,
create input for a given trajectory. For example, in Gromacs,
this runs the grompp command to incorporate snapshot-independent
information in the mdp with the specific trr snapshot.

Previously, there was no catch for an error in `prepare`. This
meant that the engine would try to run the trajetory, and, not
finding required files, would fail with the unhelpful message
"engine died unexpectedly." This PR provides a clearer error
message in the case that the `prepare` step fails.

It provides a specific error for the Gromacs engine, and a
generic error for any engine that returns a non-zero result code
from `prepare`, but which hasn't already raised the error.
@dwhswenson dwhswenson changed the title Fail fast if prepare fails in external engines [WIP] Fail fast if prepare fails in external engines Aug 8, 2022
@codecov

codecov Bot commented Aug 8, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.75%. Comparing base (965d8a2) to head (d384179).
⚠️ Report is 238 commits behind head on master.

Files with missing lines Patch % Lines
openpathsampling/engines/external_engine.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1118      +/-   ##
==========================================
- Coverage   81.75%   81.75%   -0.01%     
==========================================
  Files         142      142              
  Lines       15612    15614       +2     
==========================================
+ Hits        12764    12765       +1     
- Misses       2848     2849       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

1 participant