[WIP] Fail fast if prepare fails in external engines
#1118
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.
The
preparecommand 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 thepreparestep 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
gmxin the$PATH.)