speedup.prl
2.61 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/local/bin/perl5 -w
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
#
#
# Determine speedup info by comparing the summary output
# of the runs with varying number of CPUs.
#
# ASPLOS/SUIF paper
require "getopts.pl";
&Getopts('i:n:');
if( defined($opt_i) ) {
$inputFile = $opt_i;
} else {
$inputFile = "prlvars.prl";
}
if (defined($opt_n)) {
$name = $opt_n;
} else {
die "speedup.prl requires the name of the wload! (-n) \n";
}
if (defined($ENV{'SIMOS_DIR'}) ) {
$xx = "$ENV{'SIMOS_DIR'}/src/apps/scripts";
print STDERR "Added $xx to perl search path. \$SIMOS_DIR defines it \n";
unshift(@INC,$xx);
} else {
print STDERR "SIMOS_DIR is not an environment variable \n";
}
require "simos-lib.prl";
$group{1} = '01';
$group{2} = '02';
$group{4} = '04';
$group{8} = '08';
$group{16} = '16';
do $inputFile;
sub PrintCmp {
my $f = shift;
my $mode = shift;
my $n = "$name-01-$mode";
my $base = $data{$n}{$f};
if( !defined($base)) {
print STDERR "NotDef \$data{$n}{$f} \n";
}
if (defined($format{$f})) {
$x = sprintf($format{$f},$base);
} else {
$x = $base;
}
if ($base > 0 ) {
printf("%-20s : %10s ( 1) |","$mode-$f",$x);
} else {
printf("%-20s : %10s |","$mode-$f",$x);
}
for $i (2,4,8,16) {
$val = $data{"$name-$group{$i}-$mode"}{$f};
if (defined($format{$f})) {
$x = sprintf($format{$f},$val);
} else {
$x = $val;
}
if( $base==0 && $val > 0 ) {
$base = $val;
}
if( $base == 0 || $val > 100 * $base ) {
printf("%10s |", $x);
} else {
printf("%10s (%5.2f)|", $x,1.0*$val/$base);
}
}
print "\n";
}
print "\nSPEEDUP INFORMATION SUMMARY FOR $name \n\n\n";
print " 1 CPU | 2 CPUs | 4 CPUs | 8 CPUs | 16 CPUs |\n";
print " ---------------------------------------------------------------------------------------------------------------- \n";
for $mode ('total','user','userspin') {
PrintCmp("seconds",$mode);
}
PrintCmp("_instr",'user');
print "--------------------------------- \n";
PrintCmp("dL2Miss",'total');
PrintCmp("dL2Miss",'userspin');
PrintCmp("missclass-cold",'user');
PrintCmp("missclass-repl",'user');
PrintCmp("missclass-true",'user');
PrintCmp("missclass-false",'user');
PrintCmp("missclass-other",'user');