[Gmsh] Non-deterministic results with -cpu

Jeremy Theler jeremy at seamplex.com
Wed Mar 27 12:53:35 CET 2019


Dear developers,

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.

I can measure the cpu time with Bash's time or /usr/bin/time and get
rid of -cpu, but wanted to know what is it that is going on.
Any idea?

Regards
--
jeremy theler
www.seamplex.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190327/464bb606/attachment.html>
-------------- next part --------------
SetFactory("OpenCASCADE");
a() = ShapeFromFile("cube.brep");
-------------- next part --------------
DBRep_DrawableShape

CASCADE Topology V1, (c) Matra-Datavision
Locations 1
1
              1               0               0               0 
              0               1               0               0 
              0               0               1               0 
Curve2ds 24
1 0 0 1 0 
1 0 0 1 0 
1 10 0 0 -1 
1 0 0 0 1 
1 0 -10 1 0 
1 0 0 1 0 
1 0 0 0 -1 
1 0 0 0 1 
1 0 0 1 0 
1 0 10 1 0 
1 10 0 0 -1 
1 10 0 0 1 
1 0 -10 1 0 
1 0 10 1 0 
1 0 0 0 -1 
1 10 0 0 1 
1 0 0 0 1 
1 0 0 1 0 
1 10 0 0 1 
1 0 0 1 0 
1 0 0 0 1 
1 0 10 1 0 
1 10 0 0 1 
1 0 10 1 0 
Curves 12
1 0 0 0 0 0 1 
1 0 0 10 -0 1 0 
1 0 10 0 0 0 1 
1 0 0 0 -0 1 0 
1 10 0 0 0 0 1 
1 10 0 10 0 1 0 
1 10 10 0 0 0 1 
1 10 0 0 -0 1 0 
1 0 0 0 1 0 -0 
1 0 0 10 1 0 -0 
1 0 10 0 1 0 -0 
1 0 10 10 1 0 -0 
Polygon3D 0
PolygonOnTriangulations 24
2 1 2 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
2 1 2 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 1 2 
p 0.0200000002980232 1 0 10 
2 1 2 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 1 2 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 1 4 
p 0.0200000002980232 1 0 10 
2 1 2 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
2 4 3 
p 0.0200000002980232 1 0 10 
2 2 3 
p 0.0200000002980232 1 0 10 
Surfaces 6
1 0 0 0 1 0 -0 0 0 1 0 -1 0 
1 0 0 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 10 0 0 1 1 0 -0 -0 1 0 
1 0 10 0 -0 1 0 0 0 1 1 0 -0 
1 0 0 0 0 0 1 1 0 -0 -0 1 0 
1 10 0 0 1 0 -0 0 0 1 0 -1 0 
Triangulations 6
4 2 1 0
0 0 0 0 0 10 0 10 10 0 10 0 0 0 10 0 10 -10 0 -10 2 4 3 2 1 4 
4 2 1 0
0 0 0 10 0 0 10 0 10 0 0 10 0 0 0 10 10 10 10 0 3 2 1 3 1 4 
4 2 1 0
0 0 10 0 10 10 10 10 10 10 0 10 0 0 0 10 10 10 10 0 3 2 1 3 1 4 
4 2 1 0
0 10 0 10 10 0 10 10 10 0 10 10 0 0 0 10 10 10 10 0 3 2 1 3 1 4 
4 2 1 0
0 0 0 0 10 0 10 10 0 10 0 0 0 0 0 10 10 10 10 0 3 2 1 3 1 4 
4 2 1 0
10 0 0 10 0 10 10 10 10 10 10 0 0 0 10 0 10 -10 0 -10 2 4 3 2 1 4 

TShapes 35
Ve
1e-07
0 0 10
0 0

0101101
*
Ve
1e-07
0 0 0
0 0

0101101
*
Ed
 1e-07 1 1 0
1  1 0 0 10
2  1 1 0 0 10
2  2 2 0 0 10
6  1 1 0
6  2 2 0
0

