<div dir="ltr"><div dir="ltr">On Tue, Apr 14, 2020 at 6:36 AM Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr">pierre.jolivet@enseeiht.fr</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">Hello,<br>
I’d like to call DMPlexInterpolate after DMPlexDistribute and not the other way around for performance reasons (please stop me here if this is equivalent).<br>
When there is no overlap in DMPlexDistribute, it goes through fine.<br>
If there is overlap, I run into an error.<br>
Is this the expected behavior?<br></blockquote><div><br></div><div>Yes. What we want you to do is:</div><div><br></div><div>1) Load/generate mesh</div><div><br></div><div>2) Distribute (this can be done at the same time as load with parallel load)</div><div><br></div><div>3) Interpolate (this is also an option from parallel load)</div><div><br></div><div>4) If necessary, redistribute for load balance</div><div><br></div><div>5) Construct overlap</div><div><br></div><div>    When you pass '1' below to DMDistribute(), it distributes as normal and then calls</div><div><br></div><div>      <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeOverlap.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeOverlap.html</a></div><div><br></div><div>    at the end. So you just postpone calling that until you have interpolated.</div><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">
Here is a MWE.<br>
$ patch -p1 < patch.txt<br>
$ cd src/dm/impls/plex/tests/<br>
$ make ex18<br>
$ mpirun -n 2 ./ex18 -distribute -interpolate after_distribute<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc has generated inconsistent data<br>
[0]PETSC ERROR: Point SF contains 1 which is a cell<br>
<br>
Thanks,<br>
Pierre<br>
<br>
diff --git a/src/dm/impls/plex/tests/ex18.c b/src/dm/impls/plex/tests/ex18.c<br>
index 07421b3522..dd62be58e5 100644<br>
--- a/src/dm/impls/plex/tests/ex18.c<br>
+++ b/src/dm/impls/plex/tests/ex18.c<br>
@@ -806 +806 @@ static PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user, DM *dm)<br>
-    ierr = DMPlexDistribute(*dm, 0, NULL, &pdm);CHKERRQ(ierr);<br>
+    ierr = DMPlexDistribute(*dm, 1, NULL, &pdm);CHKERRQ(ierr);</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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>