Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serious bugs in passing virial back to gromacs #132

Closed
GiovanniBussi opened this issue Mar 23, 2015 · 0 comments
Closed

Serious bugs in passing virial back to gromacs #132

GiovanniBussi opened this issue Mar 23, 2015 · 0 comments

Comments

@GiovanniBussi
Copy link
Member

I just found two serious bugs in passing virial back to gromacs.

  • When not computing energies, plumed virial is actually not felt by gromacs.

More precisely, an input such as
v: VOLUME
RESTRAINT ARG=v AT=0.0 SLOPE=xxx
gives always the same trajectory independently of xxx

I guess this problem was introduced due to the optimization of gromacs load balancing with plumed (with patch in plumed 2.0.2). Notice that if ENERGY CV is used the optimization is removed and the problem is different (see point 2 below). It is very difficult to track these problems without regtests on patched codes. Moreover, the effect of bias on virial is tiny is many practical cases (e.g. a few torsion biased) and becomes relevant mostly when using VOLUME CV, which is certainly not common for people using gromacs+plumed for biomolecular systems.

  • When computing energies, plumed virial felt by gromacs seems wrong by a factor 2

More precisely, an input such as
v: VOLUME
e: ENERGY
RESTRAINT ARG=v AT=0.0 SLOPE=xxx
PRINT FILE=e ARG=e # this is just to force plumed to ask energy to gromacs at every step

should be usable to compensate a change in pressure in gromacs barostat. Indeed, an increase in barostat pressure by 1000 bar should be exactly compensated by a SLOPE=-66.02. Actually, it is compensated with a SLOPE=-33.01, indicating that gromacs assumes the virial to be half of what plumed computes. Also notice that the two trajectories (press=1bar+SLOPE=0 and press=1001bar+SLOPE=-33.01) are not exactly identical. I do not understand this, but there might be some small issue with unit conversions.

Both these bugs (no plumed virial in case 1, doubled plumed virial in case 2) are expected to affect results of MD at constant pressure when using VOLUME or CELL CVs or, likely, when biasing a huge number of variables (e.g. coordination of solvent with solvent). I would expect errors to be extremely small in all other cases.

I think this should be fixed inside gromacs patch, since fixing it from plumed would affect other codes.

Moreover, this calls for more tests including virial contribution when plumed is combined with other MD codes.

GiovanniBussi added a commit that referenced this issue Mar 23, 2015
Same as 423d49b applied to gmx 5.0

Needs gromacs to be repatched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant