0090ae85 |
1 | puts "=========" |
2 | puts "OCC25788" |
3 | puts "=========" |
4 | puts "" |
5 | ############################################### |
6 | # Parallelization of the BOP Builder algorithm on second level |
7 | ############################################### |
8 | |
9 | # box plate to cut the holes from |
10 | box b1 100 100 1 |
11 | |
12 | # N defines number of holes along each of X and Y, thus total N^2 holes |
13 | # will be drilled; note that the algorithm iself is likely to be quadratic |
14 | # for number of shapes, i.e. CPU |
15 | set N 40 |
16 | set holes {} |
17 | for {set i 1} {$i < $N} {incr i} { |
18 | for {set j 1} {$j < $N} {incr j} { |
19 | pcylinder p_${i}_$j 0.5 1 |
20 | ttranslate p_${i}_$j [expr $i * 100. / $N] [expr $j * 100. / $N] 0. |
21 | lappend holes p_${i}_$j |
22 | } |
23 | } |
24 | |
25 | eval compound $holes b2 |
26 | |
27 | bclearobjects |
28 | bcleartools |
29 | baddobjects b1 |
30 | baddtools b2 |
31 | |
32 | brunparallel 1 |
33 | |
34 | dchrono cpu reset |
35 | dchrono cpu start |
36 | bcut r b1 b2 |
37 | dchrono cpu stop |
38 | set chrono_info [dchrono cpu show] |
39 | |
40 | if { [regexp {Debug mode} [dversion]] } { |
41 | if { [regexp {Windows} [dversion]] } { |
42 | set max_time 200 |
43 | } else { |
44 | set max_time 200 |
45 | } |
46 | } else { |
47 | if { [regexp {Windows} [dversion]] } { |
48 | set max_time 50 |
49 | } else { |
50 | set max_time 50 |
51 | } |
52 | } |
53 | |
54 | regexp {CPU user time: ([-0-9.+eE]+) seconds} ${chrono_info} full z |
55 | puts "$z" |
56 | |
57 | if { $z > ${max_time} } { |
58 | puts "Elapsed time is more than ${max_time} seconds - Faulty" |
59 | } else { |
60 | puts "Elapsed time is less than ${max_time} seconds - OK" |
61 | } |