[petsc-users] MUMPS icntl for petsc4py
Jose E. Roman
jroman at dsic.upv.es
Sun Jan 22 03:58:11 CST 2023
You have to call ST.getOperator() as is done in this C example:
https://slepc.upv.es/documentation/current/src/eps/tutorials/ex43.c.html
Jose
> El 22 ene 2023, a las 10:40, Quentin Chevalier <quentin.chevalier at polytechnique.edu> escribió:
>
> Hello PETSc users,
>
> I'm getting an INFOG(1)=-9 and INFO(2)=27 error on an eigenvalue code based on dolfinx run in a docker container. Based on https://mumps-solver.org/doc/userguide_5.5.1.pdf, I figured the fix would be to increase ICNTL(14).
>
> I'm coding in python through the petsc4py/slepc4py wrapper. I found a Mat.setMumpsIcntl method but I can't seem to place it properly and always obtain another error : "Operation done in wrong order and the like".
>
> Here's the code snippet that is failing :
> # Solver
> EPS = SLEPc.EPS().create(COMM_WORLD)
> EPS.setOperators(-A,M) # Solve Ax=sigma*Mx
> EPS.setProblemType(SLEPc.EPS.ProblemType.PGNHEP) # Specify that A is not hermitian, but M is semi-definite
> EPS.setWhichEigenpairs(EPS.Which.TARGET_MAGNITUDE) # Find eigenvalues close to sigma
> EPS.setTarget(sigma)
> EPS.setDimensions(2,10) # Find k eigenvalues only with max number of Lanczos vectors
> EPS.setTolerances(1e-9,100) # Set absolute tolerance and number of iterations
> # Spectral transform
> ST = EPS.getST(); ST.setType('sinvert')
> # Krylov subspace
> KSP = ST.getKSP()
> KSP.setTolerances(rtol=1e-6, atol=1e-9, max_it=100)
> # Krylov subspace
> KSP.setType('preonly')
> # Preconditioner
> PC = KSP.getPC(); PC.setType('lu')
> PC.setFactorSolverType('mumps')
> KSP.setFromOptions()
> EPS.setFromOptions()
> PC.getFactorMatrix().setMumpsIcntl(14,50)
> print(f"Solver launch for sig={sigma:.1f}...",flush=True)
> EPS.solve()
> n=EPS.getConverged()
>
> For context, matrix A is complex, size 500k x 500k but AIJ sparse, and I'm running this code on 36 nodes.
>
> I'd appreciate any insight on how to fix this issue, it's not clear to me what the order of operations should be. Funnily enough, it's very shift-dependent.
>
> Cheers,
>
> Quentin
More information about the petsc-users
mailing list