Dear Gromacsers,<div><br></div><div>This seems more suited to gmx-developers but as the original thread was on gmx-users, I&#39;m posting it here.</div><div><br></div><div>Anyway, regarding the excessive memory usage of g_msd when using the -mol flag, as reported recently, I believe I&#39;ve identified the source of the problem: the array of per-molecule MSD data in curr-&gt;lsq. In particular, it appears that the call to gmx_stats_add_point on line 476 is the key offender.</div>





<div><br></div><div>I haven&#39;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.</div>





<div><br></div><div>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:</div>



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



<br></div><div>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&#39;t been repopulated yet, with the result that jumps are not removed correctly.</div>



<div><br></div><div>I&#39;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&#39;t the case previously). I&#39;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.</div>



<div><br></div><div>cheers,</div><div><br></div><div>Simon</div>
<div><br clear="all">
<span style="font-family:courier new,monospace">===========================================</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Dr. Simon Butler</span><br style="font-family:courier new,monospace">





<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Theorie Physikaliche Chemie</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Eduard-Zintl-Institut</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">Technische Universität Darmstadt</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Petersenstrasse 20</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">64287 Darmstadt</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Deutschland</span><br style="font-family:courier new,monospace">





<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Tel: +49-6151-16 6537</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Email: <a href="mailto:s.butler@theo.chemie.tu-darmstadt.de" target="_blank">s.butler@theo.chemie.tu-darmstadt.de</a></span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">===========================================</span><br>
</div>