[petsc-dev] strange behavior with pbjacobi

Barry Smith bsmith at mcs.anl.gov
Tue Oct 4 16:52:19 CDT 2011


   Mark,

     In this particular example (and likely the cause of all your noticing) is my fault. The problem is not about calculating the singular values it is that if someone changed the AIJ matrix values WITHOUT calling MatAssemblyBegin/End; for example by calling MatScale() the matrix kept the old inverse of the block diagonal previously computed for -pc_type pbjacobi. and did not compute a new one even when you call KSPSetOperators (like it should have).  That is, the preconditioner did not get updated after the new matrix entries. I have fixed this in 3.2 and dev by marking the inverse of the block diagonal as invalid once MatScale(), etc etc are called. Now that ex56 returns the correct singular values for the pbjacobi case, even checked against MATLAB to be sure.

    Thanks for reporting the problem,

     Sorry this likely screwed up some of your previous numerical studies this summer since it was not always doing the right pbjacobi.


     Barry

On Oct 4, 2011, at 9:51 AM, Mark F. Adams wrote:

> Barry, 
> 
> I've noticed something for some time, pbjacobi seems to mess up the KSP singular values calculation.  eg:
> 
> ~/Codes/petsc-dev/src/ksp/ksp/examples/tutorials>./ex56 -pc_type pbjacobi 
> [0]main |b-Ax|/|b|=5.044672e-04, |b|=7.054476e+00, emax=3.084537e+05
> ~/Codes/petsc-dev/src/ksp/ksp/examples/tutorials>./ex56 -pc_type jacobi
> [0]main |b-Ax|/|b|=5.046212e-04, |b|=7.054476e+00, emax=3.220066e+00
> ~/Codes/petsc-dev/src/ksp/ksp/examples/tutorials>
> 
> The solver is working fine, and PB converges in one less iteration (21 vs 22 here), but the singular values seem to be of the unpreconditioned system.  I have no idea how the PC could effect this ... do you have any ideas?
> 
> Mark




More information about the petsc-dev mailing list