[petsc-dev] DMPlexInterpolate after DMPlexDistribute

Matthew Knepley knepley at gmail.com
Tue Apr 14 07:36:03 CDT 2020


On Tue, Apr 14, 2020 at 6:36 AM Pierre Jolivet <pierre.jolivet at enseeiht.fr>
wrote:

> Hello,
> I’d like to call DMPlexInterpolate after DMPlexDistribute and not the
> other way around for performance reasons (please stop me here if this is
> equivalent).
> When there is no overlap in DMPlexDistribute, it goes through fine.
> If there is overlap, I run into an error.
> Is this the expected behavior?
>

Yes. What we want you to do is:

1) Load/generate mesh

2) Distribute (this can be done at the same time as load with parallel load)

3) Interpolate (this is also an option from parallel load)

4) If necessary, redistribute for load balance

5) Construct overlap

    When you pass '1' below to DMDistribute(), it distributes as normal and
then calls


https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeOverlap.html

    at the end. So you just postpone calling that until you have
interpolated.

  Thanks,

    Matt


> Here is a MWE.
> $ patch -p1 < patch.txt
> $ cd src/dm/impls/plex/tests/
> $ make ex18
> $ mpirun -n 2 ./ex18 -distribute -interpolate after_distribute
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: Petsc has generated inconsistent data
> [0]PETSC ERROR: Point SF contains 1 which is a cell
>
> Thanks,
> Pierre
>
> diff --git a/src/dm/impls/plex/tests/ex18.c
> b/src/dm/impls/plex/tests/ex18.c
> index 07421b3522..dd62be58e5 100644
> --- a/src/dm/impls/plex/tests/ex18.c
> +++ b/src/dm/impls/plex/tests/ex18.c
> @@ -806 +806 @@ static PetscErrorCode CreateMesh(MPI_Comm comm, AppCtx
> *user, DM *dm)
> -    ierr = DMPlexDistribute(*dm, 0, NULL, &pdm);CHKERRQ(ierr);
> +    ierr = DMPlexDistribute(*dm, 1, NULL, &pdm);CHKERRQ(ierr);



-- 
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/20200414/90f907cb/attachment.html>


More information about the petsc-dev mailing list