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

Private GIT Repository
Embed fonts in pdf file.
[loba-papers.git] / loba-besteffort / 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 debug=0
17 if [ "$1" = "-d" ]; then
18     debug=1
19     shift
20 fi
21
22 if_debug() {
23     [ $debug = 1 ] && eval "$@"
24 }
25
26 RE=${1:-_R[1N]_}
27
28 grep -e "$RE" alldata > $tmpA
29
30 for type in {I,R}{1,N}; do
31     for ratio in 10:1 1:1 1:10; do
32         for platf in cluster grid; do
33             for topo in line torus hcube; do
34                 < $tmpA awk \
35                     -v re="^results_${type}_${ratio}/plat_${platf}[0-9]+/topo_${topo}" \
36 '
37 $0 ~ re {
38     split($1, cfg, "/");
39     platf=cfg[2];
40     algo=cfg[4];
41     size=substr(platf, match(platf, "[0-9]"));
42     idle=$4;
43     conv_avg=$5;
44     conv_max=$6;
45     if (conv_max > 0.0)
46         print algo, size, idle, conv_avg, conv_max;
47 }
48 ' \
49                 | sort -k1,1r -k2,2n \
50                 | awk \
51 '
52 {
53     if (NR == 1) {
54         printf("%s\n", $1);
55     } else if ($1 != prev) {
56         printf("\n\n%s\n", $1);
57     }
58     prev=$1;
59     $1="";
60     print;
61 }
62 ' \
63                 > $tmpB
64                 title="results_${type}_${ratio}/plat_${platf}/topo_${topo}"
65                 if [ ! -s $tmpB ]; then
66                     if_debug echo "... skip: $title"
67                     continue
68                 fi
69                 echo "===[ $title ]==="
70                 if_debug cat $tmpB
71                 nb=$(expr $(grep -c ^algo $tmpB) - 1) || true
72 if true; then
73                 ### show conv max
74                 gnuplot \
75                     -e "set title '$title'" \
76                     -e "plot
77 for [i=0:$nb] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1)" \
78                     -e "pause mouse"
79 else
80                 ### all idle avg; conv avg; conv max
81                 gnuplot \
82                     -e "set title '$title'" \
83                     -e "plot
84 for [i=0:$nb] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1),
85 for [i=0:$nb] '$tmpB' index i using 1:3 with linespoint ls i+1 notitle,
86 for [i=0:$nb] '$tmpB' index i using 1:2 with linespoint ls i+1 notitle" \
87                     -e "pause mouse"
88 fi
89             done
90         done
91     done
92 done