8 Usage: $0 [OPTION] <parameters file>
11 -n dry-run mode (for debugging)
12 -c (continue) do not overwrite previous results
13 -z compress output files with gzip
28 eval test -n "\${$1}" || die "undefined $1"
32 eval test "\${#$1}" -gt 0 || die "undefined $1"
39 while getopts "chnz" c; do
49 [ $# -eq 1 ] || usage 1
53 log "Hostname: $(hostname -f)"
55 declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS MORE_ARGS
58 log "Reading parameters from \"$1\"."
59 source "$parameters" || die "cannot read parameters file: \"$parameters\""
61 array_check TOPOLOGIES
62 array_check ALGORITHMS
66 variable_check DEADLINE
69 : ${RESULTS:=$PWD/results}
73 --cfg=contexts/factory:raw
77 log "Results put in: \"$RESULTS\"."
79 [ $debug = 1 ] && log "Running in dry-run mode"
82 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
87 | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
88 /send\|recv\|wall clock\|Simulation succeeded/d;p;
92 if [ $compress = 1 ]; then
98 for plat in "${PLATFORMS[@]}"; do
99 tmp=$(basename "$plat" ".xml")
100 plat_output="$RESULTS/plat_$tmp"
101 for topo in "${TOPOLOGIES[@]}"; do
102 topo_output="$plat_output/topo_$topo"
103 [ $debug = 0 ] && mkdir -p "$topo_output"
104 # for lr in "1" "N"; do
106 # "1") loadinit=( ) ;;
107 # "N") loadinit=( "-R" "-r42" ) ;;
108 # *) die "internal error (lr = \"$lr\")" ;;
110 for mode in "R" "Z"; do
112 "R") computemode=( );;
113 "Z") computemode=( "-Z" );;
114 *) die "internal error (mode = \"$mode\")" ;;
116 for algo in "${ALGORITHMS[@]}"; do
117 algo_output="$topo_output/algo_$algo"
129 for bk in "plain" "bookkeeping"; do
130 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
133 "bookkeeping") cmd+=( "-b" ) ;;
134 *) die "internal error (bk = \"$bk\")" ;;
136 out="${algo_output}_${bk}_${mode}.out"
137 outf="$out$outsuffix"
138 cmd+=( "${args[@]}" )
139 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
140 if [ $overwrite = 0 -a -e "$outf" ]; then
145 if [ $debug = 1 ]; then
146 log "skipped (dry-run)"
150 echo "# ${cmd[@]}" > "$out"
151 if "${cmd[@]}" >> "$out" 2>&1; then
154 grep -v '/INFO\]' "$out"
156 if [ $compress = 1 ]; then
157 log "Compress output file."