[gmx-users] Bugs in gromacs 4

Berk Hess gmx3 at hotmail.com
Thu Nov 27 11:31:28 CET 2008




> Date: Wed, 26 Nov 2008 17:25:10 +0100
> From: H.J.risselada at rug.nl
> To: gmx-users at gromacs.org
> Subject: Re: [gmx-users] Bugs in gromacs 4
> 
> Jochen Hub wrote:
> > Jelger Risselada wrote:
> >   
> >> Finally had a look through the gromacs 4.0 source code.
> >> Don't know if this bug/points already have been reported and changed in
> >> 4.0.2:
> >>
> >> 1) There is never memory allocated for the pointers to the user defined
> >> groups:
> >>
> >> mdatoms->cU1 etc.
> >>     
> >
> > I'm not sure, but there is a
> >
> >     /* The user should fix this */
> >     if (FALSE)
> >       srenew(md->cU1,md->nalloc);
> >     if (FALSE)
> >       srenew(md->cU2,md->nalloc);
> >
> > in ./src/mdlib/mdatom.c.
> >
> > You can remove the FALSE and get the memory allocation, I guess.
> >
> > Jochen
> >
> >   
> A hardcoded if(FALSE)  in the middle of no where with the command /*The 
> user should fix this */ .
> How flexible...... ;-)
> 
> greetings
> 
> Jelger

That could indeed be done a bit more elegantly.
I committed a proper solution (see below).

Berk

    /* Note that these user t_mdatoms array pointers are NULL
     * when there is only one group present.
     * Therefore, when adding code, the user should use something like:
     * gprnrU1 = (md->cU1==NULL ? 0 : md->cU1[localatindex])
     */
    if (mtop->groups.grpnr[egcUser1] != NULL)
      srenew(md->cU1,md->nalloc);
    if (mtop->groups.grpnr[egcUser2] != NULL)
      srenew(md->cU2,md->nalloc);


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20081127/886e6ab5/attachment.html>


More information about the gromacs.org_gmx-users mailing list