[petsc-dev] Can I call PetscSectionAddDof(s, p, ndof) at a shred 'p' by more than one processors?

Matthew Knepley knepley at gmail.com
Wed Nov 18 13:56:37 CST 2020


On Wed, Nov 18, 2020 at 2:19 PM Lawrence Mitchell <wence at gmx.li> wrote:

> > On 18 Nov 2020, at 15:26, Zhang, Hong via petsc-dev <
> petsc-dev at mcs.anl.gov> wrote:
> >
> > Matt or Jed,
> > Can I call PetscSectionAddDof(s,p,ndof) at a shred 'p' by more than one
> processors? For example,
> > if (rank == 0) {
> >     PetscSectionAddDof(s,p,1) ;
> > } else if (rank == 1) {
> >     PetscSectionAddDof(s,p,2) ;
> > }
> > Then, at shared 'p', section 's' has dof=3?
>
> Sections are "local" objects that are tied together by an SF that
> describes point ownership.
>
> 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.
>
> I wonder if PetscSectionAddDof (etc...) should be marked as logically
> collective.
>

Right now, what you want is handled by creating a global Section from a
local Section:


https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PetscSection/PetscSectionCreateGlobalSection.html

The global Section contains global offsets for all local points, and the
ghost points have negative offsets.

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
interpretation, you could easily use SF to add them up and broadcast the
sum.

  Thanks,

     Matt


> Lawrence

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20201118/02b9441b/attachment.html>


More information about the petsc-dev mailing list