[gmx-developers] Questions regarding neighbor searching (nsgrid_core function)

Mark Abraham mark.j.abraham at gmail.com
Sat Oct 11 00:53:38 CEST 2014


On Fri, Oct 10, 2014 at 10:08 PM, Albert Hartono <albert.hartono at gmail.com>
wrote:

> Hello,
>
> I'm trying to understand Gromacs' nsgrid_core function.
>

Probably not the best use of your time. It's used only in the group cut-off
scheme, which is deprecated because it will become / is too slow.

This function performs data insertions into 2D arrays nl_sr, nl_lr_ljc,
> nl_lr_one (code given below).
>
> if (r2 < rs2) {
>   if (nsr[jgid] >= MAX_CG) {
>     put_in_list(...);
>     nsr[jgid] = 0;
>   }
>   *nl_sr[jgid][nsr[jgid]++] = jjcg;*
> } else if (r2 < rm2) {
>   if (nlr_ljc[jgid] >= MAX_CG) {
>     put_in_list(...);
>     nlr_ljc[jgid] = 0;
>   }
>  * nl_lr_ljc[jgid][nlr_ljc[jgid]++] = jjcg;*
> } else {
>   if (nlr_one[jgid] >= MAX_CG) {
>     put_in_list(...);
>     nlr_one[jgid] = 0;
>   }
>   *nl_lr_one[jgid][nlr_one[jgid]++] = jjcg;*
> }
>
> My questions are as follows:
>
> 1. Profiling of single-core execution shows the length of the first
> dimension of these arrays is always one (i.e., jgid is always 1). In what
> case does the length of the first dimension become more than one? Is it
> true when there are more than one cores used?
>

This code only ever runs on a single core. No idea when jgid > 1, but it's
highly unlikely to be worth learning about.


> 2. I can see when the buffer gets full, its content is copied to other
> container. But what does this function actually do (in high level)? I'm a
> computer scientist and have no background in molecular dynamics.
>

It searches for pairs of atoms that might be within various cutoffs. You
should at least skim the manual and do some tutorials to have some basic
clues. Gromacs is particularly unsuited to black-box discovery ;-)

Mark

Any kind help on understanding this code is highly appreciated. Thank you
> much!
>
> Best,
> Albert
>
>
> --
> 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/20141010/ac93306e/attachment.html>


More information about the gromacs.org_gmx-developers mailing list