0024398: Output of extrema draw-command has various format on optimise and debug...
[occt.git] / tests / perf / bop / buildfaces
CommitLineData
32b6a53f 1cpulimit 1500
408e0d5c 2
6a7ca558 3puts "========"
4puts "CR24292"
5puts "========"
6puts ""
7#######################################################################
8# Testing parallelization of BO
9#######################################################################
10
11# test comparing building faces in parallel and serial mode
12# HAVE_TBB must be set
13# It is better using MMGT_OPT=2 (tbb memory allocator)
14
15restore [locate_data_file bug24292_x_256_stars.brep] b1
16
17tcopy b1 b2
18trotate b2 0 0 0 0 0 1 10
19
20tcopy b2 b3
21trotate b3 0 0 0 0 0 1 10
22
23tcopy b3 b4
24trotate b4 0 0 0 0 0 1 10
25#
26# b1 - 256 arguments (faces)
27# b2 - 256 arguments (faces)
28# b3 - 256 arguments (faces)
29# b4 - 256 arguments (faces)
30#
31bclearobjects; bcleartools;
32baddcompound b1
33baddcompound b2
34baddcompound b3
35baddcompound b4
36
37bfillds
38#
39puts "Comparing perfomance of building many faces"
40puts "in parallel and serial modes"
41
42#
43# parallel
44puts "Build faces in parallel mode:"
45set info1 [bbuild rp -t]
46regexp {Tps: +([-0-9.+eE]+)} ${info1} full Tps1
47puts "Tps1=${Tps1}"
48
49#
50# serial
51puts "Build faces in serial mode:"
52set info2 [bbuild rs -s -t]
53regexp {Tps: +([-0-9.+eE]+)} ${info2} full Tps2
54puts "Tps2=${Tps2}"
55
56set nb_v_good 23060
57set nb_e_good 35880
58set nb_w_good 11704
59set nb_f_good 11704
60set nb_sh_good 0
61set nb_sol_good 0
62set nb_compsol_good 0
63set nb_compound_good 1
64set nb_shape_good 82349
65
66set dump1 [nbshapes rp]
67regexp {VERTEX +: +([-0-9.+eE]+)} ${dump1} full nb_v1
68regexp {EDGE +: +([-0-9.+eE]+)} ${dump1} full nb_e1
69regexp {WIRE +: +([-0-9.+eE]+)} ${dump1} full nb_w1
70regexp {FACE +: +([-0-9.+eE]+)} ${dump1} full nb_f1
71regexp {SHELL +: +([-0-9.+eE]+)} ${dump1} full nb_sh1
72regexp {SOLID +: +([-0-9.+eE]+)} ${dump1} full nb_sol1
73regexp {COMPSOLID +: +([-0-9.+eE]+)} ${dump1} full nb_compsol1
74regexp {COMPOUND +: +([-0-9.+eE]+)} ${dump1} full nb_compound1
75regexp {SHAPE +: +([-0-9.+eE]+)} ${dump1} full nb_shape1
76
77set dump2 [nbshapes rp]
78regexp {VERTEX +: +([-0-9.+eE]+)} ${dump2} full nb_v2
79regexp {EDGE +: +([-0-9.+eE]+)} ${dump2} full nb_e2
80regexp {WIRE +: +([-0-9.+eE]+)} ${dump2} full nb_w2
81regexp {FACE +: +([-0-9.+eE]+)} ${dump2} full nb_f2
82regexp {SHELL +: +([-0-9.+eE]+)} ${dump2} full nb_sh2
83regexp {SOLID +: +([-0-9.+eE]+)} ${dump2} full nb_sol2
84regexp {COMPSOLID +: +([-0-9.+eE]+)} ${dump2} full nb_compsol2
85regexp {COMPOUND +: +([-0-9.+eE]+)} ${dump2} full nb_compound2
86regexp {SHAPE +: +([-0-9.+eE]+)} ${dump2} full nb_shape2
87
88if { ${nb_v_good} != ${nb_v1}
89 || ${nb_e_good} != ${nb_e1}
90 || ${nb_w_good} != ${nb_w1}
91 || ${nb_f_good} != ${nb_f1}
92 || ${nb_sh_good} != ${nb_sh1}
93 || ${nb_sol_good} != ${nb_sol1}
94 || ${nb_compsol_good} != ${nb_compsol1}
95 || ${nb_compound_good} != ${nb_compound1}
96 || ${nb_shape_good} != ${nb_shape1} } {
97 puts "Error : Number of shapes is faulty"
98}
99
100if { ${nb_v2} != ${nb_v1}
101 || ${nb_e2} != ${nb_e1}
102 || ${nb_w2} != ${nb_w1}
103 || ${nb_f2} != ${nb_f1}
104 || ${nb_sh2} != ${nb_sh1}
105 || ${nb_sol2} != ${nb_sol1}
106 || ${nb_compsol2} != ${nb_compsol1}
107 || ${nb_compound2} != ${nb_compound1}
108 || ${nb_shape2} != ${nb_shape1} } {
109 puts "Error : Number of shapes is bad"
110}
111
112vinit
113vdisplay rs
114vfit