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

how to make MUMPS run in parallel

0 votes

Hello all,

I am trying to solve a linear problem with the following code

solve(a == L, s, solver_parameters={'linear_solver': 'mumps'}

Previously, when I run the code with "python main.py", this solver runs in parallel automatically, I don't need to do anything else. But after I reinstalled my ubuntu system, the solver is not running in parallel anymore. How should I set the system up to make it run in parallel? I installed fenics following the instruction showing on official website for ubuntu. All parallel libraries were all installed.

asked Jun 21, 2017 by sin2cos FEniCS Novice (130 points)

1 Answer

0 votes

Use mpirun:

mpirun -n 4 python main.py

In this case 4 is the number of processes to run.

answered Jun 21, 2017 by johannr FEniCS Expert (17,350 points)

I know we can run fenics code with mpirun, but my problem is actually a little bit different from this. Previously, even I run with "python main.py", the solver MUMPS is also run in parallel. But now it is not the case. I just reinstalled my system and fenics with the same steps as what I did in my previous old system. I am not so sure why it is not running in parallel now, and I am curious how can I configure the mumps solver in fenics to run in paralell even without mpirun. To write code which can run under mpirun will require a little bit more skills in some cases, I am not prepared to step into that world yet.

How are you determining if it is running in parallel? In my experience, without mpirun, I only see one core being used.

Sorry for answering a bit late.

I have a program which solves several pdes one after another. There is one PDE which always leads to a large linear problem since it is a mixed problem with a lot of unknowns. So I used mumps solver for this part. If you check with htop, all cores were fully occupied when this part of the code was run and it takes like 1 minutes to finish the calculation. This works very well with Fenics 2016.2.0, but recently, I reinstalled my system and updated my fenics to 2017.1.0. When I run my old code again, I found only one core is occupied and it takes about 20 minutes to solve it. In fenics 2016.2.0 with ubuntu 16.04, I am sure the mumps solver was working in parallel even you don't run with mpirun -np, now I can not figure out what has happedn with fenics 2017.1.0 or petsc, why mumps is not running in parallel by default.

Hmmm... maybe there has been a change in threading?
Take a look at here
In that case, I believe the thought was that the parallelism really came during assembly not the solver. If your code only took a minute to run, it might be hard to discern which took how long.

Looking at Change log, I see that "OpenMpAsssmebler" was removed... maybe that is the source of the change?

(Note: speculation. If there is a knowledgeable source please chime in!)

You might be SOL in avoiding running mpirun / mpiexec. Is your code a bash script? Maybe make an alias to avoid changing the script?

...