-
Notifications
You must be signed in to change notification settings - Fork 98
/
run_tree.ps1
84 lines (70 loc) · 1.52 KB
/
run_tree.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
$HCPU = "x86_64"
$HABI = "WIN64"
$HOS = "Windows"
$dir = Get-Location
. "$dir\funcs.ps1"
$use_em = $FALSE;
$ncpu = 64;
$bcpu = 0;
$showhelp = $FALSE;
$front = $FALSE;
for ($count = 0 ; $count -lt $args.count ; $count ++ ){
$marg = $args[$count]
if ( $marg -eq '-e'){
$use_em = $TRUE;
}
elseif ( $marg -eq '-n'){
$ncpu = $args[$count+1];
$count ++;
}
elseif ( $marg -eq '-b'){
$bcpu = $args[$count+1];
$count ++;
}
elseif ( $marg -eq '-f'){
$front = $TRUE;
}
else {
$showhelp = $TRUE;
}
}
if ( $use_em -eq $TRUE ){
$HCPU = "vp64";
$HABI = "VP64";
$HOS = "Windows";
}
if ( $bcpu -eq 0 ){
. "$dir\stop.ps1"
}
if ( $ncpu -gt 64){
$ncpu = 64;
}
if ( $showhelp -eq $TRUE ){
Write-Output "[-n cnt] number of nodes";
Write-Output "[-b base] base offset";
Write-Output "[-e] emulator mode";
Write-Output "[-h] help";
}
else {
$num_cpu = $ncpu;
for ($cpu=$num_cpu-1; $cpu -ge 0; $cpu--){
$links=""
$lcpu=$((($cpu-1) / 2))
$c1 = $cpu
$c2 = $lcpu
$links += add_link $c1 $c2 $links
$lcpu=$((($cpu*2)+1))
if ( $lcpu -lt $num_cpu ){
$c1 = $cpu
$c2 = $lcpu
$links += add_link $c1 $c2 $links
}
$lcpu=$((($cpu*2)+2))
if ( $lcpu -lt $num_cpu ){
$c1 = $cpu
$c2 = $lcpu
$links += add_link $c1 $c2 $links
}
boot_cpu_gui $front $cpu "$links"
}
}