This is related my previous question: https://fenicsproject.org/qa/12201/embarassingly-parallel-fenics, however, may provide more insight as to what my problem is specifically. I'm trying to solve the same PDE with different parameter values in parallel. Each processor is given a different input parameter a, solves the PDE, and returns the solution u(a).
I've created the mesh:
auto mesh = make_shared<dfn::UnitSquareMesh>(MPI_COMM_SELF, 32, 32);
space = make_shared<Model::FunctionSpace>(mesh);
which, works fine. Then I create the form
Model::LinearForm F(space);
F.u = u; F.f = f;
Model::JacobianForm J(space, space)
J.u = u;
dfn::Parameters params("nonlinear_variational_solver");
dfn::Parameters newton_params("newton_solver");
newton_params.add("relative_tolerance", tol);
newton_params.add("absolute_tolerance", tol);
dolfin::solve(F==0, *u, boundary_conditions, J, params);
This work fine if I run it with
mpirun -n 1 ./model
but if I use
mpirun -n 2 ./model
I get the error:
*** -------------------------------------------------------------------------
*** Error: Unable to creating EigenVector.
*** Reason: EigenVector does not support parallel communicators.
*** Where: This error was encountered inside EigenVector.cpp.
*** Process: 0
***
*** DOLFIN version: 2017.1.0.dev0
*** Git changeset: f8389e7178fcf6f74e392f084089da533cbc1501
*** -------------------------------------------------------------------------