[petsc-dev] PetscSF in Fortran

Matthew Knepley knepley at gmail.com
Wed Sep 27 10:18:17 CDT 2017

On Tue, Sep 26, 2017 at 11:49 PM, Adrian Croucher <a.croucher at auckland.ac.nz
> wrote:

> hi Matt,
> On 25/09/17 23:12, Matthew Knepley wrote:
> If you truly need the exact same SF for your grid, you should be able to
> use DMGet/SetPointSF() since it will just reference count it for you. Then
> the default SF is created automatically from the point SF. Does this work?
> It doesn't seem to work, unfortunately. If I run in parallel I get an
> error on each processor like this:
> [0]PETSC ERROR: Nonconforming object sizes
> [0]PETSC ERROR: SF roots 447 < pEnd 543
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision: v3.7.6-5886-gc423942  GIT
> Date: 2017-06-28 18:43:52 -0500
> [0]PETSC ERROR: test_all on a linux-gnu-c-opt named en-354401 by acro018
> Wed Sep 27 16:31:28 2017
> [0]PETSC ERROR: Configure options --with-x --download-hdf5
> --download-netcdf --download-exodusii --downloa
> d-triangle --download-ptscotch --download-chaco
> --download-hypre
> [0]PETSC ERROR: #1 PetscSectionCreateGlobalSection() line 929 in
> /home/acro018/software/PETSc/code/src/vec
> /is/utils/vsectionis.c
> [0]PETSC ERROR: #2 DMGetDefaultGlobalSection() line 3458 in
> /home/acro018/software/PETSc/code/src/dm/inter
> face/dm.c
> [0]PETSC ERROR: #3 User provided function() line 0 in User file
> The reason I thought just copying the SF across might work is that the
> partition ghost cells in my modified DMPlex should be in the same locations
> (DMPlex points) as they were in the original DMPlex. My understanding was
> that the SF just stores the root corresponding to a leaf (ghost point?) on
> the current processor, so those ought to be unchanged. But maybe there are
> subtleties about the SF stuff that I don't yet understand.
> What I am doing is adding new points for the dual-porosity mesh into my
> modified DMPlex. I have added the new cells after the partition ghost
> cells, and before the boundary ghost cells (and similarly for other depth
> strata). So I have shifted the locations of the boundary ghost cells, but
> not the partition ghost cells. I give the new points the appropriate depth
> label values so that the depth stratum bounds are updated correctly. I also
> shift the end_interior value for each depth stratum, so that code relying
> on DMPlexGetHybridBounds() should still work.
> Would you expect copying the SF to work in this case?

Okay, I think this should be easy to solve.

First a little bit about SF. There are two parts to the specification. You
have the communication part, which maps
a certain location p on this process to another location q on another
process. This might not change for you. The
second part just tells it how big the data array is (numRoots), which is
the thing that the locations in the communication
part index into.

So my question is, where did you put the numbers for the points you added?
Are they after all points, or only after the old cells?
I think you can easily create the new SF using the info from SFGetGraph().


> - Adrian
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 4611 <+64%209-923%204611>

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.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170927/582b9ab3/attachment.html>

More information about the petsc-dev mailing list