]> AND Private Git Repository - loba-papers.git/blob - supercomp11/data/interactive_plot
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Add the possibility to give a filtering RE on command line.
[loba-papers.git] / supercomp11 / data / interactive_plot
1 #!/bin/bash
2
3 set -e
4
5 declare -a toclean
6 cleanup() {
7     test ${#toclean[@]} -gt 0 && rm -f "${toclean[@]}"
8 }
9 trap cleanup EXIT
10
11 tmpA=$(mktemp)
12 toclean+=( $tmpA )
13 tmpB=$(mktemp)
14 toclean+=( $tmpB )
15
16 RE=${1:-_R[1N]_}
17
18 grep -e "$RE" alldata > $tmpA
19
20 for type in {I,R}{1,N}; do
21     for ratio in 10:1 1:1 1:10; do
22         for platf in cluster grid; do
23             for topo in line torus hcube; do
24                 < $tmpA awk \
25                     -v re="^results_${type}_${ratio}/plat_${platf}[0-9]+/topo_${topo}" \
26 '
27 $0 ~ re {
28     split($1, cfg, "/");
29     platf=cfg[2];
30     algo=cfg[4];
31     size=substr(platf, match(platf, "[0-9]"));
32     idle=$4;
33     conv_avg=$5;
34     conv_max=$6;
35     if (conv_max > 0.0)
36         print algo, size, idle, conv_avg, conv_max;
37 }
38 ' \
39                 | sort -k1,1r -k2,2n \
40                 | awk \
41 '
42 {
43     if (NR == 1) {
44         printf("%s\n", $1);
45     } else if ($1 != prev) {
46         printf("\n\n%s\n", $1);
47     }
48     prev=$1;
49     $1="";
50     print;
51 }
52 ' \
53                 > $tmpB
54                 if [ ! -s $tmpB ]; then
55                     continue
56                 fi
57                 title="results_${type}_${ratio}/plat_${platf}/topo_${topo}"
58                 echo "===[ $title ]==="
59                 nb=$(expr $(grep -c ^algo $tmpB) - 1)
60 if true; then
61                 ### show conv max
62                 gnuplot \
63                     -e "set title '$title'" \
64                     -e "plot
65 for [i=0:$nb] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1)" \
66                     -e "pause mouse"
67 else
68                 ### all idle avg; conv avg; conv max
69                 gnuplot \
70                     -e "set title '$title'" \
71                     -e "plot
72 for [i=0:$nb] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1),
73 for [i=0:$nb] '$tmpB' index i using 1:3 with linespoint ls i+1 notitle,
74 for [i=0:$nb] '$tmpB' index i using 1:2 with linespoint ls i+1 notitle" \
75                     -e "pause mouse"
76 fi
77             done
78         done
79     done
80 done