[petsc-users] Reuse symbolic factorization with petsc - mumps

459543524 459543524 at qq.com
Thu Feb 17 02:42:51 CST 2022


Sir, I have a problem when using petsc.


I want to solve a series of linear equations.


A1*x1=b1, A2*x2=b2, A3*x3=b3 ...


The A1,A2,A3 have the same sparstiy pattern.


I want to use MUMPS to solve the system.
In order to enhance performance, I want to reuse the symbolic factorization.


Here my code for solve a single linear system is
-----------------------------------------------------
Mat A, P, F;
PC pc;
Vec rhs_vec, result_vec;
KSPSetOperators(ksp, A, A);
KSPSetType(ksp, KSPPREONLY);
KSPGetPC(ksp, &pc);
PCSetType(pc, PCLU);
PCFactorSetMatSolverType(pc, MATSOLVERMUMPS);
PCFactorSetUpMatSolverType(pc);
PCFactorGetMatrix(pc, &F);
MatMumpsSetIcntl(F, 7, 5); // configure mumps.
KSPSolve(ksp, rhs_vec, result_vec);
-----------------------------------------------------




I have no idea how to reuse symbolic factorization when using MUMPS.


I have see the information from interent. The petsc developper have suggested that using:
KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN)
KSPSetOperators(KSP_A, A, A, SAME_NONZERO_PATTERN)
However, this API seems depreacted.
see https://lists.mcs.anl.gov/pipermail/petsc-users/2013-March/016646.html


I have see there exist API: MatLUFactorSymbolic,  MatLUFactorNumeric(). but I have no idea how to call it.


Could you please give me an example how to reuse the symbolic factorization when using MUMPS in petsc?


Thanks for your time.


Xu Hui







 

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


More information about the petsc-users mailing list