[petsc-users] unreliable AMG in PETSc

Arne Morten Kvarving arne.morten.kvarving at sintef.no
Thu Oct 23 08:31:02 CDT 2014


On 23/10/14 15:04, Barry Smith wrote:

hi barry,

thanks for your detailed and patient answer.

> The problem in your cases is that the preconditioner operator (which 
> is a V cycle of multigrid) with Richardson smoothing is an indefinite 
> operator. That is inside the CG algorithm the computation of R’
aha. the devil and his details. it all makes sense now - users of the 
coupled navier-stokes solver never saw the issues (where a bcgs/gmres 
drives the loop) and the multigrid is used for the pressure block. only 
the users of the chorin scheme did, where the pressure update is spd 
(poisson) and cg is used. i should have picked up on this on my own 
earlier..

thanks for educating me! i wasn't aware richardson could break definiteness.

> * B *R (where B is an application of the preconditioner) results in a 
> negative number sometimes and sometimes a positive number. The CG 
> algorithm requires that the preconditioner operator be positive 
> definite (or negative definite) but it cannot be indefinite. Now since 
> your original matrix A is positive definite (and hence its inverse is 
> positive definite), one would hope that a significantly close 
> preconditioner would preserve the property of being positive definite 
> (otherwise it is not a close approximation to the inverse). So loosely 
> speaking using Richardson smoothing in this case results in a 
> preconditioner that is not close enough to the inverse of A to 
> preserve the positive definiteness and hence CG breaks down. Of course 
> running with GMRES or any method that allows an indefinite 
> preconditioner is fine. Now I’ve never seen anybody write any analysis 
> for why a preconditioner is not positive definite and how to fix it 
> without just using a “stronger” preconditioner. That is, I don’t know 
> how to “fix” an application of a preconditioner that is not positive 
> definite in a general way. Note that 

indeed. i am aware of this, i tried to be defensive in my original post 
:) i will have to write a FAQ entry for things to check when 
INDEFINITE_PC is thrown at users. then i can yell when they come to me 
before reading it ;)

one small thing that could perhaps be added is to warn if the matrix is 
marked spd and ksp is cg ? i will add this in our code for sure.

> for MG there are a variety of ways you can try to make the 
> preconditioner “stronger” besides changing the smoother to Chebyshev. 
> You could try 1) using more smoothing steps 2) you could try a W cycle 
> instead of V. -pc_mg_cycle_type w 3) you could use 2 V cycles for the 
> preconditioner instead of 1 -pc_mg_multiplicative_cycles 2 4) you 
> could try other GAMG options. 

thanks. i did try all of these (though with ml) before making a fool of 
myself on the mailing list with my lack of knowledge..

> BTW: if you get segmentation violation type crashes in GAMG please 
> report them so we can fix the problem. We cannot build a GAMG that 
> will always converge for any problem but we really really really don’t 
> want it crashing due to bugs in the code.
i will.

arnem


More information about the petsc-users mailing list