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.but...@theo.chemie.tu-darmstadt.de
===========================================
474a475,476
>     /* disabled due to memory issues  */
>     /*
476a479
>     */
629c632
<           curr->lsq[curr->nrestart-1][i]  = gmx_stats_init();
---
>           curr->lsq[curr->nrestart-1][i]  = NULL; /* gmx_stats_init(); */ /* disabled due to memory issues */
811c814
<     printmol(msd,mol_file,pdb_file,index[0],top,x,ePBC,box,oenv);
---
>     /* printmol(msd,mol_file,pdb_file,index[0],top,x,ePBC,box,oenv); */ /* disabled due to memory issues  */
664a682,689
>     /* make the molecules whole */
>     if (bMol)
>       gmx_rmpbc(gpbc,natoms,box,x[cur]);
> 
>     /* calculate the molecules' centers of masses and put them into xa */
>     if (bMol)
>         calc_mol_com(gnx[0],index[0],&top->mols,&top->atoms, x[cur],xa[cur]);
>     
671,674d695
<     /* make the molecules whole */
<     if (bMol)
<       gmx_rmpbc(gpbc,natoms,box,x[cur]);
< 
689,692d709
<     /* calculate the molecules' centers of masses and put them into xa */
<     if (bMol)
<         calc_mol_com(gnx[0],index[0],&top->mols,&top->atoms, x[cur],xa[cur]);
<     
-- 
gmx-users mailing list    gmx-users@gromacs.org
http://lists.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
Please don't post (un)subscribe requests to the list. Use the 
www interface or send it to gmx-users-requ...@gromacs.org.
Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

Reply via email to