[petsc-users] GAMG parameters for ideal coarsening ratio

Sajid Ali sajidsyed2021 at u.northwestern.edu
Mon Mar 16 19:29:01 CDT 2020


Hi PETSc-developers,

As per the manual, the ideal gamg parameters are those which result in
MatPtAP time being roughly similar to (or just slightly larger) than KSP
solve times. The way to adjust this is by changing the threshold for
coarsening and/or squaring the graph. I was working with a grid of size
2^14 by 2^14 in a linear & time-independent TS with the following params :

#PETSc Option Table entries:
-ksp_monitor
-ksp_rtol 1e-5
-ksp_type fgmres
-ksp_view
-log_view
-mg_levels_ksp_type gmres
-mg_levels_pc_type jacobi
-pc_gamg_coarse_eq_limit 1000
-pc_gamg_reuse_interpolation true
-pc_gamg_square_graph 10
-pc_gamg_threshold -0.04
-pc_gamg_type agg
-pc_gamg_use_parallel_coarse_grid_solver
-pc_mg_monitor
-pc_type gamg
-prop_steps 8
-ts_monitor
-ts_type cn
#End of PETSc Option Table entries

With this I get a grid complexity of 1.33047, 6 multigrid levels,
MatPtAP/KSPSolve ratio of 0.24, and the linear solve at each TS step takes
5 iterations (with approx one order of magnitude reduction in residual per
step for iterations 2 through 5 and two orders for the first). The
convergence and grid complexity look good, but the ratio of grid coarsening
time to ksp-solve time is far from ideal. I've attached the log file from
this set of base parameters as well.

To investigate the effect of coarsening rates, I ran a parameter sweep over
the coarsening parameters (threshold and sq. graph) and I'm confused by the
results. For some reason either the number of gamg levels turns out to be
too high or it is set to 1. When I try to manually set the number of levels
to 4 (with pc_mg_levels 4 and thres. -0.04/ squaring of 10) I see
performance much worse than the base parameters. Any advice as to what I'm
missing in my search for a set of params where MatPtAP to KSPSolve is ~ 1 ?

[image: image.png]

Thanks in advance for the help and hope everyone is staying safe from the
virus!


-- 
Sajid Ali | PhD Candidate
Applied Physics
Northwestern University
s-sajid-ali.github.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200316/3df0b6e0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 108837 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200316/3df0b6e0/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_gamg
Type: application/octet-stream
Size: 105913 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200316/3df0b6e0/attachment-0001.obj>


More information about the petsc-users mailing list