Can't use Eigen backend in Fenics 2019.1.0

I recently moved my code and my installation to the conda based Fenics 2019.1.0. I realized after making the switch from 2017.2.0 that many things are broken in my code after making the upgrade. Although I have fixed most of it, I am stuck at resolving one of the last issues.

In my code I want to use the Eigen backend to see if I get consistent answers as from the earlier code base. But I have a number of Function.copy(u, deepcopy=True) or u.function_space() and all of these break with the error message:

“Duplication of MPI communicator failed (MPI_Comm_dup”

How can I fix this in the easiest manner? Thanks

Debugging session below for more context:

(fenicsproject) mod0@iasi:code_FEniCS_GARK_adjoints$ python test.py
(fenicsproject) mod0@iasi:code_FEniCS_GARK_adjoints$ python bsvd_successiverefine_markanddivide.py
WARNING: user expression has not supplied value_shape method or an element. Assuming scalar element.
Form has no parts with arity 2.
Recomputing space-time reference solution.
> /home/mod0/GIT/adjoints-for-multiphysics/GARK/code_FEniCS_GARK_adjoints/Gryphon/source/src/GARK2.py(272)solve()
-> if np.equal(np.mod(N, 1), 0):
(Pdb) n
> /home/mod0/GIT/adjoints-for-multiphysics/GARK/code_FEniCS_GARK_adjoints/Gryphon/source/src/GARK2.py(273)solve()
-> self.N        = np.int16(N)
(Pdb)
> /home/mod0/GIT/adjoints-for-multiphysics/GARK/code_FEniCS_GARK_adjoints/Gryphon/source/src/GARK2.py(274)solve()
-> self.u_sol    = [Function(self.u.function_space()) for i in range(self.N)]
(Pdb)
RuntimeError: *** Error: Duplication of MPI communicator failed (MPI_Comm_dup
> /home/mod0/GIT/adjoints-for-multiphysics/GARK/code_FEniCS_GARK_adjoints/Gryphon/source/src/GARK2.py(274)solve()
-> self.u_sol    = [Function(self.u.function_space()) for i in range(self.N)]
(Pdb) self.u
Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1), FiniteElement('Lagrange', triangle, 2)), 11)
(Pdb) self.u.function_space()
FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1), FiniteElement('Lagrange', triangle, 2))
(Pdb) Function(self.u.function_space())
Coefficient(FunctionSpace(Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 1), FiniteElement('Lagrange', triangle, 2)), 6126)
(Pdb)

Strangely, if I step over it, it raises an error but not if I execute it in the debugging session. Any help is appreciated.

I don’t know if this helps:

Functionality no longer supported in core package

Multiple linear algebra backends

We will now only support PETSc. In practice, this was the only linear algebra backend that was being used with FEniCS for non-trivial problems, and the only one with extensive testing. The simple Eigen interface does not work in parallel, and the Trilinos interface was not used or maintained. Reducing the number of optional dependencies increases the reliability and maintainability of FEniCS.