<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 11, 2014 at 6:27 AM, De Groof, Vincent Frans Maria <span dir="ltr"><<a href="mailto:Vincent.De-Groof@uibk.ac.at" target="_blank">Vincent.De-Groof@uibk.ac.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>Dear all,</div>
<div><br>
</div>
<div><br>
</div>
<div>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. </div></div></div></blockquote><div><br></div><div>I do not understand what you mean here. It calls PCPreSolve from KSPSolve.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>Do I need to activate the PCPreSolve manually when I have written a KSP that I've registered using KSPRegister?</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>thanks,</div>
<div>Vincent</div>
<div><br>
</div>
<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000"><b>Von:</b> De Groof, Vincent Frans Maria<br>
<b>Gesendet:</b> Montag, 10. November 2014 17:57<br>
<b>An:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Betreff:</b> MatSolve in CG<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Dear all,
<div><br>
</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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). </div>
<div><br>
</div>
<div>Where does this MatSolve in between KSPSolve and KSPSolve_CG come from? And how can I make my function use less MatSolve's?</div>
<div><br>
</div>
<div><br>
</div>
<div>I hope that I explained the problem clearly, and maybe this is a very trivial question.</div>
<div><br>
</div>
<div><br>
</div>
<div>kind regards,</div>
<div>Vincent</div>
</div>
</div>
</div>
</div>
</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>