[petsc-users] Incomplete Cholesky Factorization in petsc

Zhang, Hong hongzhang at anl.gov
Tue Dec 5 14:27:20 CST 2017


Why not include PETSc MatSolve() (which solves Ax=b) in your wrapper? Getting the factored matrix is not typically needed.

Hong (Mr.)

On Dec 5, 2017, at 2:15 PM, Wenlong Gong <wenlonggong at gmail.com<mailto:wenlonggong at gmail.com>> wrote:

My main project is written in R that's why I need a wrapper function of ICC(0) in order to call it from R. I tried the IncompleteCholesky() in rcppEigen, basically the Eigen library but it turns out to be a modified incomplete Cholesky. Beside that, I didn't find any incomplete Cholesky functions available in R so I turned to the petsc.

I will apply this ICC for very big sparse matrix and hope the function to have almost linear computation complexity. I didn't write the function by myself because it might be too slow comparing to an well-written and optimized ICC() in existing C/C++ library.

-Wendy

On Tue, Dec 5, 2017 at 1:49 PM, Smith, Barry F. <bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>> wrote:


> On Dec 5, 2017, at 9:32 AM, Wenlong Gong <wenlonggong at gmail.com<mailto:wenlonggong at gmail.com>> wrote:
>
> Barry, Thank you for the reply! It makes sense If two IC() function returns slightly different factored matrix. But the IC factor matrix from PETSc is not even close to what I get from ichol in Matlab.
> Ultimately I need this incomplete cholesky factorization function wrapped in R once it gives correct result.

   What do you mean by wrapped in R?

   Does R not have a ICC(0)? ICC(0) with the natural ordering is actually very simple to write. You could easily write it presumably directly in R or in C in a format callable from R.

   Barry



> Not sure if I used the easiest way to get IC so I also seek for help on getting a concise version of IC().
>
> -Wendy
>
>
> On Mon, Dec 4, 2017 at 10:07 PM, Smith, Barry F. <bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>> wrote:
>
>   I'm not sure what your goal is. In general two different IC(0) codes might produce slightly different factorizations based on implementation details even if they claim to run the same algorithm so I don't think there is a reason to try to compare the factors they produce.
>
>   In addition PETSc, as well as most IC/ILU/LU  codes store the factored matrices in a "non-conventional" form that is optimized for performance so it is not easy to just pull out the "factors" to look at them or compare them.
>
>     Barry
>
>
> > On Dec 4, 2017, at 9:07 PM, Wenlong Gong <wenlonggong at gmail.com<mailto:wenlonggong at gmail.com>> wrote:
> >
> > Hello,
> >
> > I'm trying to use the Incomplete Cholesky Factorization for a sparse matrix in petsc. I started with a 10*10 matrix and used ksp and pc in order to get the ICC(0) factor, with no fill-in, natural ordering. However, the returned factor matrix does not match with the answer I got from matlab ichol() function.
> >
> > The code with the hard-coded data is attached here. I would appreciate if anyone could help check if I did anything wrong.Please let me know if there is easier way to get this incomplete cholesky factor. Thanks!
> >
> > Best regards,
> > Wendy
> >
> > <repex.c>
>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171205/de49e08e/attachment.html>


More information about the petsc-users mailing list