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

Executing a FEniCS script in parallel

0 votes

Hi,

I have a FEniCS script which has not been written in parallel. According to the website of FEnics program, I found that by calling "mpirun -np 8 python script.py", I will be able to execute it in parallel. However; it takes longer than it took before. Does anyone know what is the reason?
Is this command enough or should I add some commands in the script?
Any helps will be appreciated.

Thanks.
Dan

asked Jun 16, 2017 by Danial FEniCS Novice (120 points)

The command is correct. My Assumtion:

Your test problem is too small. In this case, distributing takes longer than solving on a single core. Just try a bigger mesh and test different numbers of procs.

my experience in 3D with MUMPS solver and p1 polynomials:

< 5k nodes = 1 proc
< 50 k nodes = max. 10 procs
< 200 k nodes = max. 20 procs

Agree. Also depends where it is slowing down. You can add some flags (print statements) to see where the problem is. A lot depends on what exactly you are doing.

Thanks for sharing your experience. I tried with a bigger mesh and now it solves faster. Also, by using "mpirun -np 8 python script.py" I got strange results (piecewise motion) compared to the results obtained python script.py (Continues motion). Do you think what can be the reason? Should I add some other commands? Thanks.

Best,
Danial

What do you mean by 'piece-wise motion' mean?

"What do you mean by 'piece-wise motion' ?"

That's my question, too. Maybe you can post a minimal example?

...