sum 4.7 KB
Newer Older
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
#!/usr/bin/env perl

use warnings;
use strict;

my %C = (
    e2 => [
	"formulae",
	"unique states visited",
	"SCC in search stack",
	"max. depth",
	"removed components",
	"states",
	"transitions",
	"vmsize",
	"real",
	"user",
	"sys",
	".mark size",
	".event size",
	"mem total",
    ],
    e4 => [
	"formulae",
	"unique states visited",
	"SCC in search stack",
	"contained map size",
	"find_state count",
29
	"inclusion count",
30
	"max. depth",
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
	"removed components",
	"states",
	"transitions",
	"vmsize",
	"real",
	"user",
	"sys",
	".mark size",
	".event size",
	"mem total",
    ],
    e45 => [
	"formulae",
	"unique states visited",
	"SCC in search stack",
	"contained map size",
	"inclusion count heap",
	"inclusion count stack",
	"max. depth",
	"removed components",
	"states",
	"transitions",
	"vmsize",
	"real",
	"user",
	"sys",
	".mark size",
	".event size",
	"mem total",
    ],
    e5 => [
	"formulae",
	"unique states visited",
	"SCC in search stack",
	"contained map size",
	"inclusion count heap",
	"inclusion count stack",
	"max. depth",
	"removed components",
	"states",
	"transitions",
	"vmsize",
	"real",
	"user",
	"sys",
	".mark size",
	".event size",
	"mem total",
    ],
    e6 => [
	"formulae",
	"unique states visited",
	"SCC in search stack",
	"contained map size",
	"inclusion count heap",
	"inclusion count stack",
	"max. depth",
	"removed components",
	"states",
	"transitions",
	"vmsize",
	"real",
	"user",
	"sys",
	".mark size",
	".event size",
	"mem total",
    ],
    );

101
$C{e2a} = $C{e2};
102
103
104
105
106
107
$C{e45} = $C{e5};
$C{e54} = $C{e5};
$C{e5L} = $C{e5};
$C{e5n} = $C{e5};
$C{e45n} = $C{e5};

108
109
110
111
112
113
114
my %filter = (states => 1, transitions => 1, user => 1);
my %order = (e2 => 2, e6 => 3, e5 => 4, e4 => 5);


my %H;
my %S;
my %P;
115
116
117
my %Canon;
my %Canons;

118
119
my $lines = 0;

120
121
122
123
if (0 == @ARGV)
{
    @ARGV = glob "results/*.log";
}
124
125
126

while (<>)
{
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    my @l = ();

    chomp;
    push @l, $_;
    while (! eof)
    {
	$_ = <>;
	chomp;
	if (length > 0 && !/^Command exited with non-zero status/)
	{
	    s/[^0-9.]//g if $. > 1;
	    s/^[.]//;
	    push @l, $_;
	}
    }
    close ARGV; # reset line numbering
143
144
145
146
147
148

    push @l, ($l[-1] + $l[-2] + $l[-6] * 4096)/1024;

    my $e = shift @l;
    $e =~ s/non empty/non e./;

149
    $ARGV =~ /([\w.]+)\.(e.*)-f-\d+\.log$/;
150
    my $name = $1;
151
152
153
154
    (my $meth = $2) =~ s/-//g;
    my $namea = "$name-$meth";

    $meth = $meth.'a' if $name =~ /asym/;
155
156
157

    $P{$name}{$e}{$meth} = 1;

158
159
160
161
162
163
164
    my $namec = $name;
    $namec =~ s/asym/sym/;
    $namec =~ s/\.rg//;
    $Canon{$meth}{$namec} = $namea;
    $Canons{$namec} = 1;

    if (!exists $H{$meth}{$namec}{$e})
165
    {
166
	$H{$meth}{$namec}{$e} = [1, @l];
167
168
169
170
	$S{$meth} = 1 + @l;
    }
    else
    {
171
	$H{$meth}{$namec}{$e}->[0]++;
172
173
	for (my $i = 0; $i < @l; ++$i)
	{
174
	    $H{$meth}{$namec}{$e}->[$i + 1] += $l[$i];
175
176
	}
    }
177

178
179
180
181
182
183
184
}

sub model_sort ($$)
{
    my ($a, $b) = @_;
    $a =~ s/\.rg//;
    $a =~ s/.*(\d)$/$1$&/;
185
    $a =~ s/asym/sym/;
186
187
    $b =~ s/\.rg//;
    $b =~ s/.*(\d)$/$1$&/;
188
    $b =~ s/asym/sym/;
189
190
191
192
193
194
195
196
197
198
199
200
201
202
    return $a cmp $b;
};

if (exists $ENV{FORTETABLE})
{
    foreach my $e ("non e.", "empty")
    {
	foreach my $model (sort model_sort keys %P)
	{
	    if (exists $P{$model}{$e})
	    {
		foreach my $meth (sort { $order{$a} <=> $order{$b} }
				  keys %{$P{$model}{$e}})
		{
203
		    my $n = "$model.$meth";
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
		    next unless exists $H{$meth}{$n}{$e};
		    my @l = @{$H{$meth}{$n}{$e}};
		    print " "x17 . "% $model $meth $e\n";
		    my $st = $l[-5]/$l[0];
		    my $tr = $l[-4]/$l[0];
		    my $T = $l[-2]/$l[0];
		    my $res = $T >= 10 ? 1 : 2;
		    $res = 0 if $T >= 100;
		    printf "%17s& %.0f & %.0f & %.${res}f\n", "", $st, $tr, $T;
		}
	    }
	}
    }
    exit 0;
}


221
my @models = sort keys %Canons;
222
223
224

foreach my $meth (sort keys %H)
{
225
226
227
228
229
    if ((exists $ENV{MAXLINES})
	&& ($lines + $S{$meth} + 2 > $ENV{MAXLINES}))
    {
	print ""; $lines=0;
    }
230

231
    printf "%21s", "";
232
    foreach my $m (@models)
233
    {
234
235
	my $n = $Canon{$meth}{$m} || "";
	$n .= " " x ((16-length($n))/2);
236
237
	printf "%18s", $n;
    }
238
    print "\n"; ++$lines;
239
240

    printf "%21s", "";
241
    foreach my $n (@models)
242
243
244
245
246
247
248
249
250
    {
        my $x = 2;
    	foreach my $k (keys %{$H{$meth}{$n}})
	{
    	   printf "%9s", $k;
	   $x--;
	}
        print " " x (9*$x);
    }
251
    print "\n"; ++$lines;
252
253
254
255

    for (my $i = 0; $i < $S{$meth}; ++$i)
    {
	printf "%-22s", $C{$meth}->[$i];
256
	foreach my $n (@models)
257
258
259
260
261
262
263
	{
	    my $x = 2;
	    foreach my $k (keys %{$H{$meth}{$n}})
	    {
		my @l = @{$H{$meth}{$n}{$k}};
		if ($i)
		{
264
265
266
267
268
269
270
271
272
273
274
275
276
		    my $val = $l[$i]/$l[0];
		    if ($val < 100000)
		    {
			printf "%8.2f ", $val;
		    }
		    elsif ($val < 1000000)
		    {
			printf "%8.1f ", $val;
		    }
		    else
		    {
			printf "%8d ", $val;
		    }
277
278
279
280
281
282
283
284
285
		}
		else
		{
		    printf "%5dx   ", $l[$i];
		}
		$x--
	    }
	    print " " x (9*$x);
	}
286
	print "\n"; ++$lines;
287
288
    }
}