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/libc.so.6(+0x3ef20)[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/libpthread.so.0(+0x12890)[0x7ffb9544890]
[v-VirtualBox:08525] [ 1] /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so(+0x31433)[0x7ff4b069433]
[v-VirtualBox:08525] [ 2] /usr/lib/x86_64-linux-gnu/libopen-pal.so.20(opal_libevent2022_event_base_loop+0x7f1)[0x7ffb97b6c31]
[v-VirtualBox:08525] [ 3] /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi/mca_pmix_pmix112.so(+0x2efcd)[0x7ff4b069cd]
[v-VirtualBox:08525] [ 4] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7ff4b956db]
[v-VirtualBox:08525] [ 5] /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[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.

Hi,
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!