[gmx-developers] size of out->f array
Sikandar Mashayak
mashayak at votca.org
Tue Jun 30 22:46:33 CEST 2015
Thanks Mark,
In that case, if I were to copy the data from out->f to another array (say
real *ftmp) then the size of the ftmp must be nbat->nalloc*fstride.
Thanks,
Sikandar
On Tue, Jun 30, 2015 at 2:22 PM, Mark Abraham <mark.j.abraham at gmail.com>
wrote:
> Hi,
>
> This is "just" like std::vector. There's a number of elements in the array
> and a size to the storage. Reallocation is something you want to avoid
> (particularly for high-performance multi-threaded code), so you
> over-allocate the size when you first know the number, and hope you will
> never need to re-allocate.
>
> Mark
>
> On Tue, Jun 30, 2015 at 10:03 PM Sikandar Mashayak <mashayak at votca.org>
> wrote:
>
>> Hi,
>>
>> I am a bit confused about length/size of the out->f , x, and q arrays.
>> Looking at the data structures in the nbnxn_pairlist.h, there are two size
>> related variables, natoms and nalloc. And in nbnxn_atomdata.c, when f, x,
>> and q arrays are reallocated they are passed nalloc*stride size value. Does
>> that mean the actual size is nalloc*stride or natoms*stride? Also, I
>> noticed nalloc and natoms may not be the same.
>>
>> 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/20150630/57cff2f2/attachment-0001.html>
More information about the gromacs.org_gmx-developers
mailing list