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 -x "$LOBA" || die "command not found: \"$LOBA\""
79 log "Results put in: \"$RESULTS\"."
81 [ $debug = 1 ] && log "Running in dry-run mode"
84 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
89 | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
90 /send\|recv\|wall clock\|Simulation succeeded/d;p;
94 if [ $compress = 1 ]; then
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 [ $debug = 0 ] && mkdir -p "$topo_output"
106 for algo in "${ALGORITHMS[@]}"; do
107 algo_output="$topo_output/algo_$algo"
116 for variant in "${VARIANTS[@]}"; do
117 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
120 "bookkeeping") cmd+=( "-b" ) ;;
121 *) die "unknown variant: \"$variant\"" ;;
123 out="${algo_output}_${variant}.out"
124 outf="$out$outsuffix"
125 cmd+=( "${args[@]}" )
126 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
127 if [ $overwrite = 0 -a -e "$outf" ]; then
132 if [ $debug = 1 ]; then
133 log "skipped (dry-run)"
137 echo "# ${cmd[@]}" > "$out"
138 if "${cmd[@]}" >> "$out" 2>&1; then
141 grep -v '/INFO\]' "$out"
143 if [ $compress = 1 ]; then
144 log "Compress output file."