[Gmsh] Optimising binary .msh format
cgeuzaine at ulg.ac.be
Thu May 7 23:00:15 CEST 2015
> On 07 May 2015, at 13:02, Michael Lange <michael.lange at imperial.ac.uk> wrote:
> I am trying to optimise the performance of the current file reader for binary .msh files in PETSc by utilising the element grouping described in the binary format (see http://www.geuz.org/gmsh/doc/texinfo/#MSH-binary-file-format). However, using a recent version of Gmsh (version 2.9.3, with options: -3 -bin), the generated .msh files contain a header + binary entry pair for each element in the mesh, instead of two groups of same-type elements (volume and surface). This unfortunately prevents me from using efficient bulk reads to speed up file I/O and hinders performance when reading large meshes on certain HPC architectures.
> Is there any way to enable this type of element grouping in the binary mesh file generation? Am I missing an option by any chance, or does this require significant code changes?
Hi Michael - Indeed, the .msh format is designed for better performance by dumping groups of elements, but the current implementation in Gmsh outputs elements one at a time. Have you tried the .med (HDF5-based) format? The current implementation is pretty fast:
> time gmsh 6millionTets_binary.msh -
Info : Running 'gmsh 6millionTets_binary.msh -' [Gmsh 2.9.4, 1 node, max. 1 thread]
Info : Started on Thu May 7 22:58:24 2015
Info : Reading '6millionTets_binary.msh'...
Info : Mesh is in binary format
Info : 1030301 vertices
Info : Vertex numbering is dense
Info : 6121200 elements
Info : Done reading '6millionTets_binary.msh'
Info : Stopped on Thu May 7 22:58:29 2015
> time gmsh 6millionTets_binary.med -
Info : Running 'gmsh 6millionTets_binary.med -' [Gmsh 2.9.4, 1 node, max. 1 thread]
Info : Started on Thu May 7 22:58:33 2015
Info : Reading '6millionTets_binary.med'...
Info : Reading MED file V3.0.6 using MED library V3.0.6
Info : Reading 3-D unstructured mesh <<6millionTets_binary>>
Info : Done reading '6millionTets_binary.med'
Info : Stopped on Thu May 7 22:58:37 2015
> Michael Lange
> gmsh mailing list
> gmsh at geuz.org
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
More information about the gmsh