aboutsummaryrefslogtreecommitdiff
path: root/tabulate.sh
blob: 7d70b1d25b33d11eeb2c7a2cc6bacfdf16a21970 (plain)
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
#!/bin/bash
logleaves_start=10
logleaves_end=12
trials=2
runs_test=500

rm -f all_*.txt dummy_all_*.txt

for i in `seq $logleaves_start $logleaves_end`
do
    for j in `seq 1 $trials`
    do
	echo -n "$i $j " >> dummy_all_"$i".txt
	
        # 5 operations in each file
        for k in `seq 0 4`
        do
            start=$(expr $runs_test \* $k + 1)
            end=$(expr $runs_test \* \( $k + 1 \))

	    echo -n "$i " > rundata_"$i"_"$j"_"$k".txt
            cat run_"$i"_"$j".txt | sed -n $start,$end'p' | ../average.sh | awk '{printf($1" ");}' >> rundata_"$i"_"$j"_"$k".txt
        done
        echo >> all_"$i".txt

        cat dummy_"$i"_"$j".txt | awk '/Elapsed/ || /Maximum/ || /User time/ || /System time/' | awk 'BEGIN{line=0}{if(line%4<=1)printf($4" ");if(line %4==2)printf($8" ");if(line%4==3)printf($6" ");}{line+=1}END{printf("\n");}' >> dummy_all_"$i".txt
    done
done

# generate the data files
for k in `seq 0 4`
do
    rm -f "data_"$k"_"*.txt	    
    for i in `seq $logleaves_start $logleaves_end`
    do
	for j in `seq 1 $trials`
	do
	    cat rundata_"$i"_"$j"_"$k".txt | awk '{for(i=2;i<=NF;i++) { print $1, $i >> "data_"'$k'"_"i - 1".txt";} }'
	done
    done
done

for k in `seq 0 4`
do
    for f in data_$k*
    do
	cat $f | ../postprocess > final_$f
    done
done