[petsc-users] PETSc-MUMPS interface, numeric and symbolic factorisation

Matthew Knepley knepley at gmail.com
Fri May 4 08:44:18 CDT 2018


On Fri, May 4, 2018 at 9:40 AM, Y. Shidi <ys453 at cam.ac.uk> wrote:

> Dear PETSc users,
>
> I am currently using MUMPS to solve linear systems directly.
> Generally, we use ICNTL(7) or ICNTL(29) to do the preprocessing
> step and then solve the system.
>
> In my code, the values in the matrix is changed in each iteration,
> but the structure of the matrix stays the same, which means the
> performance can be improved if symbolic factorisation is only
> performed once. Hence, it is necessary to split the symbolic
> and numeric factorisation. However, I cannot find a specific step
> (control parameter) to perform the numeric factorisation.
> I have used ICNTL(3) and ICNTL(4) to print the MUMPS information,
> it seems that the symbolic and numeric factorisation always perform
> together.
>

If you use KSPSolve instead, it will automatically preserve the symbolic
factorization.

  Thanks,

     Matt


> So I am wondering if anyone has an idea about it.
>
> Below is how I set up MUMPS solver:
>   PC pc;
>   PetscBool flg_mumps, flg_mumps_ch;
>   flg_mumps    = PETSC_FALSE;
>   flg_mumps_ch = PETSC_FALSE;
>   PetscOptionsGetBool(NULL, NULL, "-use_mumps_lu", &flg_mumps, NULL);
>   PetscOptionsGetBool(NULL, NULL, "-use_mumps_ch", &flg_mumps_ch, NULL);
>   if(flg_mumps ||flg_mumps_ch)
>   {
>     KSPSetType(_ksp, KSPPREONLY);
>     PetscInt  ival,icntl;
>     PetscReal val;
>     KSPGetPC(_ksp, &pc);
>     /// Set preconditioner type
>     if(flg_mumps)
>     {
>       PCSetType(pc, PCLU);
>     }
>     else if(flg_mumps_ch)
>     {
>       MatSetOption(A, MAT_SPD, PETSC_TRUE);
>       PCSetType(pc, PCCHOLESKY);
>     }
>     PCFactorSetMatSolverPackage(pc, MATSOLVERMUMPS);
>     PCFactorSetUpMatSolverPackage(pc);
>     PCFactorGetMatrix(pc, &_F);
>     icntl = 7; ival = 0;
>     MatMumpsSetIcntl( _F, icntl, ival );
>     MatMumpsSetIcntl(_F, 3, 6);
>     MatMumpsSetIcntl(_F, 4, 2);
>   }
>   KSPSetUp(_ksp);
>
> Kind Regards,
> Shidi
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180504/e1385211/attachment-0001.html>


More information about the petsc-users mailing list