Bug reporting - gmsh runs indefinitely, never completes
For me gmsh doesn't work in FreeCAD CfdOF workbench. All the other meshers work fine, but as everyone knows you want to try all the meshers you can!
What happens is that gmsh just runs and runs and runs. My longest attempt so far is 9 hours for a model the other meshers finish in ~10 minutes.
I dug into things a bit, and found that gmsh was being run with the arguments "-nt 24 -", as in [code]gmsh.exe -nt 24 - gmsh/mymesh_solid001_Geometry.geo[/code]
What I found was that the -nt ("number of threads") argument causes gmsh to spin indefinitely, if it is more than 1. I could get it to run just fine on the command line by removing the various arguments, and gmsh completed in ~30 seconds.
I was then able to get it working in the CfdOF workbench by clicking in on the mesh operation in the Model tree, selecting the data tab, and setting the "Number of Threads" to 1 (instead of the default of 0, which automatically tries to use all the threads, 24 in my case).
I could then write the mesh case, run the mesher, and get a very nice looking mesh!
I don't know if this is an issue with a particular version of gmsh, or with Windows, but I see threads in various forums complaining about gmsh being slow dating back to ~2016 where I suspect people have been running into this issue.
Version info:
OS: Windows 11 build 22631 Architecture: x86_64 Version: 1.0.0.39109 (Git) Conda Build type: Release Branch: (HEAD detached at 1.0.0) Hash: 2fcc5317fe3aee96ca73475986a577719fc78e20 Python 3.11.10, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1 Locale: English/United States (en_US) Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion Installed mods:
- CfdOF 1.30.3
CfdOF dependency check: Checking dependencies... FreeCAD version: 1.0 System: Windows Runtime: MinGW OpenFOAM directory: C:\Program Files\ESI-OpenCFD\OpenFOAM\v2212 OpenFOAM version: 2212 cfMesh-CfdOF version: 1.26 HiSA version: 1.11.3 Paraview executable: C:\Program Files\ParaView 5.10.1-Windows-Python3.9-msvc2017-AMD64\bin\paraview.exe gmsh executable: C:\Program Files\FreeCAD 1.0\bin\gmsh.exe gmsh version: 4.13.1 Completed CFD dependency check
This seems to be a bug in gmsh 4.13.1 when running multithreaded on Windows. Please see: https://forum.freecad.org/viewtopic.php?t=87474&start=20#p812814
There's not much we can do but wait for the next release, and run single-threaded in the mean time.
Understood. I guess the only thing CfdOF could do would be to default to 1 thread on Windows, out of an abundance of caution. But if it's all going to be fixed in the next release anyway, maybe that's not worth the hassle.
Understood. I guess the only thing CfdOF could do would be to default to 1 thread on Windows, out of an abundance of caution. But if it's all going to be fixed in the next release anyway, maybe that's not worth the hassle.
True. I've done as you suggest since I'm not sure how long it will be before another gmsh release comes along.