[petsc-dev] MR 2036 : Better implementation of multipreconditioning

Smith, Barry F. bsmith at mcs.anl.gov
Sun Oct 13 00:14:00 CDT 2019



> On Oct 11, 2019, at 9:19 AM, Pierre Gosselet via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
> 
> Dear all,
> Barry kindly identified many flaws in our implementation, which gives
> us many opportunities to improve our code (which is currently under MR 
> https://gitlab.com/petsc/petsc/merge_requests/2036).  Among his many
> comments and suggestions, there are two points for which we
> particularly need advice:

 

> 
> 1) Regarding the organization of the code. Till now, we had put
> multipreconditioned solvers with their classical solver (mpcg with cg,
> mpomin with gcr) which made it unnatural to factorize code. Our new
> proposition is to have a directory for multipreconditioned solvers:
> src/ksp/ksp/impl/mpsolvers/{mp.h, mp.c, mpcg.c, mpomim.c} mp.{c,h} will
> gather common pieces of code (maybe mpsolvers or mpksp instead of just
> mp).

  Sounds fine

> 
> 2) We need communication between the multipreconditioned solver and its
> preconditioner. It seems that the combination
> [Container/Compose()/Query()] makes it possible for the solver to read
> data from the preconditioner.
> But we also need the preconditioner (which can be regular pc, like asm)
> to know that its parent solver requires multipreconditioning. In these
> cases, the setup phase requires for instance some special allocations. 
> A possibility is to force all mp solvers to have names starting with
> "mp" so that the pc can check hdr.parent.type_name. But there probably
> are better mechanisms to transfer this piece of information, rather
> than hacking the name of the parent ksp.
> 

     Lets make this simple. Add a field to _p_PC  a field PetscBool usemp; and then a function PCSetUseMP() which sets that flag. 

     The MP Krylov methods would call in their setups PCSetUseMP() on their PC which sets the flag that the PCSetUp_XXX would check if they had to do the additional setup.

  Good luck

Barry



> thank you for your answers,
> pierre and nicolas
> 
> -- 
> Pierre Gosselet
> CR CNRS (research agent) 
> LMT -- ENS Paris-Saclay/UMR8535
> 61 av. du président Wilson, 94235 CACHAN
> tel: +33 1 47405333
> 



More information about the petsc-dev mailing list