[petsc-dev] Error using FGMRES as a smoother for PCMG
Patrick Sanan
patrick.sanan at gmail.com
Wed Mar 14 07:17:10 CDT 2018
We saw a regression with our code when updating from 3.7 to 3.8.
The immediate reason is this commit, which removes the default support for
KSP_NORM_NONE :
https://bitbucket.org/petsc/petsc/commits/d964cf50809c6d62ebfac94313c885678fbcc365
This caused our regression because we have a test using FGMRES as a
smoother. PCMG by default sets the norm type to none, but FGMRES doesn't
have explicitly-specified support for this norm type.
You can reproduce in maint with a KSP example, e.g.
cd $PETSC_DIR/src/ksp/ksp/examples/tutorials
./ex23 -ksp_type fgmres -ksp_max_it 3 -ksp_norm_type none
./ex50 -pc_type mg -pc_mg_levels 2 -mg_levels_ksp_type fgmres
Note that the the following work
./ex23 -ksp_type gmres -ksp_max_it 3 -ksp_norm_type none
./ex23 -ksp_type fgmres -ksp_max_it 3 -ksp_convergence_test skip
./ex50 -pc_type mg -pc_mg_levels 2 -mg_levels_ksp_type gmres
But this does not
./ex50 -pc_type mg -pc_mg_levels 2 -mg_levels_ksp_type fgmres
-mg_levels_ksp_convergence_test skip
A "quick fix" here would be
1) Add following line to KSPCreate_FGMRES() :
ierr = KSPSetSupportedNorm(ksp,KSP_NORM_NONE,PC_RIGHT,1);CHKERRQ(ierr);
2) Fix the man page for KSPSetSupportedNorm() to remove the outdated
information about default support for KSP_NORM_NONE.
I will speculatively submit a PR for maint with this.
However, the deeper problem may be some inconsistency in the code about the
difference between a method being able to proceed without computing a norm,
and the desire (for smoothing, usually) to skip a convergence test.
Perhaps a better resolution would be to change this line to instruct
smoother KSPs to skip convergence tests, as opposed to not use a norm -
worth pursuing?
https://bitbucket.org/petsc/petsc/src/a04709285cba4f746cbcb9aa495f8cf7adf5132d/src/ksp/pc/impls/mg/mg.c?at=master&fileviewer=file-view-default#mg.c-239
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180314/d03a6eef/attachment.html>
More information about the petsc-dev
mailing list