Project

General

Profile

Statistics
| Branch: | Revision:

cool / benchmarks / aconjunctive_mu / collect_output.pl @ 42e43efd

History | View | Annotate | Download (1.37 KB)

1
#!/usr/bin/perl
2

    
3
# This script must be run inside the output directory where the *.time and *.out
4
# files are.
5

    
6
use warnings;
7
use strict;
8

    
9
use File::Basename;
10

    
11
print "family; index; variant; time (seconds); stddev (percent); result; states\n";
12

    
13
foreach my $timefile (<*/*.time>) {
14
    next if ($timefile =~ /tmp.time|tmp.out/);
15

    
16
    my $base = basename($timefile, ".time");
17
    my $outfile = $timefile =~ s/time$/out/r;
18

    
19
    my ($family, $index, $variant);
20

    
21
    if ($base =~ /(.*)-(\d+)-(.*)/) {
22
	$family = $1;
23
	$index = $2;
24
	$variant = $3;
25
    } else {die;}
26

    
27
    my $time, my $stddev;
28
    open (FILE, '<', $timefile) or die;
29
    while (<FILE>) {
30
	if (/([.0-9]+) seconds time elapsed.*\+-\s+([.0-9]+)%/) {
31
	    $time = $1;
32
	    $stddev = $2
33
	}
34
    }
35
    close (FILE) or die;
36

    
37
    my ($result, $states, $cores);
38

    
39
    open (FILE, '<', "$outfile") or die;
40
    while (<FILE>) {
41
	if (/Query is not satisfiable/ or /Formula is unsatisfiable/) {
42
	    $result = "unsat";
43
	} elsif (/Query is satisfiable/ or /Formula is satisfiable/) {
44
	    $result = "sat";
45
	} elsif (/Generated states: (\d+)/) {
46
	    $states = $1;
47
	} elsif (/Generated cores: (\d+)/) {
48
	    $cores = $1;
49
	} elsif (/Game has (\d+) states/) {
50
	    $states = $1; $cores = 0;
51
	}
52
    }
53
    close (FILE) or die;
54

    
55
    $states += $cores;
56

    
57
    printf "%s; %02d; %s; %s; %s; %s; %d\n", $family, $index, $variant, $time, $stddev, $result, $states;
58
}