[gmx-developers] non-contiguous memory access in Gromacs?

David spoel at xray.bmc.uu.se
Wed Mar 17 07:40:46 CET 2004


On Wed, 2004-03-17 at 03:52, MailList wrote:
> David,
> 
> Thanks for your information. Could you please give me more details such as
> which file or function includes this kind of access? We are especially
> interested in those hotspots.
I'm afraid the most important source is in the inner loops
(src/gmxlib/innerc.c,innerf.f,inner.s) where the interactions between a
particle and it's neighbours are computed. Since in most cases particles
can diffuse freely, any particle can have any of the others as
neighbour. However, the coordinates are stored in a fixed array x. Thus
we need to extract a number (e.g. 100) entries from the coordinate
array, spread all over the array, and afterwards store forces in the
same manner. The order of the neighbours does not have to be ascending
either, i.e. you can have:

130, 4, 640, 782, 230 etc.

We have already at some stage tried to sort the neighbourlist, such that
the above list would behave better in terms of cache. This turned out to
be too expensive though.
> 
> Thanks again.
> 
> 
> 
> 
> 
> 
> ----- Original Message ----- 
> From: "David van der Spoel" <spoel at xray.bmc.uu.se>
> To: <gmx-developers at gromacs.org>
> Sent: Monday, March 15, 2004 1:50 AM
> Subject: Re: [gmx-developers] non-contiguous memory access in Gromacs?
> 
> 
> > On Mon, 2004-03-15 at 03:00, MailList wrote:
> > > Hi, there,
> > >
> > > I was just wondering if Gromacs have any non-contiguous memory access?
> > > For example, suppose it has a 2D array A[i,j], in C, it is row-wise
> > > access. Therefore, if the code needs to access the A[*,1] and A[*,3],
> > > then this is actually non-contiguous access.
> > >
> > Yes this happens a lot. You can notice that performance improves when
> > you add cache memory.
> >
> > > Thank you so much.
> > >
> > >
> > >
> > -- 
> > David.
> > ________________________________________________________________________
> > David van der Spoel, PhD, Assist. Prof., Molecular Biophysics group,
> > Dept. of Cell and Molecular Biology, Uppsala University.
> > Husargatan 3, Box 596,  75124 Uppsala, Sweden
> > phone: 46 18 471 4205 fax: 46 18 511 755
> > spoel at xray.bmc.uu.se spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > _______________________________________________
> > gmx-developers mailing list
> > gmx-developers at gromacs.org
> > http://www.gromacs.org/mailman/listinfo/gmx-developers
> > Please don't post (un)subscribe requests to the list. Use the
> > www interface or send it to gmx-developers-request at gromacs.org.
> >
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the 
> www interface or send it to gmx-developers-request at gromacs.org.
-- 
David.
________________________________________________________________________
David van der Spoel, PhD, Assist. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,  	75124 Uppsala, Sweden
phone:	46 18 471 4205		fax: 46 18 511 755
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the gromacs.org_gmx-developers mailing list