[petsc-dev] Performance of Petsc Cholesky vs LU

Barry Smith bsmith at mcs.anl.gov
Wed Nov 30 13:38:11 CST 2011


On Nov 30, 2011, at 12:10 AM, Jed Brown wrote:

> On Tue, Nov 29, 2011 at 23:53, Dave Nystrom <dnystrom1 at comcast.net> wrote:
> I have a resistive mhd code that I have recently interfaced to petsc which
> has 7 linear solves that are all symmetric.  I recently tried using -pc_type
> cholesky -ksp_type preonly for a run and found that it was taking about 6
> times as long per linear solve as when I was using -pc_type lu -ksp_type
> preonly.
> 
> Try -pc_factor_mat_ordering_type nd
>  
>  I was wondering if that was reasonable behavior.  I would not have
> thought that using a cholesky direct solve would take longer than an LU
> direct solve in petsc for the serial case and was hoping it would be faster.
> Does this behavior seem reasonable?
> 
> Try this:
> 
> -pc_type cholesky -pc_factor_mat_ordering_type nd
> 
> Barry, why is natural ordering still the default for Cholesky? It is so slow that it is worthless.

   With the sbaij format you cannot simply using any ordering to do the factorization efficiently because you are "missing" half the entries in the matrix. With aij there is no such limitation so you can use the good orderings. Thus the sbaij format is of limited utility if you want to do direct factorization. You should continue to use the aij format and select the -pc_type of cholesky.

   Barry

Jed if you know how to do efficient Cholesky with nd ordering using the sbaij data structure that would be a great addition to PETSc but I think it is likely impossible.





More information about the petsc-dev mailing list