Commit d1aa12ec authored by Philipp Meyer's avatar Philipp Meyer
Browse files

Fix script for generating benchmark table

parent 99973a5a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
all: main.pdf

program: pp-print 
	@echo 'Compiling pp-print'
	@$(MAKE) -C pp-print
@@ -9,13 +11,13 @@ peregrine:
protocols: program
	@./generate_protocols.sh

results: protocols peregrine
results/results.csv: protocols peregrine
	@./run_benchmarks.sh

table.tex: results
table.tex: results/results.csv
	python3 make_table.py >table.tex

pdf: table.tex
main.pdf: table.tex
	pdflatex main.tex

clean:
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
    $|Q|$ & Number of states. \\
    $|T|$ & Number of non-silent transitions. \\
    termination & Time in seconds to prove layered termination. \\
    $|\mathcal{P}|$ & Number of blocks in the partition for layered termination. \\
    $|\mathcal{P}|$ & Number of layers in the partition for layered termination. \\
    consensus & Time in seconds to prove strong consensus. \\
    $|\mathcal{R}|$ & Number of refinement steps (i.e.\ number of traps or siphons) for strong consensus. \\
    total & Time in seconds to prove layered termination and strong consensus. \\
+6 −5
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@ prop_steps = [ '$|\mathcal{P}|$', '$|R|$' ]
max_params = 2

long_table = True
short_table = True
short_table = False

if len(sys.argv) >= 2:
    long_table = False
    short_table = False
@@ -87,9 +88,9 @@ if long_table:
        for i in range(len(params), max_params):
            row_string += " &"

        n_places = row['places']
        n_states = row['states']
        n_transitions = row['transitions']
        row_string += ' & %d & %d' % (n_places, n_transitions)
        row_string += ' & %d & %d' % (n_states, n_transitions)

        total_time = 0.0
        total_timeout = False
@@ -166,9 +167,9 @@ if short_table:
            val = params[0][1:]
            row_string += "%s " % val

        n_places = row['places']
        n_states = row['states']
        n_transitions = row['transitions']
        row_string += ' & %d & %d' % (n_places, n_transitions)
        row_string += ' & %d & %d' % (n_states, n_transitions)

        total_time = 0.0
        total_timeout = False
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ mkdir -p $benchmark_dir/$out_dir
mkdir -p $benchmark_dir/$results_dir

>$benchmark_dir/$results_dir/results.csv
echo -n "protocol,file,places,transitions" >>$benchmark_dir/$results_dir/results.csv
echo -n "protocol,file,states,transitions" >>$benchmark_dir/$results_dir/results.csv

for (( propi=0;propi<${#properties[@]};propi++)); do
    prop=${properties[$propi]}
@@ -51,9 +51,9 @@ for protocol_dir in $(find $benchmark_dir/$protocols_dir -mindepth 1 -maxdepth 1
                (
                    $executable_dir/$executable $options $filename 2>&1 | tee $benchmark_dir/$out_dir/$protocol/$file.out
                )
                n_places=$(grep -e 'Number of places' "$benchmark_dir/$out_dir/$protocol/$file.out" | sed -e 's/^.*: \([0-9]*\)$/\1/')
                n_states=$(grep -e 'Number of states' "$benchmark_dir/$out_dir/$protocol/$file.out" | sed -e 's/^.*: \([0-9]*\)$/\1/')
                n_transitions=$(grep -e 'Number of transitions' "$benchmark_dir/$out_dir/$protocol/$file.out" | sed -e 's/^.*: \([0-9]*\)$/\1/')
                echo -n ",$n_places,$n_transitions" >>$benchmark_dir/$results_dir/results.csv
                echo -n ",$n_states,$n_transitions" >>$benchmark_dir/$results_dir/results.csv

                for (( propi=0;propi<${#properties[@]};propi++)); do
                    prop=${properties[$propi]}