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

Using petsc direct solver in parallel

+5 votes

I want to use a direct solver in parallel. Does the petsc LU solver work in parallel ? I do something like this

  problem = NonlinearVariationalProblem(F, up, self.bc, dF)
  solver  = NonlinearVariationalSolver(problem)
  solver.parameters['newton_solver']['linear_solver'] = 'petsc'
  solver.solve()

But this gives me petsc error

[0]PETSC ERROR: No support for this operation for this object type!
[0]PETSC ERROR: Matrix format mpiaij does not have a built-in PETSc
LU!

asked Apr 18, 2014 by praveen FEniCS User (2,760 points)

If I solve with default solvers, I get this error

*** Error: Unable to solve linear system using PETSc LU solver.
*** Reason: No suitable solver for parallel LU found. Consider configuring PETSc with MUMPS or SuperLU_dist.

I am using the mac binary. Does this mean the binary does not have support for MUMPS and SuperLU_dist ?

2 Answers

+2 votes
 
Best answer

PETSc does not have a native parallel LU solver. Moreover, the PETSc native LU solver is only recommended for small problems. The primary purpose of the PETSc LU solver is to solve small systems, such as the coarse level in a multigrid solver.

If you want a parallel direct solver, configure PETSc with MUMPS (--download-mumps) and/or SuperLU_dist (--download-superlu_dist`).

answered Apr 20, 2014 by Garth N. Wells FEniCS Expert (35,930 points)
selected Apr 20, 2014 by praveen
0 votes

Not that I've seen no. Unfortunately there doesn't seem to be an easy way to switch to a petsc that does have MUMPS installed either.
How 'parallel' are you trying to go? You might want to look into the iterative methods petsc has through snes. It's fairly simple to start too, add the line:

solver.parameters['nonlinear_solver']='snes'

Advice that I got from a PETSc aficionado is that they scale better for larger numbers of processors.

answered Apr 18, 2014 by mwelland FEniCS User (8,410 points)

My problem is Navier-Stokes with Boussinesq approximation in 2-d. I have less than 50000 dofs at present.

...