<div dir="ltr"><div dir="ltr">On Sun, Mar 29, 2026 at 6:25 PM Miguel Molinos <<a href="mailto:m.molinos@upm.es">m.molinos@upm.es</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p style="color:rgb(0,0,0)">Dear all,</p><p style="color:rgb(0,0,0)">I am experiencing an issue where particles created with DMSwarm are being increased across MPI ranks when initializing a DMSwarm over a periodic DMPlex. I follow this procedure on every rank:</p><ol start="1"><li style="color:rgb(0,0,0)"><p>Create a sequential vector with the global coordinates of all particles (18,000 atoms).</p></li><li><p><font color="#000000">Call DMLocatePoints(FE_Mesh, coordinates, DM_POINTLOCATION_NONE, &cellSF) to find which particles belong to the local DMPlex partition. Then call </font><span style="white-space:pre-wrap;background-color:rgb(255,255,255)"><font color="#000000">PetscSFGetGraph.</font></span></p></li><li style="color:rgb(0,0,0)"><p>Iterate through the results and add any particle with a valid cell index (index != DMLOCATEPOINT_POINT_NOT_FOUND) to the local DMSwarm.</p></li></ol><p style="color:rgb(0,0,0)">The sum of n_atoms_local across all ranks gives 18,740 instead of the expected 18,000. It seems that particles located exactly on periodic boundaries or MPI interfaces are being identified as "found" by multiple ranks simultaneously. Does DMLocatePoints return points found in ghost/halo cells by default when the DMPlex is periodic or distributed with overlap?</p></div></blockquote><div>I do not think this should happen at periodic boundaries, but definitely if you have cell overlap it will happen. It iterates over all local cells to check particle location. You could discard those points by checking if the cell is in the point SF in Step 3.</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p style="color:rgb(0,0,0)">Thanks,</p><p style="color:rgb(0,0,0)">Miguel</p></div></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!asSid27diNY8deyJIRO7sClJg5Rp59NAjfq_99WjlYxUYDas8kx6pf9AEu-ySF2VTzFf-cbhEjrxpX1DgF2Y$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>