[gmx-developers] size of out->f array
mark.j.abraham at gmail.com
Tue Jun 30 22:22:24 CEST 2015
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.
On Tue, Jun 30, 2015 at 10:03 PM Sikandar Mashayak <mashayak at votca.org>
> 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.
> Gromacs Developers mailing list
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> * For (un)subscribe requests visit
> or send a mail to gmx-developers-request at gromacs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers