Fix dEkin/dl handling with multiple ranks
commit414747c947e130ac0dc58f0a587a95016dcf2e5d
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 14 Jan 2016 18:54:07 +0000 (14 19:54 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 3 Feb 2016 12:02:24 +0000 (3 13:02 +0100)
tree5c779f67f11f60dd3bab683c82569db69bbb5d14
parente2cb6cf1f1d22782760fcc50d77049a0d394044a
Fix dEkin/dl handling with multiple ranks

With non-vv integrators, enerd->dekindl was computed at
nstglobalcomm-1 step, but not accumulated across ranks unless bGStat
also happened to be true. Then at the next (ie nstglobalcomm) step,
bGStat and bEkinhOld were true, so calc_ke_part copied the values into
enerd->ekindl_old. These were then not accumulated, so sum_ekin
averaged the accumulated enerd->ekind with the non-accumulated
enerd->ekind_old to store in enerd->dvdl_lin[efptMASS]. So, it seems
likely that mass-perturbed free-energy calculations with multiple
ranks have been broken with (at least) non-vv integrators for a long
time (perhaps since 031a8b58f).

Fixes #1873

Change-Id: I262e3cfc97a50e1a343563134c7ba89539bba59a
src/gromacs/mdlib/stat.c