32b6a53f |
1 | cpulimit 1500 |
408e0d5c |
2 | |
6a7ca558 |
3 | puts "========" |
4 | puts "CR24292" |
5 | puts "========" |
6 | puts "" |
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 | |
15 | restore [locate_data_file bug24292_x_256_stars.brep] b1 |
16 | |
17 | tcopy b1 b2 |
18 | trotate b2 0 0 0 0 0 1 10 |
19 | |
20 | tcopy b2 b3 |
21 | trotate b3 0 0 0 0 0 1 10 |
22 | |
23 | tcopy b3 b4 |
24 | trotate 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 | # |
31 | bclearobjects; bcleartools; |
32 | baddcompound b1 |
33 | baddcompound b2 |
34 | baddcompound b3 |
35 | baddcompound b4 |
36 | |
37 | bfillds |
38 | # |
39 | puts "Comparing perfomance of building many faces" |
40 | puts "in parallel and serial modes" |
41 | |
42 | # |
43 | # parallel |
44 | puts "Build faces in parallel mode:" |
45 | set info1 [bbuild rp -t] |
46 | regexp {Tps: +([-0-9.+eE]+)} ${info1} full Tps1 |
47 | puts "Tps1=${Tps1}" |
48 | |
49 | # |
50 | # serial |
51 | puts "Build faces in serial mode:" |
52 | set info2 [bbuild rs -s -t] |
53 | regexp {Tps: +([-0-9.+eE]+)} ${info2} full Tps2 |
54 | puts "Tps2=${Tps2}" |
55 | |
56 | set nb_v_good 23060 |
57 | set nb_e_good 35880 |
58 | set nb_w_good 11704 |
59 | set nb_f_good 11704 |
60 | set nb_sh_good 0 |
61 | set nb_sol_good 0 |
62 | set nb_compsol_good 0 |
63 | set nb_compound_good 1 |
64 | set nb_shape_good 82349 |
65 | |
66 | set dump1 [nbshapes rp] |
67 | regexp {VERTEX +: +([-0-9.+eE]+)} ${dump1} full nb_v1 |
68 | regexp {EDGE +: +([-0-9.+eE]+)} ${dump1} full nb_e1 |
69 | regexp {WIRE +: +([-0-9.+eE]+)} ${dump1} full nb_w1 |
70 | regexp {FACE +: +([-0-9.+eE]+)} ${dump1} full nb_f1 |
71 | regexp {SHELL +: +([-0-9.+eE]+)} ${dump1} full nb_sh1 |
72 | regexp {SOLID +: +([-0-9.+eE]+)} ${dump1} full nb_sol1 |
73 | regexp {COMPSOLID +: +([-0-9.+eE]+)} ${dump1} full nb_compsol1 |
74 | regexp {COMPOUND +: +([-0-9.+eE]+)} ${dump1} full nb_compound1 |
75 | regexp {SHAPE +: +([-0-9.+eE]+)} ${dump1} full nb_shape1 |
76 | |
77 | set dump2 [nbshapes rp] |
78 | regexp {VERTEX +: +([-0-9.+eE]+)} ${dump2} full nb_v2 |
79 | regexp {EDGE +: +([-0-9.+eE]+)} ${dump2} full nb_e2 |
80 | regexp {WIRE +: +([-0-9.+eE]+)} ${dump2} full nb_w2 |
81 | regexp {FACE +: +([-0-9.+eE]+)} ${dump2} full nb_f2 |
82 | regexp {SHELL +: +([-0-9.+eE]+)} ${dump2} full nb_sh2 |
83 | regexp {SOLID +: +([-0-9.+eE]+)} ${dump2} full nb_sol2 |
84 | regexp {COMPSOLID +: +([-0-9.+eE]+)} ${dump2} full nb_compsol2 |
85 | regexp {COMPOUND +: +([-0-9.+eE]+)} ${dump2} full nb_compound2 |
86 | regexp {SHAPE +: +([-0-9.+eE]+)} ${dump2} full nb_shape2 |
87 | |
88 | if { ${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 | |
100 | if { ${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 | |
112 | vinit |
113 | vdisplay rs |
114 | vfit |