This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How can I set the linear solver to MUMPS in dolfin 1.5?

0 votes

Hello

I need to set the linear solver to MUMPS. I try to use

prm = solver.parameters
prm['linear_solver']='mumps'

but I received the error

*** Error:   Unable to solve linear system.
*** Reason:  Unknown solver method "mumps". Use list_linear_solver_methods() to list available methods.

How is the right way to set it? I'm using DOLFIN 1.5.

Best regard
Valentina

asked Jun 16, 2015 by ValeS FEniCS Novice (330 points)

1 Answer

0 votes

This should work:

solver.parameters["linear_solver"] = "mumps"

Are you sure mumps is available on your installation of FEniCS? Try list_linear_solver_methods() to see what is available.

>>> list_linear_solver_methods()
Solver method  |  Description                                                 
------------------------------------------------------------------------------
default        |  default linear solver                                       
umfpack        |  UMFPACK (Unsymmetric MultiFrontal sparse LU factorization)  
mumps          |  MUMPS (MUltifrontal Massively Parallel Sparse direct Solver)
superlu_dist   |  Parallel SuperLU                                            
petsc          |  PETSc built in LU solver                                    
cg             |  Conjugate gradient method                                   
gmres          |  Generalized minimal residual method                         
minres         |  Minimal residual method                                     
tfqmr          |  Transpose-free quasi-minimal residual method                
richardson     |  Richardson method                                           
bicgstab       |  Biconjugate gradient stabilized method    
answered Jun 16, 2015 by johannr FEniCS Expert (17,350 points)

I try list_linear_solver_methods() and I discover that mumps is not available on my installation. What have I to do to solve this problem?
I've Dolfin 1.5 on mac os 10.10 (yosemite).

Thank you for the answer!

The problem is that OS X does not come with a Fortran compiler, which is needed to build PETSc with MUMPS. If you installed FEniCS using the fenics-install.sh script, then you can try the superlu_dist as an alternative to mumps. The FEniCS binary package does not have superlu_dist.

Thank you but I didn't install fenics with the fenics-install.sh so i can't try the superlu_dist.

Is there a way to set the solver to MUMPS in C++? I cannot find any reference to this...

@senseiwa:

solver.parameters["linear_solver"] = "mumps";

Unfortunately, it won't work. This is the C++ code:

// Solver
PETScLUSolver solver;
solver.parameters["linear_solver"] = "mumps";

and the error says I cannot use that:

*** Error:   Unable to access parameter.
*** Reason:  Parameter "petsc_lu_solver.linear_solver" not defined.
*** Where:   This error was encountered inside Parameters.cpp.
...