<div dir="ltr">Fabian,<div>Too much time was spent on the matrix operations during setup phase, which has plenty room for optimization. </div><div>Can you provide us a stand-alone code used in your experiment so we can investigate how to make our gamg more efficient?</div><div><br></div><div>Hong</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 12:20 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Fabian,<br>
<br>
CG requires that the preconditioner be symmetric positive definite. ICC even if given a symmetric positive definite matrix can generate an indefinite preconditioner.<br>
<br>
Similarly if an algebraic multigrid application is not "strong enough" it can also result in a preconditioner that is indefinite.<br>
<br>
You never want to use ICC for pressure type problems it cannot compete with multigrid for large problems so let's forget about ICC and focus on the GAMG.<br>
<br>
> -pressure_mg_coarse_sub_pc_type svd<br>
> -pressure_mg_levels_ksp_rtol 1e-4<br>
> -pressure_mg_levels_ksp_type richardson<br>
> -pressure_mg_levels_pc_type sor<br>
> -pressure_pc_gamg_agg_nsmooths 1<br>
> -pressure_pc_type gamg<br>
<br>
There are many many tuning parameters for MG.<br>
<br>
First, is your pressure problem changing dramatically at each new solver? That is, for example, is the mesh moving or are there very different numerical values in the matrix? Is the nonzero structure of the pressure matrix changing? Currently the entire GAMG process is done for each new solve, if you use the flag<br>
<br>
-pressure_pc_gamg_reuse_interpolation true<br>
<br>
it will create the interpolation needed for GAMG once and reuse it for all the solves. Please try that and see what happens.<br>
<br>
Then I will have many more suggestions.<br>
<br>
<br>
Barry<br>
<br>
<br>
<br>
> On Feb 17, 2015, at 9:14 AM, Fabian Gabel <<a href="mailto:gabel.fabian@gmail.com">gabel.fabian@gmail.com</a>> wrote:<br>
><br>
> Dear PETSc team,<br>
><br>
> I am trying to optimize the solver parameters for the linear system I<br>
> get, when I discretize the pressure correction equation Poisson equation<br>
> with Neumann boundary conditions) in a SIMPLE-type algorithm using a<br>
> finite volume method.<br>
><br>
> The resulting system is symmetric and positive semi-definite. A basis to<br>
> the associated nullspace has been provided to the KSP object.<br>
><br>
> Using a CG solver with ICC preconditioning the solver needs a lot of<br>
> inner iterations to converge (-ksp_monitor -ksp_view output attached for<br>
> a case with approx. 2e6 unknowns; the lines beginning with 000XXXX show<br>
> the relative residual regarding the initial residual in the outer<br>
> iteration no. 1 for the variables u,v,w,p). Furthermore I don't quite<br>
> understand, why the solver reports<br>
><br>
> Linear solve did not converge due to DIVERGED_INDEFINITE_PC<br>
><br>
> at the later stages of my Picard iteration process (iteration 0001519).<br>
><br>
> I then tried out CG+GAMG preconditioning with success regarding the<br>
> number of inner iterations, but without advantages regarding wall time<br>
> (output attached). Also the DIVERGED_INDEFINITE_PC reason shows up<br>
> repeatedly after iteration 0001487. I used the following options<br>
><br>
> -pressure_mg_coarse_sub_pc_type svd<br>
> -pressure_mg_levels_ksp_rtol 1e-4<br>
> -pressure_mg_levels_ksp_type richardson<br>
> -pressure_mg_levels_pc_type sor<br>
> -pressure_pc_gamg_agg_nsmooths 1<br>
> -pressure_pc_type gamg<br>
><br>
> I would like to get an opinion on how the solver performance could be<br>
> increased further. -log_summary shows that my code spends 80% of the<br>
> time solving the linear systems for the pressure correction (STAGE 2:<br>
> PRESSCORR). Furthermore, do you know what could be causing the<br>
> DIVERGED_INDEFINITE_PC converged reason?<br>
><br>
> Regards,<br>
> Fabian Gabel<br>
> <gamg.128.out.531314><icc.128.out.429762><br>
<br>
</blockquote></div><br></div></div></div>