8 Usage: $0 [-c] <parameters file>
11 -n dry-run mode (for debugging)
12 -c (continue) do not overwrite previous results
27 eval test -n "\${$1}" || die "undefined $1"
31 eval test "\${#$1}" -gt 0 || die "undefined $1"
37 while getopts "chn" c; do
46 [ $# -eq 1 ] || usage 1
50 log "Hostname: $(hostname -f)"
52 declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS
55 log "Reading parameters from \"$1\"."
56 source "$parameters" || die "cannot read parameters file: \"$parameters\""
58 array_check TOPOLOGIES
59 array_check ALGORITHMS
63 variable_check DEADLINE
66 : ${RESULTS:=$PWD/results}
70 --cfg=contexts/factory:raw
73 log "Results from : \"$RESULTS\"."
75 [ $debug = 1 ] && log "Running in dry-run mode"
78 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
80 params=([0]="Load" [1]="Computation" [2]="Data send amount" [3]="Data send count" )
84 for param in "${params[@]}"; do
85 firsttexline=$(echo "$firsttexline r|")
87 firsttexline=$(echo -e "\\\begin{tabular}{$firsttexline}\n\\hline\c")
89 lasttexline="\\end{tabular}"
91 secondtexline="Alg/Param"
92 for param in "${params[@]}"; do
93 secondtexline=$(echo -e "$secondtexline&\t${param}")
95 secondtexline=$(echo -e "$secondtexline\\t \\\\\\\\ \\hline \\hline\c")
97 mediantexlineend=$(echo -e "\\\\\\\\ \\hline\c")
98 # mediantexlineend=$(echo -e "$mediantexlineend\c")
100 for plat in "${PLATFORMS[@]}"; do
101 tmp=$(basename "$plat" ".xml")
102 plat_output="$RESULTS/plat_$tmp"
103 for topo in "${TOPOLOGIES[@]}"; do
104 topo_output="$plat_output/topo_$topo"
105 topo_data_all_output="$plat_output/data_$topo-all.tex"
106 echo "$firsttexline" > "$topo_data_all_output"
107 echo "$secondtexline" >> "$topo_data_all_output"
108 for algo in "${ALGORITHMS[@]}"; do
109 algo_output="$topo_output/algo_$algo"
118 for bk in "" "-b"; do
119 mediantexline="$algo$bk\t"
120 tmp=$(outfile "loba" $bk "${args[@]}")
121 infile="$algo_output/$tmp.out"
122 for target_i in "0" "1" "2" "3"; do
123 target_param=${params[$target_i]};
124 target_position=${params_pos[$target_i]};
125 outfilesuffix=$(outfile "${target_param[@]}")
126 topo_data_out="$plat_output/data_$topo-$outfilesuffix.tex"
127 variable=$(awk '/'"$target_param"'/{print $'"$target_position"'}' "$infile")
128 log "Reading $target_param from $infile : $variable"
129 mediantexline=$(echo -e "$mediantexline&$variable\t")
130 echo -e "$algo$bk\t$variable\n" >> "$topo_data_out"
132 echo "$mediantexline" >> "$topo_data_all_output"
133 echo "$mediantexlineend" >> "$topo_data_all_output"
136 echo "$lasttexline" >> "$topo_data_all_output"