<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 4, 2015 at 8:12 AM, Justin Chang <span dir="ltr"><<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</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"><div dir="ltr"><div><div><div><div><div><div><div>Hello everyone,<br><br></div>Apologies if this sounds like a newbie question, but I am attempting to play around with the gamg preconditioner for my anisotropic diffusion problem, but I have no idea how to "fine tune" the parameters such that I get better performance. I understand that this depends on both the material properties and the type of mesh used, but I guess for starters, here is what I am doing and some stuff I have noticed:<br><br></div>- I am solving a unit cube with a small hole in the middle. The outside BC conditions are 0 and the inside is unity. I have a tensorial dispersion diffusivity (with constant velocity). I have 6 different sized grids to solve this problem on. The problem sizes range from 36K dofs to 1M dofs. I was able to solve all of them using the CG and Jacobi solver and preconditioner combination. <br><br>- When I try to solve them using CG and GAMG (I did not set any other command line options) I seem to get slower wall clock times but with much fewer KSP iterations. I also notice that the FLOPS/s metric is much smaller.<br></div><br></div>- For certain meshes, my CG/GAMG solver fails to converge after 2 iterations due to DIVERGED_INDEFINITE_PC. This does not happen when I solve this on one processor or with the CG/Jacobi solver.<br><br></div>From what I have read online and through these petsc-mailing lists, it sounds to me the gamg preconditioner will give better performance for nice elliptic problems like the one I am solving. When I saw the SNES ex12 test case 39 from builder.py, it only had -pc_type gamg. I am guessing that I need to set additional command line options? If so, where should I start?<br></div></div></div></blockquote><div><br></div><div>Mark recommends starting with</div><div><br></div><div><div style="font-size:12.8000001907349px"><div>-ksp_type cg</div><div>-pc_type <span class="">gamg</span></div><div>-pc_gamg_agg_nsmooths 1<br></div><div>-pc_gamg_threshold 0.02  #  [0 - 0.1]</div><div>#-mg_levels_ksp_type richardson</div><div>-mg_levels_ksp_type chebyshev<br></div><div>-mg_levels_pc_type sor</div><div>#-mg_levels_pc_type jacobi<br></div><div>-mg_levels_ksp_max_it 2   # [1-8]</div><div><br></div><div>and messing with the # stuff.</div><div><br></div><div>1) GAMG should definitely be more scalable than CG/ILU. You should be able to see this by plotting the time/iterates as a function of problem size. GAMG</div><div>    should have a constant number of iterates, whereas CG should grow. GAMG will have higher overheads, so for smaller problem sizes CG can be better.</div><div><br></div><div>2)  The <span style="font-size:small">DIVERGED_INDEFINITE_PC can happen if the GAMG is non-symmetric due to different number of iterates or the subsolver choice. Try out</span></div><div><span style="font-size:small">     richardson instead of chebyshev.</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">3) If your coefficient is highly anisotropic, GAMG may need help making good coarse basis vectors. Mark has some experimental stuff for this. Adjusting the</span></div><div><span style="font-size:small">    thresholding parameter determines how fast you coarsen (you can see the coarse problem sizes in -ksp_view). If its too fast, convergence deteriorates,</span></div><div><span style="font-size:small">    too slow and the coarse problems are expensive.</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">    Mark, how do you turn on heavy-edge matching?</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">  Thanks,</span></div><div><span style="font-size:small"><br></span></div><div><span style="font-size:small">     Matt</span></div></div></div><div> </div><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"><div dir="ltr"><div><div></div>Thanks,<br></div>Justin<br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>