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

Y. Shidi ys453 at cam.ac.uk
Fri May 4 08:40:04 CDT 2018


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.

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


More information about the petsc-users mailing list