Non-deterministic results with -cpu
I just posted this to the mailing list, but it is probably better to open an issue here.
Using attached geo and brep with Gmsh stable 4.2.2 linux-64 binary:
$ gmsh -3 -cpu cube.geo -o mesh1.msh
$ gmsh -3 -cpu cube.geo -o mesh2.msh
$ gmsh -3 -cpu cube.geo -o mesh3.msh
$ md5sum *.msh
b1a18fc0cc03dbe43931e3e85eb965b4 mesh1.msh
e5f09c1db71a5951ed2851182950c6e0 mesh2.msh
9163ccafa5ec693a0d888ff624bbf733 mesh3.msh
Without the -cpu
flag, the three resulting files are exactly the same, which is what I need.
My guess was that Common/OS.cpp:362
was introducing multithreading randomness even though the -info
says that the binary does not have OpenMP enabled.
But when I compile the source explicitly setting -DENABLE_OPENMP=0
I get back the deterministic behavior even with -cpu
, so there is something going on.