Viscosity and nstenergy

GROMACS version: 2025.2
GROMACS modification: No

Hi

I am trying to calculate viscosity using the Einstein relation. Unfortunately in the LAN I am working in there appear to be some shakey connections, and ever so often I get corrupted energy files. For this reason I thought about writing energy files less frequently (which, according to the online documentation (see below) should not matter, as long as I use the same, and a small, nstcalcenergy value).
However, it seems as if viscosity from the Einstein relation does depend on nstenergy. I did a test, converting a large edr file into smaller ones using the enevonv -dt option - corresponding essentially to mdrun output with larger nstenergy values. For the original run I used nstenergy=100; the new edr files effectively correspond to nstenergy=200, 400, 800, etc.)
When I then calculate viscosity with energy -evisco I get quite different results, depending on the choice for the dt parameter, i.e. on the number of data sets that are effectively contained in the edr file. Can it be that, using enevonv, some information required here is lost (I do get a warnings,
saying: WARNING: “missing energy sums at time …”)? If so, would I find less or no dependence of calculated viscosities on nstenergy, if I used edr files that are un-moified output from mdrun runs with different nstenergy parameters, for otherwise identical systems.?

online, here:

it says:
“It is most convenient to use the Einstein relation. Because gmx mdrun stores averages of quantities
computed every nstcalcenergy steps, the Einstein relation can use these averages and thus writing
to energy file (nstenergy) can be done infrequently. This avoids the overhead of very large energy
files that are needed with the autocorrelation function approach.”

Thanks for any help/advice!
Michael

You need the sums, which are over nstcalcenergy steps, to get accurate estimates. If you have missing energy sums you will loose this information.

thanks for the swift reply! - so understand that if i choose a larger value for nstenergy to start with, then I should get what I want - is that true for an arbitrarily large value as long as nstenergy<=nsteps, or is there a limit?

You want to have sufficient restart points to average over, say at least 100. I don’t see a point in reducing the number of energy frames that much. (But storing sums has a major advantage of not needing nstenergy=5)