<div dir="ltr">I think Yuyun is saying "....<span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">inevitable to encounter significant slowdown compared to using a fully assembled matrix <b>with a suitable preconditioner</b>? </span>"<div><br></div><div>You convergence rate will basically always be better with a preconditioner and unless you are solving the identity (mass matrix) then it will often be significant.</div><div><br></div><div>Jed is responding to comparing un-preconditioned matrix vs matrix-free and you do want to check that they are identical if you think you have an exact Jacobian of a linear problem.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 28, 2020 at 9:54 AM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If the number of iterations is (significantly) different, then you'd<br>
have to debug why your code doesn't implement the same linear operator.<br>
You can use MatComputeOperator or -ksp_view_mat_explicit to help reveal<br>
differences.<br>
<br>
If the number of iterations is the same but your code is slower, then<br>
you'd have to optimize the performance of your code.<br>
<br>
Yuyun Yang <<a href="mailto:yyang85@stanford.edu" target="_blank">yyang85@stanford.edu</a>> writes:<br>
<br>
> Hello team,<br>
><br>
> If I use KSPSolve for Ax=b using Matshell (a user-defined stencil equivalent of A) without preconditioning (since the standard PC would need information of the matrix so cannot apply it to matrix-free method), is it possible, or even inevitable to encounter significant slowdown compared to using a fully assembled matrix with a suitable preconditioner? I'm running a small example and it's already taking a long time for Matshell to converge.<br>
><br>
> Thanks for your help,<br>
> Yuyun<br>
</blockquote></div>