[petsc-users] odd SNES behavior
Mark F. Adams
mark.adams at columbia.edu
Wed Mar 6 16:11:04 CST 2013
I see that the fine grid smoother is calling my matrix free formFunction routine:
(gdb) frame 11
#11 0x00000001020f6cbe in PCMGMCycle_Private (pc=0x1096b2270, mglevelsin=0x112183098, reason=0x0) at mg.c:19
warning: Source file is more recent than executable.
19 ierr = KSPSolve(mglevels->smoothd,mglevels->b,mglevels->x);CHKERRQ(ierr); /* pre-smooth */
Current language: auto; currently c
(gdb) list
14 PetscErrorCode ierr;
15 PetscInt cycles = (mglevels->level == 1) ? 1 : (PetscInt) mglevels->cycles;
16
17 PetscFunctionBegin;
18 if (mglevels->eventsmoothsolve) {ierr = PetscLogEventBegin(mglevels->eventsmoothsolve,0,0,0,0);CHKERRQ(ierr);}
19 ierr = KSPSolve(mglevels->smoothd,mglevels->b,mglevels->x);CHKERRQ(ierr); /* pre-smooth */
20 if (mglevels->eventsmoothsolve) {ierr = PetscLogEventEnd(mglevels->eventsmoothsolve,0,0,0,0);CHKERRQ(ierr);}
21 if (mglevels->level) { /* not the coarsest grid */
22 if (mglevels->eventresidual) {ierr = PetscLogEventBegin(mglevels->eventresidual,0,0,0,0);CHKERRQ(ierr);}
23 ierr = (*mglevels->residual)(mglevels->A,mglevels->b,mglevels->x,mglevels->r);CHKERRQ(ierr);
(gdb) p mglevels->level
$1 = 5
gamg.c sets all the operators with the same matrix, as far as I can see. Could SNES be setting the matrix type somehow?
Mark
On Mar 6, 2013, at 4:48 PM, Peter Brune <prbrune at gmail.com> wrote:
> That's the thing; you WANT a MFFD matrix in the snes->jacobian slot but not the snes->jacobian_pre slot.
>
> Somewhere the PC's getting the wrong one and putting it on the smoother.
>
> - Peter
>
>
> On Wed, Mar 6, 2013 at 3:44 PM, Mark F. Adams <mark.adams at columbia.edu> wrote:
> >
> > Yikes, the logic of SNES and MG (with dm etc) is getting a bit too convoluted. I would run in the debugger with a break point for MatCreate_MFFD() this will give a hint why it is being used.
> >
>
> #0 0x0000000100fca059 in MatCreate_MFFD ()
> #1 0x0000000100eedc34 in MatSetType ()
> #2 0x0000000100fc7bc3 in MatCreateMFFD ()
> #3 0x00000001012acc90 in MatCreateSNESMF ()
> #4 0x00000001012c092e in SNESSetUp ()
> #5 0x00000001012c277b in SNESSolve ()
>
> I will keep digging. This is the first one and it is not in the PC ...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130306/03671fb7/attachment.html>
More information about the petsc-users
mailing list