[gmx-developers] size of out->f array
Mark Abraham
mark.j.abraham at gmail.com
Tue Jun 30 22:22:24 CEST 2015
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20150630/33c51a24/attachment.html>
More information about the gromacs.org_gmx-developers
mailing list