Project

General

Profile

Bug #1225

dhdl is accumulated incorrectly for 1-4 interactions

Added by Michael Shirts over 4 years ago. Updated about 4 years ago.

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

Description

It appears that the dhdl contributions 1-4 interactions are being accumulated twice in cases when annihiliation free energies are computed by changing molecule types instead of using couple-mol.

It can be seen by looking at dhdl.xvg and comparing the dhdl_coulomb entry with
dhdl_coul dhdl_vdw dE=0 dE=0.1
0.0000 77.898670 -123.60308 0.0000000 6.3326005

The solution seems to be to eliminate these two lines, which does not appear to mess up other free energy calculations results that are correct.

diff --git a/src/gmxlib/bondfree.c b/src/gmxlib/bondfree.c
index 8d00179..b1b90af 100644
--- a/src/gmxlib/bondfree.c
+++ b/src/gmxlib/bondfree.c
@ -3730,8 +3730,8 @ static real calc_one_bond(FILE fplog, int thread,
v = do_nonbonded_listed(ftype, nbn, iatoms+nb0, idef->iparams, (const rvec
)x, f, fshift,
pbc, g, lambda, dvdl, md, fr, grpp, global_atom_index);

- enerd->dvdl_nonlin[efptCOUL] += dvdl[efptCOUL];
- enerd->dvdl_nonlin[efptVDW] += dvdl[efptVDW];

if (bPrintSepPot)
{

We then get the correct:

dhdl_coul     dhdl_vdw      dE=0      dE=0.1
63.326005 -55.612216 0.0000000 6.3326005

Again, I think this is the correct fix, but I'd like a second opinion that I haven't messed something up before I put it into gerrit

This should definitely be fixed before 4.6.2. I'm working with David Mobley to try to track down any other issues -- he has a wide range of systems he's been testing on, and there may be 1-2 other (smaller) issues to fix.

grompp.mdp (5.15 KB) Michael Shirts, 04/20/2013 05:43 AM

topol.top (26.9 KB) Michael Shirts, 04/20/2013 05:43 AM

conf.gro (226 KB) Michael Shirts, 04/20/2013 05:43 AM

topol.tpr (174 KB) Michael Shirts, 04/20/2013 05:43 AM

Associated revisions

Revision 53bc3a3b (diff)
Added by Michael Shirts over 4 years ago

Fixing a problem with dh/dl 1-4 interactions

In some cases, dh/dl interactions are added twice when the
couple-intermol keyword is not used.

These lines were originally removed in 7763fa8f while fixing thread
safety in free-energy calculations, but were erroneously re-introduced
in f40969c. Versions 4.6 and 4.6.1 were affected.

Fixes #1225

Change-Id: If24177833eb4a96a6c6ef0d1ecc9a23bf80a90b1

Revision bc4999e3 (diff)
Added by Michael Shirts about 4 years ago

Fixing a problem with dh/dl 1-4 interactions

In some cases, dh/dl interactions are added twice when the
couple-intermol keyword is not used.

These lines were originally removed in 7763fa8f while fixing thread
safety in free-energy calculations, but were erroneously re-introduced
in f40969c. Versions 4.6 and 4.6.1 were affected.

Fixes #1225

Change-Id: If24177833eb4a96a6c6ef0d1ecc9a23bf80a90b1

History

#1 Updated by Berk Hess over 4 years ago

  • Priority changed from High to 7

I think this issue is due to changes from you, so you should know (best) where this comes from.
Is is because the accumulation also happens at line 3958?

#2 Updated by Michael Shirts over 4 years ago

  • % Done changed from 0 to 50

Yes, the issue appears to be when the pragmas for threading the nonbondeds were introduced -- the accumulation scheme needed to be adjusted for these, and was not entirely adjusted successfully. All the simulations I tested either used couple-mol or had 1-4's too small to notice.

The fix above appears to indeed not mess anything else up. David Mobley will be doing more extensive tests over the next 2-3 days.

#3 Updated by Mark Abraham over 4 years ago

Commit f40969c seems to be the big suspect for such problems. We'll hold 4.6.2 until we don't have further suspicions about free-energy issues.

#4 Updated by Michael Shirts over 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 50 to 100

#5 Updated by Anonymous over 4 years ago

#6 Updated by Anonymous over 4 years ago

#7 Updated by Mark Abraham about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF