How can I create function spaces while using MPI in FEniCS? The following code runs fine if I exclude the last line but fails as soon as I include it.
import dolfin as d
from petsc4py import PETSc
from mpi4py import MPI
meshFile= "meshes/MyMesh.xml"
comm = PETSc.Comm(MPI.COMM_SELF)
mesh = d.UnitSquareMesh(comm, 25,25)
F = d.FunctionSpace(mesh,"CG",1)
I'm trying to follow the answer given in this QA.
https://fenicsproject.org/qa/3772/spawning-independent-dolfin-processes-with-mpi4py
I run the following in the terminal.
mpirun -np 3 python myScript.py
And the uninformative error that is returned is "BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES" (Tips on debugging with mpi4py would also be greatly appreciated)