737.gmsh_r
Finite element mesh generation
Gmsh is led by Christophe Geuzaine <cgeuzaine[at]uliege [dot] be> and Jean François Remacle <jean-francois [dot] remacle[at]uclouvain [dot] be> with many contributors.
737.gmsh was submitted to the SPEC CPU v8 Benchmark Search Program by Christophe Geuzaine.
Gmsh is an open source 3D finite element mesh generator with a built-in CAD engine and post-processor. Its design goal is to provide a fast, light, and user-friendly meshing tool with parametric input and flexible visualization capabilities. Gmsh is built around four modules (geometry, mesh, solver, and post-processing), which can be controlled with a graphical user interface, from the command line, using text files written in Gmsh's own scripting language (.geo files). SPEC CPU specifically uses standalone .geo files, and only tests the meshing module as it is the most computationally intensive of the four modules.
Gmsh excels at the following meshing tasks which SPEC CPU exercises. Gmsh can quickly describe simple and/or "repetitive" geometries with the built-in scripting language, thanks to user-defined macros, loops, conditionals and includes; it can then parametrize these geometries. Gmsh's scripting language enables all commands and command arguments to depend on previous calculations. Gmsh can generate unstructured simplicial finite element meshes in 1D, 2D, and 3D (using line segments, triangles, and tetrahedra, respectively). There is fine-grained control over the element size which allows creation of simple extruded geometries and meshes, and allows automatica coupling of structured meshes with unstructured ones (using a layer of pyramids in 3D). Finally Gmsh has high-order mesh optimization tools allow to guarantee the validity of curved meshes; the benchmark employes this to ensure the meshing completed sufficiently.
See this general presentation for a high-level overview of Gmsh and refer to the reference manual for complete documentation, which includes the Gmsh tutorial. The latest documentation can be found online at gmsh.info/doc/texinfo/gmsh.html.
The command lines in the SPEC CPU benchmark consist of taking empty 3D polyhedra and surface meshes, and tesselating them using tetrahedrons to meet specified density criteria.
There are many command line parameters exposed by gmsh, which can be discovered using the -help flag. For this benchmark, the ones that matter are the following:
| option | description |
| clscale | Sets mesh element size and density factor. This can also be specified in the input script using Mesh.MeshSizeFactor. Scale is an argument used to set the density of the mesh, and how small the triangles or tetrahedra should be in the final product. A smaller value indicates a denser mesh will be produced. |
| algo | Select mesh algorithms. The first instance is the 2D algorithm, and the second instance is the 3D algorithm. These can also be specified in the input script using Mesh.Algorithm and Mesh.Algorithm3D. The algorithms used in this benchmark are Delauney, HXT, and Frontal. (The Adaptive algorithm is avoided for benchmarking since it is non-deterministic by nature, and so it may result in different amounts of work between systems.) |
| smooth | Sets number of mesh smoothing steps, if any. This can also be specified in the input script using Mesh.Smoothing. Mesh smoothing is the final step, which takes an existing mesh and iteratively deforms the positions (but not connectivity) of the vertices such that the coordinates better satisfy the numerical discretization of an elliptic partial differential equation, effectively spreading out jumps in the anisotropy across a finite area, reducing the extrema in mesh quality. |
| [geo file] | The final argument is the input file, the geometry script. It is written in the gmsh scripting language, describing the mesh to be created along with confiruation parameters. The directives can result in 2D or 3D meshes. |
Inside the .geo script, the final step is to check how many tetrahedrons were used for meshing, and whether or not that conforms to the specified request. This is an important verification step, as meshing is by nature a non-linear process, and very sensitive to floating point math, compiler optimizations, and hardware implementations. The check is to ensure the resulting mesh falls within a strict bound, even though it is not exactly matching the reference. This aligns with the user behavior and flow of 3D-meshing in general; since the resulting mesh model is used downstream in 3D workspaces and only needs to be sufficiently dense for CAD work, and not necessarily exact.
Outputs are .msh files which consist of a list of points in N-dimensional space. The .msh files themselves are not verified, but the counts of nodes, edges, and tetrahedrons are verified within a tight bound. The Average mesh quality (inverse conditioning number, ICN) is also checked after mesh generation. See the "final step" of the input description above, and some discussion about the motivation of that scheme at the public forum: gitlab issue 2242. The text output from Gmsh is then verified, indicating that the geo verification step did complete successfully.
The .msh files can be visualized dynamically with the interactive public gmsh viewer, available from the upstream code or public website. The SPEC CPU 2026 benchmark does not build the GUI/viewer. We offer here static visualizations of the refrate results, with the caveat that these are scaled down, portraying an intermediate step in the process to facilitate understanding of the process. The test and train sizes use even more scaled down versions of the spec.geo prism.
| Mesh input | Orthographic view | Perspective view #1 | Perspective view #2 |
| choi.geo | ![]() |
![]() |
![]() |
| mediterranean.geo | ![]() |
![]() |
![]() |
| projection.geo | ![]() |
![]() |
![]() |
| gasdis.geo | ![]() |
![]() |
![]() |
| Torus.geo | ![]() |
![]() |
![]() |
| spec.geo | ![]() |
![]() |
![]() |
| p19.geo | ![]() |
![]() |
![]() |
Optional timing output: As with all SPEC CPU benchmarks, timing is done by the SPEC CPU toolset, not by the benchmark. For the benefit of the interested researcher, an unsupported basic gettimeofday feature is available for internal timing. For details, see 737.gmsh_r/Docs/timing.
C++, C
The SPECrate version is single-threaded.
In order for the algorithm to converge, correct/precise floating point math is required. If incorrect/inprecise "fast" math is used, the algorithm may not complete and the program may livelock. Also see the file 737.gmsh_r/src/gmsh/numeric/robustPredicates.cpp which has a lot of comments explaining why IEEE strictness is required for functionality and algorithm convergence. More info available at www.cs.cmu.edu/~quake/robust.html.
Therefore, in order to comply with SPEC CPU rules that require consistency in base, you may need to set flags similar to these:
default=base: EXTRA_OPTIMIZE = -fno-fast-math 737.gmsh_r=peak: EXTRA_OPTIMIZE = -fno-fast-math
The above complies with the rules because it sets the de-optimization flag consistently for all of base. For peak, you are allowed to apply optimization flags to individual benchmarks as desired. Of course, the exact spelling of the flags that affect accuracy will vary from one compiler to another; the above is just an example for users of GCC.
The source code contains calls to rand(), the random number generator. The instances which are exercised have been converted to use spec_rand, the deterministic pseudo-random number generator. The remaining calls to rand() are not exercised by the benchmark.
The Gmsh upstream code increases the system stack size to 16 MB in gmsh/src/common/OS.cpp's CheckResources() function. The SPEC CPU source has this turned off ensure portability. As the comment in the source code states, running with too small a stack may cause crashes in the recursive calls (e.g. for tetrahedra classification in the 3D Delaunay algorithm). If you observe this behavior, just preset the stack size manually on your commandline using ulimit -s 32768 or similar.
Gmsh is publicly available for download at gmsh.info and the source is at gitlab.onelab.info/gmsh/gmsh. The SPEC CPU source was ported starting from commit 45aed686 sampled on June 23, 2024. Changes were made for portability, such as removal of self-timing, and removal of intrinsics.
737.gmsh_r source code is distributed under the GNU General Public License v2 as noted in its LICENSE.txt.
SPEC added a version of the Mersenne-Twister PRNG that is licensed by its authors (Makoto Matsumoto, Takuji Nishimura, and Mutsuo Saito) under a BSD license.
Sub-packages have varying licenses that are either GPLv2 or GPLv2 compatible (LGPL v2.1 and Mozilla Public License v2.0 being most common). Some sub-packages are GPL v2.0 but contain a specific exception allowing commercial use within Gmsh.
Info on specific modules can be found in CREDITS.txt, also summarized here:
Copyright © 2026 Standard Performance Evaluation Corporation (SPEC®)