Inconsistent shifts warning in mdrun with periodic-molecules = yes - Redmine #2275
Archive from user: Dmitri Ovodok
Running mdrun on a system with periodic molecules leads to “There were N inconsistent shifts. Check your topology.” warnings even if periodic-molecules parameter in .mdp file is explicitly set to “yes”. Those warnings, however, appear only at the end of simulation, on output configuration writing. Setting periodic-molecules to “no” leads to similar warnings during the whole simulation.
Some investigation of Gromacs source code revealed that the source of problem is one change in output configuration writing code. At that stage Gromacs seems to intend to make molecules whole before output configuration writing. This operation should fail for periodic molecules and produces for them the mentioned above “inconsistent shifts” warning. Prior to 4.5.7 version it happens only if there are no periodic molecules in the system:
// gromacs 4.5.7, src/kernel/md.c, line 1320
if (ir->epbc != epbcnone && !ir->bperiodicmols &&
domaindecomp(cr))
{
/* make molecules whole only for confout writing */
do_pbc_mtop(fplog,ir->epbc,state->box,top_global,state_global->x);
}
however, in 4.6 versions gromacs seems to check if there are periodic molecules in the system:
<code class="c
// Gromacs 4.6.7, src/kernel/md.c, line 1543
if (fr->bMolPBC)
{
/* Make molecules whole only for confout writing */
do_pbc_mtop(fplog, ir->ePBC, state->box, top_global, state_global->x);
}
That change moved to newer versions of Gromacs too (see
src/gromacs/mdlib/trajectory\_writing.cpp, line 179 as for Gromacs
2016.4).
Perhaps there should be a negation in the condition, if so, this
possible bug affects not only systems with periodic molecules but, in
other way, all the other systems too.
*(from redmine: issue id 2275, created on 2017-10-18 by gmxdefault, closed on 2017-12-11)*
* Changesets:
* Revision 53473bb9f64c7861fcb60ddb997d53ca955096bb by Berk Hess on 2017-10-20T09:48:06Z:
Fix warning for confout with periodic molecules
With periodic molecules, mdrun would, incorrectly, attempt to make molecules whole for writing the final state to confout.
Fixes #2275 (closed)
Change-Id: Ib19ca5c2ae6fcca6126773bcdd8a05c8e141c3ce