0101000
-35 0 +34 0 *
Ve
1e-07
0 10 10
0 0

0101101
*
Ed
 1e-07 1 1 0
1  2 0 0 10
2  3 1 0 0 10
2  4 3 0 0 10
6  3 1 0
6  4 3 0
0

0101000
-32 0 +35 0 *
Ve
1e-07
0 10 0
0 0

0101101
*
Ed
 1e-07 1 1 0
1  3 0 0 10
2  5 1 0 0 10
2  6 4 0 0 10
6  5 1 0
6  6 4 0
0

0101000
-32 0 +30 0 *
Ed
 1e-07 1 1 0
1  4 0 0 10
2  7 1 0 0 10
2  8 5 0 0 10
6  7 1 0
6  8 5 0
0

0101000
-30 0 +34 0 *
Wi

0101000
-33 0 -31 0 +29 0 +28 0 *
Fa
0  1e-07 1 0
2  1
0101000
+27 0 *
Ve
1e-07
10 0 10
0 0

0101101
*
Ve
1e-07
10 0 0
0 0

0101101
*
Ed
 1e-07 1 1 0
1  5 0 0 10
2  9 6 0 0 10
2  10 2 0 0 10
6  9 6 0
6  10 2 0
0

0101000
-25 0 +24 0 *
Ve
1e-07
10 10 10
0 0

0101101
*
Ed
 1e-07 1 1 0
1  6 0 0 10
2  11 6 0 0 10
2  12 3 0 0 10
6  11 6 0
6  12 3 0
0

0101000
-22 0 +25 0 *
Ve
1e-07
10 10 0
0 0

0101101
*
Ed
 1e-07 1 1 0
1  7 0 0 10
2  13 6 0 0 10
2  14 4 0 0 10
6  13 6 0
6  14 4 0
0

0101000
-22 0 +20 0 *
Ed
 1e-07 1 1 0
1  8 0 0 10
2  15 6 0 0 10
2  16 5 0 0 10
6  15 6 0
6  16 5 0
0

0101000
-20 0 +24 0 *
Wi

0101000
-23 0 -21 0 +19 0 +18 0 *
Fa
0  1e-07 6 0
2  6
0101000
+17 0 *
Ed
 1e-07 1 1 0
1  9 0 0 10
2  17 2 0 0 10
2  18 5 0 0 10
6  17 2 0
6  18 5 0
0

0101000
-24 0 +34 0 *
Ed
 1e-07 1 1 0
1  10 0 0 10
2  19 2 0 0 10
2  20 3 0 0 10
6  19 2 0
6  20 3 0
0

0101000
-25 0 +35 0 *
Wi

0101000
-15 0 -23 0 +14 0 +33 0 *
Fa
0  1e-07 2 0
2  2
0101000
+13 0 *
Ed
 1e-07 1 1 0
1  11 0 0 10
2  21 4 0 0 10
2  22 5 0 0 10
6  21 4 0
6  22 5 0
0

0101000
-20 0 +30 0 *
Ed
 1e-07 1 1 0
1  12 0 0 10
2  23 4 0 0 10
2  24 3 0 0 10
6  23 4 0
6  24 3 0
0

0101000
-22 0 +32 0 *
Wi

0101000
-11 0 -19 0 +10 0 +29 0 *
Fa
0  1e-07 4 0
2  4
0101000
+9 0 *
Wi

0101000
-28 0 -11 0 +18 0 +15 0 *
Fa
0  1e-07 5 0
2  5
0101000
+7 0 *
Wi

0101000
-31 0 -10 0 +21 0 +14 0 *
Fa
0  1e-07 3 0
2  3
0101000
+5 0 *
Sh

0101100
-26 0 +16 0 -12 0 +8 0 -6 0 +4 0 *
So

0100000
+3 0 *
Co

1100000
+2 1 *

+1 0 


More information about the gmsh mailing list