[petsc-users] amg from hypre

Jed Brown jed at 59A2.org
Mon Mar 8 12:02:51 CST 2010


On 08 Mar 2010 09:05:43 -0600, hxie at umn.edu wrote:
> The result looks correct. I will double check by computing the real 
> residual by b-Ax.

Run with -ksp_type fgmres or -ksp_type lgmres -ksp_right_pc to do work
with unpreconditioned residuals, or run with -ksp_monitor_true_residual
to see what they are.  But for checking that the final solution is
correct, you should be looking at the function norm in SNES.

> For all the methods I set the same options "-ksp_max_it 500
> -ksp_gmres_restart 50". And each nonlinear iteration will take 500
> gmres iteration.

You should try a smaller problem size if possible, and converge the
linear solve to high tolerance to find out how fast Newton will converge
if you do a good job on the nonlinear solve.  Note that if you just stop
after some arbitrary number of iterations, then you increase the risk of
computing a search direction that is not a descent direction.

> Maybe the 500 V cycles takes much more time than the ilu0.

Definitely.  It would appear based on your lower nonlinear iteration
counts that 500 V-cycles is doing a slightly better job than 500 ILU(0).

> Will there be a big difference to implement the amg directly from
> hypre?

No, but there will be a difference in the time it takes you to do
something else when it still sucks, which it will.  Black box solvers
for indefinite problems do not exist [1], such problems really require
you to design a preconditioner that respects this property if you want
scalability.

There are two schools of thought, you can use a domain decomposition
scheme with subdomain and coarse problems carefully designed to be
compatible with the indefiniteness of the problem, or you can use
Schur-complement schemes to produce subproblems that are more amenable
to conventional methods.  The former is fairly discretization dependent
and generic software does not exist.  The best thing I'm aware of is to
use PCMG and PCASM, but it definitely requires that you understand the
algorithms, and you will have to do some manual work.  The latter is
mostly independent of discretization and can be done with PCFIELDSPLIT,
but usually requires some approximate commutator arguments to find a
good preconditioner for the Schur complement.

If you don't want to think about these issues, then the only truly
reliable option is to use a direct solver, but that will only scale so
far.

Jed

[1] Many would that black box solvers don't exist period, but they can
get you a lot further definite problems.


More information about the petsc-users mailing list