[petsc-users] PCSHELL

Barry Smith bsmith at mcs.anl.gov
Thu Jul 25 18:27:38 CDT 2013


On Jul 25, 2013, at 4:17 PM, Su Yan <suyan0 at gmail.com> wrote:

> I do not think they take the reordering as an input.I will need to reorder it myself and then pass it to the ILUT subroutine.

   Ok, this is likely not particularly good for performance, completely reordering a sparse matrix explicitly is expensive time wise. The way it is usually handled in most sparse solvers is to perform the factorization in the new ordering but using the matrix in the old ordering and just traverse the matrix in the old ordering according to the new ordering; this prevents two copies of the matrix and the total explicit new ordering. 
We never totally explicitly reorder a matrix and then factor it.

   Barry

> 
> 
> On Thu, Jul 25, 2013 at 4:08 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> On Jul 25, 2013, at 4:04 PM, Su Yan <suyan0 at gmail.com> wrote:
> 
> > Thanks, Barry.
> >
> > I have interfaced PETSc with MKL ILUT preconditioner through PCSHELL,
> 
>    Does MKL ILUT take a reordering (that is a permutation of the set {0,1,2,….n-1} as an input argument? Or do they want you to reorder the matrix in the new ordering explicitly and pass that new matrix into the MKL routine?
> 
>    Barry
> 
> > but want to use reordering technique comes with the PETSc package. Probably I can do it by extracting the reordering matrices, but the system matrix is the Jacobian set by SNESSetJacobian() and solved by KSP. Since the Jacobian matrix is changing for different Newton steps, I am strill trying to figure out how to implement the reordering my self.
> >
> > Best,
> > Su
> >
> >
> > On Thu, Jul 25, 2013 at 3:09 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> > On Jul 25, 2013, at 12:01 PM, Su Yan <suyan0 at gmail.com> wrote:
> >
> > > Hi, can I use PCSetType(myPC, PCSHELL); together with PCFactorSetMatOrderingType(myPC, MATORDERINGRCM)?
> >
> >    PCFactorSetMatOrdering() is only effective if the PC is a subclass of PCFactor, for example PCLU is a subclass of PCFactor as are PCILU and PCCHOLESKY and PCICC
> >
> >    If you want to use things like this you cannot use PCSHELL (which is a subclass of only the basic PC) you can copy the code for PCCreate_LU() for example and modify it for what you want to do.  Or you can register new factorization and solver package as a MatSolverPackage; see for example superlu.c in mat/impls/aij/seq/superlu/
> >
> >    What is it you want to do?
> >
> >    Barry
> >
> >
> > >
> > > Will the reordering still take effect?
> > >
> > > Thanks,
> > > Su
> > >
> >
> >
> 
> 



More information about the petsc-users mailing list