I'm having trouble creating a mesh in parallel. I am creating a mesh using
// make the mesh
mesh = make_shared<dfn::UnitSquareMesh>(MPI_COMM_WORLD, 20, 20);
Running the code with 2 processors, I get the error message
*** -------------------------------------------------------------------------
*** Error: Unable to create mesh entity.
*** Reason: Mesh entity index 0 out of range [0, 0] for entity of dimension 1.
*** Where: This error was encountered inside MeshEntity.cpp.
*** Process: 0
***
*** DOLFIN version: 2017.1.0.dev0
*** Git changeset: 4b0cda02df108e11a3384f6ae3affa73bd29944d
*** -------------------------------------------------------------------------
It is perhaps worth mentioning that a similar error message does not appear for process 1. If I run the code it serial (or replacing MPI_COMM_WORLD with MPI_COMM_SELF) it works fine.
Does anyone know what I could be doing wrong? or what could be causing this?