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 VARIANTS 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 test -n "$VARIANTS" || VARIANTS=( "plain" "bookkeeping" )
70 test -n "$RESULTS" || RESULTS="$PWD/results"
71 test -n "$LOBA" || LOBA="$PWD/loba"
77 test -f "$LOBA" && test -x "$LOBA" || die "command not found: \"$LOBA\""
78 for plat in "${PLATFORMS[@]}"; do
79 test -f "$plat" && test -r "$plat" || die "file not found: \"$plat\""
82 log "Results put in: \"$RESULTS\"."
84 [ $debug = 1 ] && log "Running in dry-run mode"
87 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
92 | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
93 /send\|recv\|wall clock\|Simulation succeeded/d;p;
97 if [ $compress = 1 ]; then
103 for plat in "${PLATFORMS[@]}"; do
104 tmp=$(basename "$plat" ".xml")
105 plat_output="$RESULTS/plat_$tmp"
106 for topo in "${TOPOLOGIES[@]}"; do
107 topo_output="$plat_output/topo_$topo"
108 [ $debug = 0 ] && mkdir -p "$topo_output"
109 for algo in "${ALGORITHMS[@]}"; do
110 algo_output="$topo_output/algo_$algo"
119 for variant in "${VARIANTS[@]}"; do
120 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
123 "bookkeeping") cmd+=( "-b" ) ;;
124 *) die "unknown variant: \"$variant\"" ;;
126 out="${algo_output}_${variant}.out"
127 outf="$out$outsuffix"
128 cmd+=( "${args[@]}" )
129 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
130 if [ $overwrite = 0 -a -e "$outf" ]; then
135 if [ $debug = 1 ]; then
136 log "skipped (dry-run)"
140 echo "# ${cmd[@]}" > "$out"
141 if "${cmd[@]}" >> "$out" 2>&1; then
144 grep -v '/INFO\]' "$out"
146 if [ $compress = 1 ]; then
147 log "Compress output file."