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

How to create a functionspace using MPI?

0 votes

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)

asked May 9, 2017 by aldenpack FEniCS User (1,450 points)

1 Answer

0 votes
 
Best answer

Because of how I have downloaded FEniCS the default python module does not have the same settings/packages as the ipython module. I don't know all the details but now things are working as they should when using ipython instead of python. (I have to load anaconda/3 as well as run 'source activate fenicsproject').

answered May 10, 2017 by aldenpack FEniCS User (1,450 points)
...