Parallel computation

Hi, all!

How to properly run a FESTIM simulation in parallel?

@jhdark you may want to provide assistance on this since you’re used to run heavy calculations on clusters

Hey @VVKulagin

You can run festim simulations in parallel using the command

mpirun -np x python3 my_script.py

Where x corresponds to the number of logical processors you want to use. I would advise not using all the logical processors available to your PC though as you will need them for other functionality. Is this what you are after?

Is this what you are after?

Yeap, thank you for that.

I tried using mpirun -np x (x=2…16) with this 3D problem (~100k cells), but haven’t noticed any enhancements in the computation performance. I also ran in parallel a 1D problem with a decent amount of mesh elements, but the result is the same.

Could you, please, suggest an example of a FESTIM (or fenics) script which’ll benefit from parallelisation?

In short, I think parallel simulations only provide benefit in cases where the solving of the PDE is the dominant factor in the solving time, so in cases where massive meshes are used (~500k cells+), one can see more of a benefit. If this is not the case then it may increase simulation time in passing communications between the nodes. Also, not every feature in legacy fenics benefits from parallelisation or has full capability. Furthermore, festim hasn’t been explicitly designed to scale well, so in many cases, there may be a sweet spot in terms of the number of processors to use (which may sometimes be 1).

This being said, I will do some investigations to see specific cases in which it benefits and I will get back to you