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