Hi! I am trying to run FEniCS in parallel with a unique setup.
I am running v2019.1.0 on Ubuntu 18.04 installed with apt-get
The FEniCS problem .py
file defines a Function of type dolfin.functions.function.
and then passes the Function to an external coupling library for evaluation. This Function passing happens runtime. As soon as the external coupling library tries to evaluate the function FEniCS hangs and I see no terminal output. I have to kill all the processes manually.
Interestingly this problem is resolved if I evaluate the function once in the FEniCS problem.py file before passing it to the library. This evaluation is in such a way:
for vertex in fenics.vertices(mesh):
function(vertex.x(0), vertex.x(1))
A minimum working example for the issue is here.
The example can be run by mpirun -np N python3 exec.py
(N = no. of processors). The code will hang at the current state thus exhibiting the problem.
The same example will run through if run on one processor mpirun -np 1 python3 exec.py
.
If line 29 and 30 in exec.py
are un-commented to insert the function evaluation then the example runs in parallel without any issue.
Is there a reason why I need to evaluate the function before passing it? Can I avoid this?