Proposed feature: conditional stop - Redmine #2224
(I planned to present this idea at the dev teleconf today, but couldn’t due to Pexip not liking my setu Apologies for that.)
In the recent months I have been independently asked twice whether GROMACS allows stopping a simulation when a certain condition is satisified, so I’m assuming there might be some interest in such a feature. The most obvious use case is to stop the simulation right before potential goes to infinity and save trajectories, but more generally, one can stop when two residues get too close to or too far from each other.
I have a prototype implementation, which I can post, but I would like to gauge whether people here consider such a feature useful or interesting. Rough sketch of the implementation is as follows.
mdp changes
The interface is designed in style of pull/rotational groups. A user specifies, nstepscondstop, n groups (indexed in the ndx file) and m conditions (each condition containing two groups, type, distance criterion, and distance threshold).
Types:
- minimum distance between atom pairs in the groups
- maximum distance between atom pairs in the groups
Distance criteria:
- is larger than the distance threshold
- is smaller than the distance threshold
tpxio/readir changes are very similar to pull/rotational groups.
mdrun changes
Added one if in the while loop that each nstepscondstop calls a function to check whether any of the user specified criteria is satisfied. I also had to change trajectory_writing.cpp to enable writing trajectory if simulation stops early (i.e. the current step number is not equal to the number of simulation steps requested).
seeking feedback
- Do you believe this feature would be useful?
- Any implementation suggestions?
- What other condition types could one include?
(from redmine: issue id 2224, created on 2017-08-02 by vedranmiletic)
- Relations:
- relates #1781 (closed)
- relates #2136 (closed)
- relates #1971 (closed)
- relates #2585 (closed)
- Changesets:
- Revision 806b4574 by Eric Irrgang on 2018-10-14T08:00:07Z:
Allow API access to simulation signals.
Refs #2620 for gmxapi milestone 10
Provide API client access to issue stop signals through simulation
Session resources. Stop conditions will be discovered by the simulation
when checked from within the MD loop.
Also relates to #2224 and various other works in progress.
Change-Id: I2815733d3d18bc04685dacbd8f6a3ba56e55b783