[petsc-users] Speed of KSPSolve using Matshell vs. regular matrix

Jed Brown jed at jedbrown.org
Sat Mar 28 08:54:29 CDT 2020


If the number of iterations is (significantly) different, then you'd
have to debug why your code doesn't implement the same linear operator.
You can use MatComputeOperator or -ksp_view_mat_explicit to help reveal
differences.

If the number of iterations is the same but your code is slower, then
you'd have to optimize the performance of your code.

Yuyun Yang <yyang85 at stanford.edu> writes:

> Hello team,
>
> 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.
>
> Thanks for your help,
> Yuyun


More information about the petsc-users mailing list