Project

General

Profile

Bug #3400

Rerun does not calculate reciprocal energies

Added by Pascal Merz 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
High
Assignee:
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

A student in our group found that using rerun in GROMACS 2019, neither the Coulomb nor the LJ reciprocal terms are recalculated. These energies are 0, and consequently, the potential energy is missing these terms and is off compared to the original run.

The bug can be retraced to #1868, where rerun was split off and restricted to explicitly only calculate forces and potential energies, omitting kinetic energies, virial, pressure, constraints, etc. Consequently, within do_rerun, do_force did not get the GMX_FORCE_VIRIAL flag anymore. In gmx_pme_do, called from the lower level functions within do_force, the reciprocal terms are however only calculated if GMX_FORCE_VIRIAL was originally passed. I don't see a compelling reason why reciprocal energy terms and virial should be intimately linked, but maybe I'm overlooking a detail here.

Note that due to #2649, the GMX_FORCE_VIRIAL flag was reintroduced if GROMACS was compiled with GPU support, so GPU enabled builds are not affected by this bug.

The easy solution to fix this bug is to pass GMX_FORCE_VIRIAL in all cases. Moving forward, we should check whether these options can be disentangled.


Related issues

Related to GROMACS - Task #1868: implement mdrun -rerun better, simplifying do_mdClosed
Related to GROMACS - Bug #2649: Virial calculation necessary for correct energy calculation on GPUNew

Associated revisions

Revision cc055a76 (diff)
Added by Pascal Merz 6 months ago

Fix calculation of reciprocal terms in rerun

This at least temporarily fixes #3400.

Change-Id: I04d67d9bb3edbd66049573de71940e4bb7fa1ad4

History

#1 Updated by Pascal Merz 6 months ago

  • Related to Task #1868: implement mdrun -rerun better, simplifying do_md added

#2 Updated by Pascal Merz 6 months ago

  • Related to Bug #2649: Virial calculation necessary for correct energy calculation on GPU added

#3 Updated by Pascal Merz 6 months ago

NB: Our test coverage of rerun is terrible.

#4 Updated by Pascal Merz 6 months ago

  • Description updated (diff)

#5 Updated by Anonymous 6 months ago

  • Status changed from New to Resolved

#6 Updated by Pascal Merz 6 months ago

Note that the reason this was not caught by our tests is that they use the test simulation database, which only tests coulomb & vdw with straight cut-off (see src/testutils/simulationdatabase.cpp). It's worth considering - for the rerun tests, but also for other tests using this database - if we shouldn't also cover other cut-off treatments, or use PME as default.

#7 Updated by Paul Bauer 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF