[petsc-users] KSP ex65 and DMShell context
Barry Smith
bsmith at mcs.anl.gov
Fri Nov 18 15:30:58 CST 2016
Thanks. Fixed in master
> On Nov 18, 2016, at 5:29 AM, Anton Popov <popov at uni-mainz.de> wrote:
>
> Hi all,
>
> KSP ex65 fails with -pc_type mg -pc_mg_galerkin
>
> [0]PETSC ERROR: Nonconforming object sizes
> [0]PETSC ERROR: Matrix dimensions are incompatible, 129 != 65
>
> This can be fixed either by adding MatTranspose after DMCreateInterpolation in CreateRestriction, or by commenting out DMShellSetCreateRestriction.
>
> Replacing DMCreateInterpolation with DMCreateRestriction in CreateRestriction also fails with a segfault:
>
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
> [0]PETSC ERROR: [0] DMCreateRestriction line 1064 /home/anton/LIB/petsc-3.7.4-debug/src/dm/interface/dm.c
>
> This example uses DMDA objects as context variables, and calls destroy on them right after creating coarse DMShell. Due to PETSc reference counting mechanism they are not destroyed immediately, so everything works without access violations and memory leaks.
>
> I wander how I should destroy my ordinary user contexts. One option is keeping a pointer to coarse context in the fine context, and destroying hierarchy recursively.
>
> Is there anything better (e.g. something like DMShellSetDestroyContext)?
>
> Thanks,
> Anton
More information about the petsc-users
mailing list