Bug #386

confout.gro contains PBC-broken molecules after EM in parallel with domain decomposition

Added by Chris Neale about 10 years ago. Updated about 10 years ago.

Erik Lindahl
Target version:
Affected version - extra info:
Affected version:


The subject line pretty much explains it. You can use the files that I uploaded from bug 383 as a test system or pretty much any lipid bilayer or a protein in water where the protein is actually crossing PBC.

This has come up as a problem in particular for combination of mdrun EM with the script for inserting a protein into a lipid bilayer, for which the solution is to add a trjconv -pbc mol after each EM.

For more details, please refer to the related mailing list posts:


#1 Updated by Erik Lindahl about 10 years ago

This is not a bug; with domain decomposition all coordinates are local, and there is no trivial way for us to make the molecule whole (since there is no global graph).

In theory that is of course possible to add (at the cost of CPU-cycles and complexity), but from a philosophical point-of-view it is better that the raw coordinates written to the trajectory correspond to the ones actually used for the integration; otherwise it will not get binary identical results with reruns. In addition, all standard analysis programs handle the PBC automatically, so normally it is only for visualization you would want to make the molecule whole.

However, we should probably clarify this in the docs. Is there still any text around saying "gromacs does not write broken molecules"?

#2 Updated by Chris Neale about 10 years ago

I am not aware of any such mentions, just a program (i.e. that expects this. It's no problem for me once I figured out the issue, but others may run into it.

I understand from Justin on-list that a special consideration was made for confout.gro (but not for .xtc .trr) in making the molecules whole; quoting:


Now, I am no C expert, but I found the following in md.c (taken from the 4.0.5 source):

fprintf(stderr,"\nWriting final coordinates.\n");
if (ir->ePBC != epbcNONE && !ir->bPeriodicMols && DOMAINDECOMP) {
/* Make molecules whole only for confout writing */

...after which confout.gro is written.

There are no such lines in the 4.0 source, so I think this was added over the
course of later development.


And in fact confout.gro does contain whole molecules when running md, just not when running EM.

Again, I'm ok either way.


Also available in: Atom PDF