<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Barry, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Using </span>-<span style="font-family:"Courier New"">ksp_type preonly,</span><span style="mso-fareast-language:EN-US">and tweaking -pc_hypre_boomeramg_max_iter <it> and -pc_hypre_boomeramg_tol <tol>
according to my needs seems to have done the trick for me. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Credit: <a href="https://petsc.org/release/faq/#i-want-to-use-hypre-boomeramg-without-gmres-but-when-i-run-pc-type-hypre-pc-hypre-type-boomeramg-ksp-type-preonly-i-don-t-get-a-very-accurate-answer">
https://petsc.org/release/faq/#i-want-to-use-hypre-boomeramg-without-gmres-but-when-i-run-pc-type-hypre-pc-hypre-type-boomeramg-ksp-type-preonly-i-don-t-get-a-very-accurate-answer</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Best<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Parv<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> petsc-users <petsc-users-bounces@mcs.anl.gov>
<b>On Behalf Of </b>Khurana, Parv<br>
<b>Sent:</b> 05 July 2023 17:09<br>
<b>To:</b> Barry Smith <bsmith@petsc.dev><br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] Running AMG libraries as standalone solvers<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thank you Mark, Barry for the advice.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">-ksp_type richardson may be what I am looking for. I wanted a simple iterative scheme that allows AMG to be the main work horse – this allows that.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On using -<span style="font-family:"Courier New"">ksp_type preonly</span>, I observed only 1 KSP iteration and it does not drop the residual norm to my desired level
<span style="font-family:"Courier New"">(-ksp_rtol 1e-7</span>). Whereas when I use gmres or Richardson I see 6-10 ksp iterations and the desired residual drop. Is it possible to increase (and fix) the number of KSP iterations with preonly? You mentioned below
that it gives only one cycle so I presume it is not possible.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Geometric mg is not a feasible option for my application as I will be ultimately dealing with 3D, unstructured meshes for hp-finite element methods. Some clever tweaks may allow it (like having sub-structured meshes) but not as of now.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best<o:p></o:p></p>
<p class="MsoNormal">Parv<o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>>
<br>
<b>Sent:</b> 05 July 2023 16:51<br>
<b>To:</b> Khurana, Parv <<a href="mailto:p.khurana22@imperial.ac.uk">p.khurana22@imperial.ac.uk</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] Running AMG libraries as standalone solvers<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:none;background:#FFFFCC;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">This email from
<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a> originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your
<a href="https://spam.ic.ac.uk/SpamConsole/Senders.aspx">safe senders list</a> to disable email stamping for this address.
</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p> <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"> BTW: in my experience<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Geometric multigrid generally works great as a standalone solver, that is accelerating it with a Krylov method is not needed, and while it may improve the convergence rate slightly, it may end up taking a bit more time then not using the
Krylov solver (due to the extra Krylov solver overhead).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Algebraic multigrid is usually run with a Krylov solver and running without a Krylov solver, as far as I am aware, generally performs poorly.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jul 5, 2023, at 11:46 AM, Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"> -ksp_type richardson<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> If you use -ksp_typre preonly you effectively get one V-cycle (or whatever cycle type you may have selected) which in general, will give you a more or less garbage answer<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jul 5, 2023, at 11:28 AM, Khurana, Parv <<a href="mailto:p.khurana22@imperial.ac.uk">p.khurana22@imperial.ac.uk</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hello PETSc users,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I am fairly inexperienced with PETSc as of now and am new to the mailing list! Thanks for running this channel.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I currently run the AMG Preconditioned GMRES iterative solve by setting<span class="apple-converted-space"> </span><span style="font-family:"Courier New"">-ksp_type gmres</span><span class="apple-converted-space"> </span>and then specifying
the preconditioner I want using, for e.g, -<span style="font-family:"Courier New"">pc_type hypre -pc_hypre_type boomeramg</span>. If I want to use the AMG routine, I am currently setting<span class="apple-converted-space"> </span><span style="font-family:"Courier New"">-ksp_type
preonly</span><span class="apple-converted-space"> </span>and the same<span class="apple-converted-space"> </span><span style="font-family:"Courier New"">-pc_type</span>. 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<a href="https://petsc.org/main/tutorials/handson/"><span style="color:#0563C1">https://petsc.org/main/tutorials/handson/#</span></a>, but it hasn’t helped me.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Any hints on how to use AMG directly as a solver?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Best<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Parv<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>