spot/bench/gspn-ssp/tools/sum
2008-08-29 16:28:24 +02:00

288 lines
4.7 KiB
Perl
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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",
"inclusion count",
"max. depth",
"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",
],
);
$C{e2a} = $C{e2};
$C{e45} = $C{e5};
$C{e54} = $C{e5};
$C{e5L} = $C{e5};
$C{e5n} = $C{e5};
$C{e45n} = $C{e5};
my %filter = (states => 1, transitions => 1, user => 1);
my %order = (e2 => 2, e6 => 3, e5 => 4, e4 => 5);
my %H;
my %S;
my %P;
my %Canon;
my %Canons;
my $lines = 0;
if (0 == @ARGV)
{
@ARGV = glob "results/*.log";
}
while (<>)
{
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
push @l, ($l[-1] + $l[-2] + $l[-6] * 4096)/1024;
my $e = shift @l;
$e =~ s/non empty/non e./;
$ARGV =~ /([\w.]+)\.(e.*)-f-\d+\.log$/;
my $name = $1;
(my $meth = $2) =~ s/-//g;
my $namea = "$name-$meth";
$meth = $meth.'a' if $name =~ /asym/;
$P{$name}{$e}{$meth} = 1;
my $namec = $name;
$namec =~ s/asym/sym/;
$namec =~ s/\.rg//;
$Canon{$meth}{$namec} = $namea;
$Canons{$namec} = 1;
if (!exists $H{$meth}{$namec}{$e})
{
$H{$meth}{$namec}{$e} = [1, @l];
$S{$meth} = 1 + @l;
}
else
{
$H{$meth}{$namec}{$e}->[0]++;
for (my $i = 0; $i < @l; ++$i)
{
$H{$meth}{$namec}{$e}->[$i + 1] += $l[$i];
}
}
}
sub model_sort ($$)
{
my ($a, $b) = @_;
$a =~ s/\.rg//;
$a =~ s/.*(\d)$/$1$&/;
$a =~ s/asym/sym/;
$b =~ s/\.rg//;
$b =~ s/.*(\d)$/$1$&/;
$b =~ s/asym/sym/;
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}})
{
my $n = "$model.$meth";
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;
}
my @models = sort keys %Canons;
foreach my $meth (sort keys %H)
{
if ((exists $ENV{MAXLINES})
&& ($lines + $S{$meth} + 2 > $ENV{MAXLINES}))
{
print " "; $lines=0;
}
printf "%21s", "";
foreach my $m (@models)
{
my $n = $Canon{$meth}{$m} || "";
$n .= " " x ((16-length($n))/2);
printf "%18s", $n;
}
print "\n"; ++$lines;
printf "%21s", "";
foreach my $n (@models)
{
my $x = 2;
foreach my $k (keys %{$H{$meth}{$n}})
{
printf "%9s", $k;
$x--;
}
print " " x (9*$x);
}
print "\n"; ++$lines;
for (my $i = 0; $i < $S{$meth}; ++$i)
{
printf "%-22s", $C{$meth}->[$i];
foreach my $n (@models)
{
my $x = 2;
foreach my $k (keys %{$H{$meth}{$n}})
{
my @l = @{$H{$meth}{$n}{$k}};
if ($i)
{
my $val = $l[$i]/$l[0];
if ($val < 100000)
{
printf "%8.2f ", $val;
}
elsif ($val < 1000000)
{
printf "%8.1f ", $val;
}
else
{
printf "%8d ", $val;
}
}
else
{
printf "%5dx ", $l[$i];
}
$x--
}
print " " x (9*$x);
}
print "\n"; ++$lines;
}
}