<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 13 Apr 2020, at 4:42 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Mon, Apr 13, 2020 at 6:14 AM Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> wrote:<br class=""></div><div class="gmail_quote"><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;">Hello,<br class="">I’m trying to figure out why the result of DMGetNeighbors when a DMPlex is distributed with no overlap can be nonsymmetric.<br class=""></blockquote><div class=""><br class=""></div><div class="">Right now, the Plex function only calls PetscSFGetRootRanks(). It should probably call PetscSFGetLeafRanks() as well and merge the lists.</div><div class="">Have time to make the fix? You could commit this nice test :)</div></div></div></div></blockquote><div><br class=""></div><div>Sure, I’ll try to give it a go.</div><div><br class=""></div><div>Thanks,</div><div>Pierre</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="gmail_quote"><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">    Matt</div><div class=""> </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;">Is this intended? If so, is there some other easy way to get the equivalent list as in the overlapping case (I’m interested in the list of ranks sharing at least one point)?<br class="">Here is a MWE.<br class="">$ patch -p1 < patch.txt<br class="">$ cd src/dm/impls/plex/tests/<br class="">$ make ex1<br class="">$ mpirun -n 2 ./ex1 -dim 2 -cell_simplex 0 -interpolate -domain_shape box -domain_box_sizes 3,3 -test_redistribute<br class="">1 <— how come rank 0 has 1 neighbor<br class="">0 <— but rank 1 has 0 neighbor?<br class="">$ mpirun -n 2 ./ex1 -dim 2 -cell_simplex 0 -interpolate -domain_shape box -domain_box_sizes 3,3 -overlap 1<br class="">1<br class="">1<br class="">Overlap: 1<br class=""><br class="">Thanks,<br class="">Pierre<br class=""><br class="">diff --git a/src/dm/impls/plex/tests/ex1.c b/src/dm/impls/plex/tests/ex1.c<br class="">index 4a5d051a66..ac2ce8eb20 100644<br class="">--- a/src/dm/impls/plex/tests/ex1.c<br class="">+++ b/src/dm/impls/plex/tests/ex1.c<br class="">@@ -3,0 +4 @@ static char help[] = "Tests various DMPlex routines to construct, refine and dis<br class="">+#include <petscsf.h><br class="">@@ -420,0 +422,8 @@ PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user, DM *dm)<br class="">+      PetscInt nranks;<br class="">+      const PetscInt* ranks;<br class="">+      PetscSF sf;<br class="">+      ierr = DMGetPointSF(distributedMesh, &sf);CHKERRQ(ierr);<br class="">+      ierr = PetscSFSetUp(sf);CHKERRQ(ierr);<br class="">+      ierr = DMGetNeighbors(distributedMesh, &nranks, &ranks);CHKERRQ(ierr);<br class="">+      ierr = PetscSynchronizedPrintf(PETSC_COMM_WORLD,"%D\n",nranks);CHKERRQ(ierr);<br class="">+      ierr = PetscSynchronizedFlush(PETSC_COMM_WORLD,PETSC_STDOUT);CHKERRQ(ierr);<br class="">@@ -434,0 +444,8 @@ PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx *user, DM *dm)<br class="">+      PetscInt nranks;<br class="">+      const PetscInt* ranks;<br class="">+      PetscSF sf;<br class="">+      ierr = DMGetPointSF(overlapMesh, &sf);CHKERRQ(ierr);<br class="">+      ierr = PetscSFSetUp(sf);CHKERRQ(ierr);<br class="">+      ierr = DMGetNeighbors(overlapMesh, &nranks, &ranks);CHKERRQ(ierr);<br class="">+      ierr = PetscSynchronizedPrintf(PETSC_COMM_WORLD,"%D\n",nranks);CHKERRQ(ierr);<br class="">+      ierr = PetscSynchronizedFlush(PETSC_COMM_WORLD,PETSC_STDOUT);CHKERRQ(ierr);</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></body></html>