[petsc-users] About recent changes in GAMG

Mark Adams mfadams at lbl.gov
Wed Oct 18 07:15:36 CDT 2023


Hi Jeremy,

I hope you don't mind putting this on the list (w/o data), but this is
documentation and you are the second user that found regressions.
Sorry for the churn.

There is a lot here so we can iterate, but here is a pass at your questions.

*** Using MIS-2 instead of square graph was motivated by setup
cost/performance but on GPUs with some recent fixes in Kokkos (in a branch)
square graph seems OK.
My experience was that square graph is better in terms of quality and we
have a power user, like you all, that found this also.
So I switched the default back to square graph.

Interesting that you found that MIS-2 (new method) could be faster, but it
might be because the two methods coarsen at different rates and that can
make a big difference.
(the way to test would be to adjust parameters to get similar coarsen
rates, but I digress)
It's hard to understand the differences between these two methods in terms
of aggregate quality so we need to just experiment and have options.

*** As far as your thermal problem. There was a complaint that the eigen
estimates for chebyshev smoother were not recomputed for nonlinear problems
and I added an option to do that and turned it on by default:
Use '-pc_gamg_recompute_esteig false' to get back to the original.
(I should have turned it off by default)

Now, if your problem is symmetric and you use CG to compute the eigen
estimates there should be no difference.
If you use CG to compute the eigen estimates in GAMG (and have GAMG give
them to cheby, the default) that when you recompute the eigen estimates the
cheby eigen estimator is used and that will use gmres by default unless you
set the SPD property in your matrix.
So if you set '-pc_gamg_esteig_ksp_type cg' you want to also set
'-mg_levels_esteig_ksp_type cg' (verify with -ksp_view and -options_left)
CG is a much better estimator for SPD.

And I found that the cheby eigen estimator uses an LAPACK *eigen* method to
compute the eigen bounds and GAMG uses a *singular value* method.
The two give very different results on the lid driven cavity test (ex19).
eigen is lower, which is safer but not optimal if it is too low.
I have a branch to have cheby use the singular value method, but I don't
plan on merging it (enough churn and I don't understand these differences).

*** '-pc_gamg_low_memory_threshold_filter false' recovers the old filtering
method.
This is the default now because there is a bug in the (new) low memory
filter.
This bug is very rare and catastrophic.
We are working on it and will turn it on by default when it's fixed.
This does not affect the semantics of the solver, just work and memory
complexity.

*** As far as tet4 vs tet10, I would guess that tet4 wants more
aggressive coarsening.
The default is to do aggressive on one (1) level.
You might want more levels for tet4.
And the new MIS-k coarsening can use any k (default is 2) wth
'-mat_coarsen_misk_distance k' (eg, k=3)
I have not added hooks to have a more complex schedule to specify the
method on each level.

Thanks,
Mark

On Tue, Oct 17, 2023 at 9:33 PM Jeremy Theler (External) <
jeremy.theler-ext at ansys.com> wrote:

> Hey Mark
>
> Regarding the changes in the coarsening algorithm in 3.20 with respect to
> 3.19 in general we see that for some problems the MIS strategy gives and
> overall performance which is slightly better and for some others it is
> slightly worse than the "baseline" from 3.19.
> We also saw that current main has switched back to the old square
> coarsening algorithm by default, which again, in some cases is better and
> in others is worse than 3.19 without any extra command-line option.
>
> Now what seems weird to us is that we have a test case which is a heat
> conduction problem with radiation boundary conditions (so it is non linear)
> using tet10 and we see
>
>    1. that in parallel v3.20 is way worse than v3.19, although the memory
>    usage is similar
>    2. that petsc main (with no extra flags, just the defaults) recover
>    the 3.19 performance but memory usage is significantly larger
>
>
> I tried using the -pc_gamg_low_memory_threshold_filter flag and the
> results were the same.
>
> Find attached the log and snes views of 3.19, 3.20 and main using 4 MPI
> ranks.
> Is there any explanation about these two points we are seeing?
> Another weird finding is that if we use tet4 instead of tet10, v3.20 is
> only 10% slower than the other two and main does not need more memory than
> the other two.
>
> BTW, I have dozens of other log view outputs comparing 3.19, 3.20 and main
> should you be interested.
>
> Let me know if it is better to move this discussion into the PETSc mailing
> list.
>
> Regards,
> jeremy theler
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231018/435eacc4/attachment.html>


More information about the petsc-users mailing list