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

Private GIT Repository
Add experimental plot script.
[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 grep '_[IR]N_.*bookkeeping' alldata > $tmpA
17
18 for type in I R; do
19     for ratio in 10:1 1:1 1:10; do
20         for platf in cluster grid; do
21             for topo in line torus hcube; do
22                 title="results_${type}N_${ratio}/plat_${platf}/topo_${topo}"
23                 echo "===[ $title ]==="
24                 < $tmpA awk \
25                     -v re="^results_${type}N_${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 true; then
55                 ### show conv max
56                 gnuplot \
57                     -e "set title '$title'" \
58                     -e "plot
59 for [i=0:3] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1)" \
60                     -e "pause mouse"
61 else
62                 ### all idle avg; conv avg; conv max
63                 gnuplot \
64                     -e "set title '$title'" \
65                     -e "plot
66 for [i=0:3] '$tmpB' index i using 1:4 with linespoint ls i+1 title column(1),
67 for [i=0:3] '$tmpB' index i using 1:3 with linespoint ls i+1 notitle,
68 for [i=0:3] '$tmpB' index i using 1:2 with linespoint ls i+1 notitle" \
69                     -e "pause mouse"
70 fi
71             done
72         done
73     done
74 done