<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body 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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hong</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Sent:</b> Wednesday, November 18, 2020 1:56 PM<br>
<b>To:</b> Lawrence Mitchell <wence@gmx.li><br>
<b>Cc:</b> Zhang, Hong <hzhang@mcs.anl.gov>; petsc-dev <petsc-dev@mcs.anl.gov><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">wence@gmx.li</a>> wrote:<br>
</div>
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" 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">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 class="x_gmail_quote" 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" class="x_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>
</div>
</body>
</html>