[gmx-users] Re: g_msd bug

Simon Butler s.butler at theo.chemie.tu-darmstadt.de
Wed Jul 27 00:06:14 CEST 2011


Dear Gromacsers,

This seems more suited to gmx-developers but as the original thread was on
gmx-users, I'm posting it here.

Anyway, regarding the excessive memory usage of g_msd when using the -mol
flag, as reported recently, I believe I've identified the source of the
problem: the array of per-molecule MSD data in curr->lsq. In particular, it
appears that the call to gmx_stats_add_point on line 476 is the key
offender.

I haven't the time at the moment to dig any further than this,
unfortunately, but the attached patch (gmx_msd.mem.patch) may be of
temporary use to users of g_msd. It merely comments out the call to
gmx_stats_init and the printmol routine. If anybody wishes to retain the
calculation of D for each individual molecule, they will need to recode the
data accumulation in the style of that for the overall calculation I expect.

There is also the problem of the large difference in the calculated results
when using the -mol flag, as reported by Florian. I think the cause of this
is an error in the logic within the corr_loop routine. The original sequence
is:

1. If first iteration, copy current frame to previous
2. If -mol, make molecules whole
3. Remove PBC jumps
4. If -mol, calculate molecule COMs and copy to xa array

I believe the correct order for this sequence should be 2, 4, 1, 3. The
original order results in xa[prev] containing zero for every position on
step 1 and also in the PBC step operating on an array that hasn't been
repopulated yet, with the result that jumps are not removed correctly.

I've tested the new sequence for a single PF6 molecule and for the
corresponding P atom (which is almost exactly at the COM) and obtained very
nearly identical results for each (which wasn't the case previously). I've
attached a separate patch to reorder these function calls
(gmx_msd.mol.patch). Both patches are for the v4.5.4 copy of gmx_msd.c, by
the way.

cheers,

Simon

===========================================
Dr. Simon Butler

Theorie Physikaliche Chemie
Eduard-Zintl-Institut
Technische Universität Darmstadt
Petersenstrasse 20
64287 Darmstadt
Deutschland

Tel: +49-6151-16 6537
Email: s.butler at theo.chemie.tu-darmstadt.de
===========================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20110727/a006297c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmx_msd.mem.patch
Type: text/x-patch
Size: 459 bytes
Desc: not available
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20110727/a006297c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmx_msd.mol.patch
Type: text/x-patch
Size: 591 bytes
Desc: not available
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20110727/a006297c/attachment-0001.bin>


More information about the gromacs.org_gmx-users mailing list