Several issues with Velocity Verlet and nstcalcenergy>1
The md-vv integrator computes energies when step-1 is a multiple of nstcalcenergy. A comment in the code says that this is because the first part of the loop belongs to the previous step. But several other booleans, among which energy file writing, free-energy and expanded ensemble use step and not step-1 to decide at which step to do things. So it looks like energies written to file and used for free-energy and expanded ensemble are outdated by nstcalcenergy-1 steps or can be zero or partially filled (at least in case of expanded ensemble).
My suggestion is to force nstcalcenergy=1 with md-vv in mdrun.
Work around expanded ensemble issues
Two bugs could cause expanded ensemble sampling to use
outdated or zero energies. In these cases mdrun now modifies
nstcalcenergy to 1 to avoid these bugs.
Note: This change should not be merged upstream, since there
is a proper fix for release-2019.
#7 Updated by Pascal Merz 9 months ago
Mark Abraham wrote:
@Pascal Are there ways to use the ensemble validation machinery on such cases?
Depends what goes wrong exactly:
- If the energies are only shifted by a certain amount of steps, ensemble validation will not catch it (since the values are not wrong, just at a different time).
- If a single energy value is zero or off (e.g. because some energy contributions were zero at the first writeout step), it will likely not be caught (single outlier in statistic).
- If the energies are systematically zero or off (e.g. because some or all energy contributions are always zero), it's likely to be caught. Important to keep in mind, however, that the only way we have to check distribution of potential energies via their relative distributions at different temperatures - we could certainly design a case in which we calculate wrong energies with correct temperature-dependency, which we wouldn't be able to catch.