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

Zhang, Hong hzhang at mcs.anl.gov
Thu Nov 19 15:35:01 CST 2020


Matt,
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?
Hong

________________________________
From: Matthew Knepley <knepley at gmail.com>
Sent: Wednesday, November 18, 2020 1:56 PM
To: Lawrence Mitchell <wence at gmx.li>
Cc: Zhang, Hong <hzhang at mcs.anl.gov>; petsc-dev <petsc-dev at mcs.anl.gov>
Subject: Re: [petsc-dev] Can I call PetscSectionAddDof(s, p, ndof) at a shred 'p' by more than one processors?

On Wed, Nov 18, 2020 at 2:19 PM Lawrence Mitchell <wence at gmx.li<mailto:wence at gmx.li>> wrote:
> On 18 Nov 2020, at 15:26, Zhang, Hong via petsc-dev <petsc-dev at mcs.anl.gov<mailto: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/20201119/b1e02f37/attachment.html>


More information about the petsc-dev mailing list