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}
76 test -x "$LOBA" || die "command not found: \"$LOBA\""
78 log "Results put in: \"$RESULTS\"."
80 [ $debug = 1 ] && log "Running in dry-run mode"
83 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
88 | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
89 /send\|recv\|wall clock\|Simulation succeeded/d;p;
93 if [ $compress = 1 ]; then
99 for plat in "${PLATFORMS[@]}"; do
100 tmp=$(basename "$plat" ".xml")
101 plat_output="$RESULTS/plat_$tmp"
102 for topo in "${TOPOLOGIES[@]}"; do
103 topo_output="$plat_output/topo_$topo"
104 [ $debug = 0 ] && mkdir -p "$topo_output"
105 for algo in "${ALGORITHMS[@]}"; do
106 algo_output="$topo_output/algo_$algo"
115 for bk in "plain" "bookkeeping"; do
116 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
119 "bookkeeping") cmd+=( "-b" ) ;;
120 *) die "internal error (bk = \"$bk\")" ;;
122 out="${algo_output}_${bk}.out"
123 outf="$out$outsuffix"
124 cmd+=( "${args[@]}" )
125 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
126 if [ $overwrite = 0 -a -e "$outf" ]; then
131 if [ $debug = 1 ]; then
132 log "skipped (dry-run)"
136 echo "# ${cmd[@]}" > "$out"
137 if "${cmd[@]}" >> "$out" 2>&1; then
140 grep -v '/INFO\]' "$out"
142 if [ $compress = 1 ]; then
143 log "Compress output file."