<div dir="ltr"><div dir="ltr">On Thu, Nov 19, 2020 at 4:35 PM Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</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 style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Matt,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
At a local section point (including ghost point), how to find all the owners? For example, proc[0] and proc[2] share p. How proc[0] find that proc[2] is an owner? Any routine would provide this info?</div></div></blockquote><div><br></div><div>All ownership data is handled by the PetscSF, the Section just stores local information about data. You can ask</div><div>the SF is a point is a leaf, meaning that it is not owned. You can also ask for an owned point, how many other</div><div>processes have it as a leaf:</div><div><br></div><div>  <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSF/PetscSFComputeDegreeBegin.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSF/PetscSFComputeDegreeBegin.html</a></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"><div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hong</div>
<div id="gmail-m_5584693437109803059appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_5584693437109803059divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>Sent:</b> Wednesday, November 18, 2020 1:56 PM<br>
<b>To:</b> Lawrence Mitchell <<a href="mailto:wence@gmx.li" target="_blank">wence@gmx.li</a>><br>
<b>Cc:</b> Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>>; petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-dev] Can I call PetscSectionAddDof(s, p, ndof) at a shred 'p' by more than one processors?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Wed, Nov 18, 2020 at 2:19 PM Lawrence Mitchell <<a href="mailto:wence@gmx.li" target="_blank">wence@gmx.li</a>> wrote:<br>
</div>
<div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> On 18 Nov 2020, at 15:26, Zhang, Hong via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
> <br>
> Matt or Jed,<br>
> Can I call PetscSectionAddDof(s,p,ndof) at a shred 'p' by more than one processors? For example,<br>
> if (rank == 0) {<br>
>     PetscSectionAddDof(s,p,1) ;<br>
> } else if (rank == 1) {<br>
>     PetscSectionAddDof(s,p,2) ;<br>
> } <br>
> Then, at shared 'p', section 's' has dof=3?<br>
<br>
Sections are "local" objects that are tied together by an SF that describes point ownership.<br>
<br>
So I think that the only thing you need is that if two processes set a dof on what is globally the same point, they should agree on how many dofs live there.<br>
<br>
I wonder if PetscSectionAddDof (etc...) should be marked as logically collective.<br>
</blockquote>
<div><br>
</div>
<div>Right now, what you want is handled by creating a global Section from a local Section:</div>
<div><br>
</div>
<div>  <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSection/PetscSectionCreateGlobalSection.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSection/PetscSectionCreateGlobalSection.html</a></div>
<div><br>
</div>
<div>The global Section contains global offsets for all local points, and the ghost points have negative offsets.</div>
<div><br>
</div>
<div>There is no facility for combining dofs. The idea is that you know the number of dofs on each local point. If you change that</div>
<div>interpretation, you could easily use SF to add them up and broadcast the sum.</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>     Matt</div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Lawrence</blockquote>
</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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>