<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 04/11/2022 02:43, Matthew Knepley wrote:<br>
<blockquote type="cite" cite="mid:CAMYG4G=T4wyd=DetXy2CX55sLTuOo-u5Ln8dvENQyLF86uKkfQ@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">On Thu, Nov 3, 2022 at 8:36 PM Matthew Knepley
<<a href="mailto:knepley@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">knepley@gmail.com</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">On Thu, Oct 27, 2022 at 11:57 AM Semplice
Matteo <<a href="mailto:matteo.semplice@uninsubria.it" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">matteo.semplice@uninsubria.it</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">Dear
Petsc developers,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
I am trying to use a DMSwarm to locate a cloud
of points with respect to a background mesh. In
the real application the points will be loaded
from disk, but I have created a small demo in
which</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<ul>
<li><span>each processor creates Npart
particles, all within the domain covered
by the mesh, but not all in the local
portion of the mesh</span></li>
<li><span>migrate the particles</span></li>
</ul>
<div>After migration most particles are not any
more in the DMSwarm (how many and which ones
seems to depend on the number of cpus, but it
never happens that all particle survive the
migration process).</div>
<div><br>
</div>
<div>I am clearly missing some step, since I'd
expect that a DMDA would be able to locate
particles without the need to go through a
DMShell as it is done in
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpetsc.org%2Fmain%2Fsrc%2Fdm%2Ftutorials%2Fswarm_ex3.c.html&data=05%7C01%7Cmatteo.semplice%40uninsubria.it%7C98335c5548fd4df3ec9208dabe060043%7C9252ed8bdffc401c86ca6237da9991fa%7C0%7C0%7C638031230248558895%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=j23JDuWGg3BwgLdSNbO0biatt%2FfyslLISMn2mM6MxrI%3D&reserved=0" originalsrc="https://petsc.org/main/src/dm/tutorials/swarm_ex3.c.html" shash="jfXStGW4wvK256cyrhvQeOH1DIPsUTbVEu/MTEpvlag0UwI3uyawpWomJzjJfFBNCUnkq644SuuH79ivk2y5AKp3w/z6x4V4WH5mJB+rNIadQSPp67X/L5f1TqwNCwxR6Jyj/kZumIlKl9W717CfXVDMixfd41alJFwErxus4qE=" target="_blank" moz-do-not-send="true">
src/dm/tutorials/swarm_ex3.c.html</a><br>
</div>
<div><br>
</div>
<div>I attach my demo code.</div>
<div><br>
</div>
<div>Could someone give me a hint?</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Thanks for sending this. I found the problem.
Someone has some overly fancy code inside DMDA to
figure out the local bounding box from the
coordinates.</div>
<div>It is broken for DM_BOUNDARY_GHOSTED, but we never
tested with this. I will fix it.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Okay, I think this fix is correct</div>
<div><br>
</div>
<div> <a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.com%2Fpetsc%2Fpetsc%2F-%2Fmerge_requests%2F5802&data=05%7C01%7Cmatteo.semplice%40uninsubria.it%7C98335c5548fd4df3ec9208dabe060043%7C9252ed8bdffc401c86ca6237da9991fa%7C0%7C0%7C638031230248558895%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=qNjWHwveQoOIgvwLq1WBmMRlBr%2FLH%2FQQphOzoxNP7NQ%3D&reserved=0" originalsrc="https://gitlab.com/petsc/petsc/-/merge_requests/5802" shash="RaD3rDLYMCL/VPyupaGngdCnN5laTyUWvomOwHExytZF5E9NNqic7+fWA1nD+EivxOnVOmCtWKM/XgePVKf+NeSmpBjZukLwchowhGSFKUWotdPQlj5S1q+1tyy0nlk3f6/lyZVmA0A1LQ07KpjuPQgFX6v4VZ6kg2cdV6T5po8=" moz-do-not-send="true">https://gitlab.com/petsc/petsc/-/merge_requests/5802</a></div>
<div><br>
</div>
<div>I incorporated your test as src/dm/impls/da/tests/ex1.c.
Can you take a look and see if this fixes your issue?</div>
</div>
</div>
</blockquote>
<p>Yes, we have tested 2d and 3d, with various combinations of
DM_BOUNDARY_* along different directions and it works like a
charm.</p>
<p>On a side note, neither <span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">DMSwarmViewXDMF</span></span>
nor <span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">DMSwarmMigrate</span></span>
seem to be implemented for 1d: I get</p>
<p><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">[0]PETSC
ERROR: No support for this operation for this object type</span><span style="color:#b21818;background-color:#ffffff;">
</span><span style="color:#000000;background-color:#ffffff;"> </span>[0]PETSC
ERROR: Support not provided for 1D<br>
</span></p>
<p>However, currently I have no need for this feature.<br>
<span style="font-family:monospace"></span></p>
<p>Finally, if the test is meant to stay in the source, you may
remove the call to <span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">DMSwarmRegisterPetscDatatypeField</span></span>
as in the attached patch.<br>
</p>
<p>Thanks a lot!!</p>
<p> Matteo and Silvia<br>
</p>
<blockquote type="cite" cite="mid:CAMYG4G=T4wyd=DetXy2CX55sLTuOo-u5Ln8dvENQyLF86uKkfQ@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div class="gmail_quote">
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<div>Best <br>
</div>
<div> Matteo<br>
</div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)"><br>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<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://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&data=05%7C01%7Cmatteo.semplice%40uninsubria.it%7C98335c5548fd4df3ec9208dabe060043%7C9252ed8bdffc401c86ca6237da9991fa%7C0%7C0%7C638031230248558895%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NUrLdRYvJVG9FK%2B66ku2yE6gNsX5xDMsccNsdhSQXHA%3D&reserved=0" originalsrc="http://www.cse.buffalo.edu/~knepley/" shash="togcusxy7AGG0VMrNb1tlensTLYw2ctC5JUVkV5XHzHtSlbtD3wfB13E3MNbc6gWEGOYNkMBE0hgDH+pFd5zbUSD6nWcXRFr6rB/zxyhXYb6Cg6HS/Q21TCEGyhn4FjzxOvmmQuLRbrBzr4SS40LsZkCmx6SnhDfO20RiYsHnSk=" target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</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>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://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cse.buffalo.edu%2F~knepley%2F&data=05%7C01%7Cmatteo.semplice%40uninsubria.it%7C98335c5548fd4df3ec9208dabe060043%7C9252ed8bdffc401c86ca6237da9991fa%7C0%7C0%7C638031230248558895%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NUrLdRYvJVG9FK%2B66ku2yE6gNsX5xDMsccNsdhSQXHA%3D&reserved=0" originalsrc="http://www.cse.buffalo.edu/~knepley/" shash="togcusxy7AGG0VMrNb1tlensTLYw2ctC5JUVkV5XHzHtSlbtD3wfB13E3MNbc6gWEGOYNkMBE0hgDH+pFd5zbUSD6nWcXRFr6rB/zxyhXYb6Cg6HS/Q21TCEGyhn4FjzxOvmmQuLRbrBzr4SS40LsZkCmx6SnhDfO20RiYsHnSk=" target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Prof. Matteo Semplice
Università degli Studi dell’Insubria
Dipartimento di Scienza e Alta Tecnologia – DiSAT
Professore Associato
Via Valleggio, 11 – 22100 Como (CO) – Italia
tel.: +39 031 2386316</pre>
</body>
</html>