<div dir="ltr">Hi,<div><br></div><div>Think algorithm first, implementation later.</div><div><br></div><div>Hopefully the reason for never collecting all data on a single node is clear. We don&#39;t even calculate the temperature at each timestep when pushing scaling for this reason - the communication latency &amp; bandwidth will kill performance (apart from the memory requirements).</div><div><br></div><div>How to actually solve it depends on the algorithm. The nonbonded interactions in gromacs are handled with a few tricks where we make sure each node has roughly 1/8th of a sphere of all neighbors within the cutoff, so we can calculate them on at least one (specific) node.</div><div><br></div><div>For constraints, the big challenge for parallelization is that there&#39;s often some sort of iterative component, and trying to iterate an unspecific number of times where each step requires communication and/or knowledge about all connected atoms is again going to kill performance &amp; scaling. For p-LINCS this is adressed by a limited sphere of influence (meaning you only need bond information up to a given number of bonds away), and then it&#39;s usually most efficient to communicate that specifically. However, when running in parallel it&#39;s usually better to increase the order (corresponding to the sphere of influence) to avoid having to perform multiple iterations.  For scaling, you basically need to think &quot;computation is free, communication kills you&quot;.</div><div><br></div><div>I think the central challenge for any new parallel constraints is that one has to start with finding an algorithm that minimizes communication and avoids iterations. Exactly what has to be communicated will be specific to the algorithm, but you can likely learn a lot just by looking at how p-LINCS finds what atoms are connected up to N bonds away.</div><div><br></div><div>Cheers,</div><div><br></div><div>Erik</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 11, 2022 at 11:47 AM Pablo García Risueño &lt;<a href="mailto:garcia.risueno@gmail.com">garcia.risueno@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Prof Lindahl<div><br></div><div>Thank you for your reply. Can you give us a clue on the second point that you mention? I guess that in the past the issue of transferring information to close neighboring nodes has been tackled by the Gromacs developers community.</div><div><br></div><div>With best regards.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 11 ene 2022 a las 11:30, Erik Lindahl (&lt;<a href="mailto:erik.lindahl@gmail.com" target="_blank">erik.lindahl@gmail.com</a>&gt;) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Lorién,<br><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 11, 2022 at 11:21 AM Lorién López Villellas &lt;<a href="mailto:lorien.lopez@bsc.es" target="_blank">lorien.lopez@bsc.es</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all.<br><br>As a first approach, we want to collect all the coordinates on the master rank, execute the solver, and send the updated results to the other ranks. </div></blockquote><div><br></div><div>Stop right there ;-)</div><div><br></div><div>This approach is never going to scale, and you might as well stick with a non-MPI implementation. Don&#39;t think of having two nodes, but imagine having a molecule with ~500,000 atoms split over 100 chains that is run on 1000 nodes.  If you try to execute part of the problem on a single node you will first be killed by the communication, and then by the master node having 10x more work to do even if your algorithm is only 1% of the runtime (meaning a 10x performance loss).</div><div><br></div><div>To have any chance of getting impact for a new parallel constraints algorithm (which is a VERY worthwhile effort per se), you need to find a way to</div><div><br></div><div>1) Balance the computational load such that all nodes in the system can help</div><div>2) Find a way where you only need to communicate to close neighbors - never ever collect all data on a single node every step.</div><div><br></div><div><br></div><div> </div><div>Cheers,</div><div><br></div><div>Erik</div></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Erik Lindahl &lt;<a href="mailto:erik.lindahl@dbb.su.se" target="_blank">erik.lindahl@dbb.su.se</a>&gt;</div><div>Professor of Biophysics, Dept. Biochemistry &amp; Biophysics, Stockholm University</div><div>Science for Life Laboratory, Box 1031, 17121 Solna, Sweden</div><div><br></div><div>Note: I frequently do email outside office hours because it is a convenient time for me to write, but please do not interpret that as an expectation for you to respond outside your work hours.<br></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">--<br><br>Dr. Pablo García Risueño<br></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Erik Lindahl &lt;<a href="mailto:erik.lindahl@dbb.su.se" target="_blank">erik.lindahl@dbb.su.se</a>&gt;</div><div>Professor of Biophysics, Dept. Biochemistry &amp; Biophysics, Stockholm University</div><div>Science for Life Laboratory, Box 1031, 17121 Solna, Sweden</div><div><br></div><div>Note: I frequently do email outside office hours because it is a convenient time for me to write, but please do not interpret that as an expectation for you to respond outside your work hours.<br></div></div></div></div></div></div></div></div></div>