FEniCS/dolfinx

[BUG]: dolfinx.io.gmshio.read_from_msh went wrong while using MPI

Closed this issue · 2 comments

Summarize the issue

I have a .msh file and want to use it in a fenicsx project as

from mpi4py import MPI
import dolfinx.fem as fem
from dolfinx.io import gmshio
mesh, _, _ = gmshio.read_from_msh("mesh/IAEA2d.msh", MPI.COMM_WORLD, gdim=2)
V = fem.functionspace(mesh,("Lagrange", 1))

the mesh file is built by freefem++, using movemesh23 to tranfer 2D mesh to 3D surface mesh.
the running environment is built in docker.
here is the error log:
Info : Reading 'mesh/IAEA2d.msh'...
Info : 32818 nodes
Info : 66334 elements
Info : Done reading 'mesh/IAEA2d.msh'
Invalid rank, error stack:
internal_Issend(60788): MPI_Issend(buf=0x55e7cf6fdd91, count=1, MPI_BYTE, 1, 1, comm=0x84000005, request=0x55e7cf6fad54) failed
internal_Issend(60749): Invalid rank has value 1 but must be nonnegative and less than 1
Abort(205128454) on node 0 (rank 0 in comm 416): application called MPI_Abort(comm=0x84000005, 205128454) - process 0

when I change number of rank such as "mpirun -np 4 **", still go wrong and the numbers in 2nd line become the same number as 4.

How to reproduce the bug

run the code I provide.

Minimal Example (Python)

from mpi4py import MPI
import dolfinx.fem as fem
from dolfinx.io import gmshio
mesh, _, _ = gmshio.read_from_msh("mesh/IAEA2d.msh", MPI.COMM_WORLD, gdim=3)

Output (Python)

Info    : Reading 'mesh/IAEA2d.msh'...
Info    : 32818 nodes
Info    : 66334 elements
Info    : Done reading 'mesh/IAEA2d.msh'
Invalid rank, error stack:
internal_Issend(60788): MPI_Issend(buf=0x55e7cf6fdd91, count=1, MPI_BYTE, 1, 1, comm=0x84000005, request=0x55e7cf6fad54) failed
internal_Issend(60749): Invalid rank has value 1 but must be nonnegative and less than 1
Abort(205128454) on node 0 (rank 0 in comm 416): application called MPI_Abort(comm=0x84000005, 205128454) - process 0

Version

main branch

DOLFINx git commit

No response

Installation

use docker based on ubuntu latest, then install fenicsx througe conda and the installing command is the one provided in fenicsx website

Additional information

No response

You would have to supply the mesh for anyone to be able to reproduce the issue.

If I were to guess, the msh format that FreeFEM++ uses is not the same as gmsh one, compare https://doc.freefem.org/documentation/developers.html#meshfiledatastructure to https://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format

Feel free to prove me wrong by uploading the file, but in the meantime I'll close the issue.