I'm having trouble getting fenic's nonlinear solver working using one process when running in parallel. Using the nonlinear_poisson example I have changed
auto mesh = std::make_shared<dolfin::UnitSquareMesh>(16, 16);
to
auto mesh = std::make_shared<dolfin::UnitSquareMesh>(MPI_COMM_WORLD, 16, 16);
and it works exactly the same (but in parallel). However, when I change the code to
auto mesh = std::make_shared<dolfin::UnitSquareMesh>(MPI_COMM_SELF, 16, 16);
I get the error
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to successfully call PETSc function 'MatXIJSetPreallocation'.
*** Reason: PETSc error code is: 60 (Nonconforming object sizes).
*** Where: This error was encountered inside /Users/andrewdavis/software/fenics/dolfin/dolfin/la/PETScMatrix.cpp.
*** Process: 1
***
*** DOLFIN version: 2017.1.0.dev0
*** Git changeset: f8389e7178fcf6f74e392f084089da533cbc1501
*** -------------------------------------------------------------------------
Does anyone know how to fix this?