[petsc-users] MatSolve in CG - PCPreSolve
Matthew Knepley
knepley at gmail.com
Tue Nov 11 07:54:18 CST 2014
On Tue, Nov 11, 2014 at 6:27 AM, De Groof, Vincent Frans Maria <
Vincent.De-Groof at uibk.ac.at> wrote:
> Dear all,
>
>
> I think I further pinpointed the problem to the PCPreSolve. Both mine,
> as well as Petsc's PCG call PCPreSolve and enter the (pc->ops->presolve).
> But mine does not apply the presolve.
>
I do not understand what you mean here. It calls PCPreSolve from KSPSolve.
Thanks,
Matt
> Do I need to activate the PCPreSolve manually when I have written a KSP
> that I've registered using KSPRegister?
>
>
>
> thanks,
> Vincent
>
>
> ------------------------------
> *Von:* De Groof, Vincent Frans Maria
> *Gesendet:* Montag, 10. November 2014 17:57
> *An:* petsc-users at mcs.anl.gov
> *Betreff:* MatSolve in CG
>
> Dear all,
>
>
> I am writing a few variations on the PCG algorithm. Starting with my own
> PCG implementation, I noticed that my routine is quite a bit slower (~20%).
> I think I tracked it down to the MatSolve calls in PCApply. I am using BDDC
> as the preconditioner.
>
> In the Petsc PCG function, each PCApply calls the MatSolve 3 times. It
> also calls MatSolve once somewhere between calling KSPSolve and KSPSolve_CG
> (KSP_SetUp has been called before). So MatSolve is called 1+3*(#
> iterations) per KSPSolve. In my own PCG variation, the initial MatSolve is
> not called. But MatSolve is called 4 times in each iteration, so in total
> 4*(# iterations).
>
> Where does this MatSolve in between KSPSolve and KSPSolve_CG come from?
> And how can I make my function use less MatSolve's?
>
>
> I hope that I explained the problem clearly, and maybe this is a very
> trivial question.
>
>
> kind regards,
> Vincent
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141111/71e832e6/attachment.html>
More information about the petsc-users
mailing list