[petsc-users] Running AMG libraries as standalone solvers

Mark Adams mfadams at lbl.gov
Wed Jul 5 10:45:45 CDT 2023


On Wed, Jul 5, 2023 at 11:29 AM Khurana, Parv <p.khurana22 at imperial.ac.uk>
wrote:

> Hello PETSc users,
>
>
>
> I am fairly inexperienced with PETSc as of now and am new to the mailing
> list! Thanks for running this channel.
>
>
>
> I seek basic help regarding running AMG routines (BoomerAMG/ML/GAMG). I am
> trying to compare the performance of solving a Poisson problem using a AMG
> Preconditioned GMRES iterative solve vs using AMG as the solver. I use
> PETSc options using the options database keys as of now, and it is
> connected to a flow solver (Nektar++) I use for my research.
>
>
>
> I currently run the AMG Preconditioned GMRES iterative solve by setting -ksp_type
> gmres and then specifying the preconditioner I want using, for e.g, -pc_type
> hypre -pc_hypre_type boomeramg.
>

Looks good. You need to configure with --download-hypre and you should be
good to go.
You can also try -pc_type gamg
You can also try -pc_type ml

If I want to use the AMG routine, I am currently setting -ksp_type preonly
> and the same -pc_type.
>

I am not understanding this. You just said you use -ksp_type gmres.
Stick with that!


> However, I am not sure if this is correct way to go about it due to two
> reasons:  a) my solution using AMG as a solver with these options has a
> larger error than AMG Preconditioned GMRES (which could still be
> acceptable), and b) I could not find any clear documentation regarding how
> to use AMG directly as a solver. I saw some hints in the examples here
> https://petsc.org/main/tutorials/handson/#
> <https://petsc.org/main/tutorials/handson/>, but it hasn’t helped me.
>
>
>

There are a lot of solver examples in the code base.
eg,

src/snes/tutorials/ex19.c:      args: -da_refine 5 -snes_monitor
-snes_converged_reason -pc_type hypre -dm_mat_type {{aij baij}}

There are regression tests in a big comment block at the end of each
example file. You can use these as examples.

Good luck,
Mark



> Any hints on how to use AMG directly as a solver?
>
>
>
> Best
>
> Parv
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230705/8a259c45/attachment.html>


More information about the petsc-users mailing list