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 log "Results put in: \"$RESULTS\"."
78 [ $debug = 1 ] && log "Running in dry-run mode"
81 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
86 | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
87 /send\|recv\|wall clock\|Simulation succeeded/d;p;
91 if [ $compress = 1 ]; then
97 for plat in "${PLATFORMS[@]}"; do
98 tmp=$(basename "$plat" ".xml")
99 plat_output="$RESULTS/plat_$tmp"
100 for topo in "${TOPOLOGIES[@]}"; do
101 topo_output="$plat_output/topo_$topo"
102 [ $debug = 0 ] && mkdir -p "$topo_output"
103 for algo in "${ALGORITHMS[@]}"; do
104 algo_output="$topo_output/algo_$algo"
113 for bk in "plain" "bookkeeping"; do
114 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
117 "bookkeeping") cmd+=( "-b" ) ;;
118 *) die "internal error (bk = \"$bk\")" ;;
120 out="${algo_output}_${bk}.out"
121 outf="$out$outsuffix"
122 cmd+=( "${args[@]}" )
123 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
124 if [ $overwrite = 0 -a -e "$outf" ]; then
129 if [ $debug = 1 ]; then
130 log "skipped (dry-run)"
134 echo "# ${cmd[@]}" > "$out"
135 if "${cmd[@]}" >> "$out" 2>&1; then
138 grep -v '/INFO\]' "$out"
140 if [ $compress = 1 ]; then
141 log "Compress output file."