A little more info... if I destroy the PC object (with PCDestory()) and recreate it then everything works fine... but this is non-ideal as that is happening for every nonlinear iteration (this is in PetscPreconditioner::init() in libMesh).


On Mon, Feb 4, 2013 at 3:20 PM, Derek Gaston <friedmud@gmail.com> wrote:
Thanks Jed.... PCReset() somewhat fixed it... but now I get this:

[0]PETSC ERROR: Error in external library!
[0]PETSC ERROR: Error in HYPRE_IJMatrixAssemble()!
[0]PETSC ERROR: MatHYPRE_IJMatrixFastCopy_SeqAIJ() line 183 in src/dm/impls/da/hypre/mhyp.c
[0]PETSC ERROR: MatHYPRE_IJMatrixCopy() line 127 in src/dm/impls/da/hypre/mhyp.c
[0]PETSC ERROR: PCSetUp_HYPRE() line 118 in src/ksp/pc/impls/hypre/hypre.c
[0]PETSC ERROR: PCSetUp() line 832 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: PCApply() line 380 in src/ksp/pc/interface/precon.c
[0]PETSC ERROR: apply() line 53 in "unknowndirectory/"src/numerics/petsc_preconditioner.C

Looks like maybe PCReset() doesn't work properly with Hypre?

As for why this worked before and isn't now... I have no idea.  We were definitely changing the system size all the time with adaptivity... and never saw this before...


On Mon, Feb 4, 2013 at 2:56 PM, Jed Brown <jedbrown@mcs.anl.gov> wrote:
On Mon, Feb 4, 2013 at 3:44 PM, Derek Gaston <friedmud@gmail.com> wrote:
After updating to Petsc 3.3 (and the new libMesh... so it's not clear where the error is).  One of our fancier preconditioning routines that relies on matrices added using system.add_matrix() calls is failing when we try to apply the preconditioner with an error that says:

[0]PETSC ERROR: PCSetOperators() line 1049 in src/ksp/pc/interface/precon.c Cannot change local size of Amat after use old sizes 9 9 new sizes 25 25

This is in an adaptivity problem that starts out with 2x2 quads (hence the 9x9 nature of the original matrix) and is being adapted (25x25 sounds right).

Anyone seen this before?  Is this some new checking in PETSc that is getting tripped...

PETSc has never supported changing the system size arbitrarily, but if you set the matrix and changed it _before_ setting up the preconditioner, you would have been okay in the past. We likely added the check when we added PCReset (and KSPReset, etc). This tells PETSc to rebuild any size-dependent structures, but does not change configuration. If you call this before setting a new operator with different sizes, you should be fine.

If the code worked before, perhaps you never used the PC to solve a smaller system before calling PCSetOperators() with a new system.
or is libMesh possibly not resizing these matrices correctly?

I'll provide more information as I have it... I just thought I would see if anyone had run into this before I get too deep in here...


Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
Libmesh-devel mailing list