For a large parallel sparse matrix (mpiaij type matrix) in my code, I was experimenting with various preconditioners to see which one would do best with GMRES/BiCGSTAB. I tried the PCMG preconditioner without specifying any grid/interpolation/restriction information, and this actually seemed to do pretty well for my problem. At first, I was confused about what this actually did since I didn't give PETSc any information about the grid and whatnot, but I think that all it is doing is performing a single smoothing step. Thus, I wanted to know what exactly this "smoother" is since it seems to work fairly well as a preconditioner. I tried looking through the PCMG documentation but I couldn't figure it out.

Could someone tell me what the default smoother is for the PCMG preconditioner, or at least offer some advice on how I could figure out what it is? I've tried scouring through the PETSc documentation without much luck.

EDIT: As noted in the comments below, it seems that it is the Chebyshev smoother. However, PETSc documentation says Chebyshev only works for symmetric positive (semi) definite matrices. So, how can this be? Can someone explain this?

  • $\begingroup$ A naive reading of line 242 of mcs.anl.gov/petsc/petsc-current/src/ksp/pc/impls/mg/… suggests KSPCHEBYCHEV, but I'm no expert. $\endgroup$ – origimbo Feb 9 '17 at 21:02
  • 1
    $\begingroup$ I think you ought to be able to call PCMGGetSmoother(pc,0, &ksp) then KSPGetType(ksp,type) and then print the string to confirm. $\endgroup$ – origimbo Feb 9 '17 at 21:06
  • $\begingroup$ @origimbo Hm.. it would appear so. However, the help page mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/… suggests that their implementation of Chebyshev only works for symmetric matrices, which is not what I have... I will try your 2nd suggestion... $\endgroup$ – nukeguy Feb 9 '17 at 22:23
  • $\begingroup$ Hm you're right. It is the Chebyshev smoother. But how can that be? PETSc suggests that it only works for symmetric matrices... $\endgroup$ – nukeguy Feb 9 '17 at 23:23
  • $\begingroup$ Remember to use -ksp_view or -snes_view to look at what your solver actually consists of. (This is a key step when it first starts to work decently, so you know what to credit!) It will tell you that your (default) smoother is Chebyshev when you have chosen -pc_type mg. $\endgroup$ – Ed Bueler Oct 29 '17 at 21:20

For pc_type mg, the default smoother is Chebyshev as is specified in PETSC documentation:

The preconditioned Chebyshev iterative method
The Chebyshev method requires both the matrix and preconditioner to be symmetric positive (semi) definite. Only support for left preconditioning.
Chebyshev is configured as a smoother by default, targetting the "upper" part of the spectrum.

Worth to mention, that the comments suggesting using -ksp-view advertise very good practices.

Now, this is true that Chebyshev is designed to work only with SPD matrices. However, the fact that it will become unstable for "very non-SPD matrices" (having eigenvalues relatively far away from the real axis), does not mean that it will not work at all for "slightly non-symmetric matrices". So, your problem might be not unsymmetric enough.

Note, that low-order Chebyshev is very close to Richardson, so no wonder it might work surprisingly well for certain not necessarily SPD cases.

However, it is not recommended to use Chebyshev (the default) for matrices that are known to have a significant imaginary component to their eigenvalues and switch to Richardson or GMRES.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.