# Two issues with large meshes

**URL:** <https://fenicsproject.discourse.group/t/two-issues-with-large-meshes/19877>\
**Category:** General\
**Tags:** mesh\
**Created:** [December 2, 2026, 5:18am UTC](https://fenicsproject.discourse.group/t/two-issues-with-large-meshes/19877 "2026-12-02T05:18:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vilander\_naoroibam](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/vilander_naoroibam/32/9001_2.png) [@vilander\_naoroibam](https://fenicsproject.discourse.group/u/vilander_naoroibam)\
**Post date:** [December 2, 2026, 5:18am UTC](https://fenicsproject.discourse.group/t/two-issues-with-large-meshes/19877/1 "2026-12-02T05:18:10Z")

</div>

I am trying to run a test with large meshes on a cluster using apptainer. I have generated a .sif file from the docker image provided by dolfinx/dolfinx. I faced two issues while doing so. I would like to present them here -

1. The first case is with a 21M DoF mesh. The code runs fine till about 768 cores (768 MPI tasks). Beyond that the code hangs while the mesh is being read/distributed (unable to exactly ascertain) over the MPI tasks.
2. The second case is with a 40M DoF mesh. With the above limit in mind the first attempt was made on 768 cores. The following error was returned -

```auto
Traceback (most recent call last):

  File "<path>", line 696, in <module>

    msh, cell_tags, facet_tags, *_ = gmshio.read_from_msh("mesh/mesh4.msh" , MPI.COMM_WORLD, 0, gdim=nDim)

                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/io/gmsh.py", line 508, in read_from_msh

    msh = model_to_mesh(gmsh.model, comm, rank, gdim=gdim, partitioner=partitioner)

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/io/gmsh.py", line 422, in model_to_mesh

    mesh = create_mesh(

           ^^^^^^^^^^^^

  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/mesh.py", line 775, in create_mesh

    msh: _cpp.mesh.Mesh_float32 | _cpp.mesh.Mesh_float64 = _cpp.mesh.create_mesh(

                                                           ^^^^^^^^^^^^^^^^^^^^^^

ValueError: vector::reserve

```

I would deeply appreciate any clarification on this matter.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [December 2, 2026, 11:18am UTC](https://fenicsproject.discourse.group/t/two-issues-with-large-meshes/19877/2 "2026-12-02T11:18:19Z")

</div>

Could you try to convert the mesh to XDMF and read it from that format? Reading large meshes from msh is not adviced, as GMSH doesn’t have a very good way of interacting with MPI?  
e.g. first convert the mesh (once for instance in serial) by reading it in and writing it and its tags to xdmf. Then for all future uses use XDMF to read it in.
