<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 10, 2014 at 10:08 PM, Albert Hartono <span dir="ltr">&lt;<a href="mailto:albert.hartono@gmail.com" target="_blank">albert.hartono@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I&#39;m trying to understand Gromacs&#39; nsgrid_core function.</div></div></blockquote><div><br></div><div>Probably not the best use of your time. It&#39;s used only in the group cut-off scheme, which is deprecated because it will become / is too slow.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This function performs data insertions into 2D arrays nl_sr, nl_lr_ljc, nl_lr_one (code given below). </div><div><br></div><div><font face="courier new, monospace">if (r2 &lt; rs2) </font><span style="font-family:&#39;courier new&#39;,monospace">{</span><br></div><div><div><font face="courier new, monospace">  if (nsr[jgid] &gt;= MAX_CG)</font><span style="font-family:&#39;courier new&#39;,monospace"> {</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">    put_in_list(...</span><span style="font-family:&#39;courier new&#39;,monospace">);</span></div><div><font face="courier new, monospace">    nsr[jgid] = 0;</font></div><div><font face="courier new, monospace">  }</font></div><div><font face="courier new, monospace" style="background-color:rgb(255,255,0)">  <b>nl_sr[jgid][nsr[jgid]++] = jjcg;</b></font></div><div><font face="courier new, monospace">} </font><span style="font-family:&#39;courier new&#39;,monospace">else if (r2 &lt; rm2)</span><span style="font-family:&#39;courier new&#39;,monospace"> {</span></div><div><font face="courier new, monospace">  if (nlr_ljc[jgid] &gt;= MAX_CG)</font><span style="font-family:&#39;courier new&#39;,monospace"> {</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">    put_in_list(...);</span></div><div><font face="courier new, monospace">    nlr_ljc[jgid] = 0;</font></div><div><font face="courier new, monospace">  }</font></div><div><font face="courier new, monospace" style="background-color:rgb(255,255,0)"> <b> nl_lr_ljc[jgid][nlr_ljc[jgid]++] = jjcg;</b></font></div><div><font face="courier new, monospace">} </font><span style="font-family:&#39;courier new&#39;,monospace">else</span><span style="font-family:&#39;courier new&#39;,monospace"> {</span></div><div><font face="courier new, monospace">  if (nlr_one[jgid] &gt;= MAX_CG)</font><span style="font-family:&#39;courier new&#39;,monospace"> {</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">    put_in_list(...</span><span style="font-family:&#39;courier new&#39;,monospace">);</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">    nlr_one[jgid] = 0;</span></div><div><font face="courier new, monospace">  }</font></div><div><font face="courier new, monospace" style="background-color:rgb(255,255,0)">  <b>nl_lr_one[jgid][nlr_one[jgid]++] = jjcg;</b></font></div><div><font face="courier new, monospace">}</font></div></div><div><br></div><div><div>My questions are as follows:</div><div><br></div><div>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?</div></div></div></blockquote><div><br></div><div>This code only ever runs on a single core. No idea when jgid &gt; 1, but it&#39;s highly unlikely to be worth learning about.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>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&#39;m a computer scientist and have no background in molecular dynamics. </div></div></blockquote><div><br></div><div>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 ;-)</div><div><br></div><div>Mark</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Any kind help on understanding this code is highly appreciated. Thank you much!</div><div><br></div><div>Best,</div><div>Albert</div><div><br></div></div>
<br>--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br></blockquote></div><br></div></div>