Gmsh in parallel

Hi all,
I tried to run my script in parallel, but obtained the following error:

[v-VirtualBox:08554] *** Process received signal ***
[v-VirtualBox:08554] Signal: Segmentation fault (11)
[v-VirtualBox:08554] Signal code: Invalid permissions (2)
[v-VirtualBox:08554] Failing at address: 0x5649760c190
[v-VirtualBox:08554] [ 0] /lib/x86_64-linux-gnu/[0x7ff23d3620]
[v-VirtualBox:08554] [ 1] [0x5497260c190]
[v-VirtualBox:08554] *** End of error message ***
[v-VirtualBox:08525] *** Process received signal ***
[v-VirtualBox:08525] Signal: Segmentation fault (11)
[v-VirtualBox:08525] Signal code: Address not mapped (1)
[v-VirtualBox:08525] Failing at address: 0x28
[v-VirtualBox:08525] [ 0] /lib/x86_64-linux-gnu/[0x7ffb9544890]
[v-VirtualBox:08525] [ 1] /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/[0x7ff4b069433]
[v-VirtualBox:08525] [ 2] /usr/lib/x86_64-linux-gnu/[0x7ffb97b6c31]
[v-VirtualBox:08525] [ 3] /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/[0x7ff4b069cd]
[v-VirtualBox:08525] [ 4] /lib/x86_64-linux-gnu/[0x7ff4b956db]
[v-VirtualBox:08525] [ 5] /lib/x86_64-linux-gnu/[0x7ff4b92288f]
[v-VirtualBox:08525] *** End of error message ***
Segmentation fault (core dumped)

I have tried running the demos in parallel and it works, so I expect the problem to lie within my script.

In the script, I run gmsh from the terminal via subprocess and then meshio. I have obtained similar “segmentation fault” errors previously (when still running in series) only when there was trouble with gmsh. So I think it might be connected to gmsh. Can gmsh be used in parallel? If not, how to do it instead? I am thinking of running the script in series, and within the script run only the actual solving in parallel. I am not sure how to implement that though, will be grateful for any advice or clarification on the issue.

Meshio does not use mpi4py, see Gmsh thread
My best suggestion is to generate the mesh in serial using Gmsh, and using meshio in serial to save it to the XDMF format, see Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio
As described in this thread, you can load your mesh and markers in FEniCS in parallel

Alright, many thanks!