[gmx-developers] freeing nbnxn_atomdata_t array
Sikandar Mashayak
mashayak at votca.org
Tue Jun 16 21:31:01 CEST 2015
Thanks, I understand now.
Thanks,
Sikandar
On Thu, Jun 11, 2015 at 4:00 AM, <
gromacs.org_gmx-developers-request at maillist.sys.kth.se> wrote:
> Send gromacs.org_gmx-developers mailing list submissions to
> gromacs.org_gmx-developers at maillist.sys.kth.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
>
> or, via email, send a message with subject or body 'help' to
> gromacs.org_gmx-developers-request at maillist.sys.kth.se
>
> You can reach the person managing the list at
> gromacs.org_gmx-developers-owner at maillist.sys.kth.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gromacs.org_gmx-developers digest..."
>
>
> Today's Topics:
>
> 1. Re: freeing nbnxn_atomdata_t array
> (Mirabzadeh, Christopher (mira2978 at vandals.uidaho.edu))
> 2. Re: freeing nbnxn_atomdata_t array (Mark Abraham)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 10 Jun 2015 17:23:16 +0000
> From: "Mirabzadeh, Christopher (mira2978 at vandals.uidaho.edu)"
> <mira2978 at vandals.uidaho.edu>
> To: "gmx-developers at gromacs.org" <gmx-developers at gromacs.org>
> Subject: Re: [gmx-developers] freeing nbnxn_atomdata_t array
> Message-ID: <FD00D4BF-6654-496F-9A18-97FA5AAD6DEC at vandals.uidaho.edu>
> Content-Type: text/plain; charset="utf-8"
>
> I?m not sure what file you are editing but I?ll attempt an answer at this.
> What I?ve noticed is that there is a Gromacs wrapper for free() called
> ?sfree()?. I can?t recall where I?ve found it defined but I?ve used it in
> my own code to free memory allocated for arrays. What you may find is that
> the array is either freed in the .c file that you are editing, or you may
> find that it is freed where it is initialized, if a pointer. In my own
> project, the arrays that I am taking advantage of are defined and freed in
> src/gromacs/gmxlib/typedefs.c.
>
> If the file you are editing is a .cpp, the garbage collection may be
> automatic, but that depends on the structure type.
>
> I hope that helps!
>
> Cheers,
>
> -ChrisM
>
> Mirabzadeh, Christopher
> Research Assistant/Physics Instructor
> Department of Physics
> University of Idaho
> Moscow, Id
> (509)339-5647
>
>
>
> On Jun 9, 2015, at 3:26 PM, Sikandar Mashayak <mashayak at votca.org<mailto:
> mashayak at votca.org>> wrote:
>
> Hi,
>
> I am trying to find out the location in the source code where the arrays,
> e..g, real *x, of the structure nbnxn_atomdata_t are freed? Are they freed
> explicitly or they are automatically deallocated when the program ends.
>
> Thanks,
> Sikandar
> --
> Gromacs Developers mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
> or send a mail to gmx-developers-request at gromacs.org<mailto:
> gmx-developers-request at gromacs.org>.
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20150610/c8dc893c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Wed, 10 Jun 2015 18:15:46 +0000
> From: Mark Abraham <mark.j.abraham at gmail.com>
> To: gmx-developers at gromacs.org
> Subject: Re: [gmx-developers] freeing nbnxn_atomdata_t array
> Message-ID:
> <
> CAMNuMAQEFaKs8BbLnSvBhqiKB+BqCDUbtycqNkNPT+EMPG1zmw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> On Wed, Jun 10, 2015 at 7:23 PM Mirabzadeh, Christopher (
> mira2978 at vandals.uidaho.edu) <mira2978 at vandals.uidaho.edu> wrote:
>
> > I?m not sure what file you are editing but I?ll attempt an answer at
> > this. What I?ve noticed is that there is a Gromacs wrapper for free()
> > called ?sfree()?. I can?t recall where I?ve found it defined but I?ve
> used
> > it in my own code to free memory allocated for arrays. What you may find
> is
> > that the array is either freed in the .c file that you are editing, or
> you
> > may find that it is freed where it is initialized, if a pointer. In my
> own
> > project, the arrays that I am taking advantage of are defined and freed
> in
> > src/gromacs/gmxlib/typedefs.c.
> >
> > If the file you are editing is a .cpp, the garbage collection may be
> > automatic, but that depends on the structure type.
> >
>
> No, mdrun likely will never do garbage collection, for multiple reasons.
> Various smart pointers are on the way in, but if you're allocating heap
> memory each MD step then you need to go and re-think the pace of your life
> ;-)
>
> I hope that helps!
> >
> > Cheers,
> >
> > -ChrisM
> >
> > Mirabzadeh, Christopher
> > Research Assistant/Physics Instructor
> > Department of Physics
> > University of Idaho
> > Moscow, Id
> > (509)339-5647
> >
> >
> >
> > On Jun 9, 2015, at 3:26 PM, Sikandar Mashayak <mashayak at votca.org>
> wrote:
> >
> > Hi,
> >
> > I am trying to find out the location in the source code where the
> arrays,
> > e..g, real *x, of the structure nbnxn_atomdata_t are freed?
> >
> >
> Probably they are not freed (because mdrun is currently built to be good
> enough to run a single simulation and then terminate), but the intent is to
> allocate and free such arrays using the function pointer members of
> nbnxn_atomdata_t. Search for alloc and free in nbnxn_atomdata.c
>
>
> > Are they freed explicitly or they are automatically deallocated when the
> > program ends.
> >
> > Unix processes have their memory reclaimed by the OS when they terminate;
> currently there is no "destructor" ever called for such arrays. That's
> dirty, but sufficient what is currently normal GROMACS usage.
>
> Mark
>
>
> > Thanks,
> > Sikandar
> > --
> > Gromacs Developers mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
> > or send a mail to gmx-developers-request at gromacs.org.
> >
> >
> >
> > --
> > Gromacs Developers mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
> > or send a mail to gmx-developers-request at gromacs.org.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20150610/95dd5c81/attachment-0001.html
> >
>
> ------------------------------
>
> --
> Gromacs Developers mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
> or send a mail to gmx-developers-request at gromacs.org.
>
> End of gromacs.org_gmx-developers Digest, Vol 134, Issue 20
> ***********************************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20150616/334a3df0/attachment.html>
More information about the gromacs.org_gmx-developers
mailing list