8 Usage: $0 [OPTION] <parameters file>
11 -n dry-run mode (for debugging)
12 -c (continue) do not overwrite previous results
27 eval test -n "\${$1}" || die "undefined $1"
31 eval test "\${#$1}" -gt 0 || die "undefined $1"
37 while getopts "chn" c; do
46 [ $# -eq 1 ] || usage 1
50 log "Hostname: $(hostname -f)"
52 declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS MORE_ARGS
55 log "Reading parameters from \"$1\"."
56 source "$parameters" || die "cannot read parameters file: \"$parameters\""
58 array_check TOPOLOGIES
59 array_check ALGORITHMS
63 variable_check DEADLINE
66 : ${RESULTS:=$PWD/results}
70 --cfg=contexts/factory:raw
74 log "Results put in: \"$RESULTS\"."
76 [ $debug = 1 ] && log "Running in dry-run mode"
79 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
82 for plat in "${PLATFORMS[@]}"; do
83 tmp=$(basename "$plat" ".xml")
84 plat_output="$RESULTS/plat_$tmp"
85 for topo in "${TOPOLOGIES[@]}"; do
86 topo_output="$plat_output/topo_$topo"
87 for algo in "${ALGORITHMS[@]}"; do
88 algo_output="$topo_output/algo_$algo"
89 [ $debug = 0 ] && mkdir -p "$algo_output"
99 tmp=$(outfile "loba" $bk "${args[@]}")
100 out="$algo_output/$tmp.out"
101 cmd=( "$LOBA" "${COMMON_OPTS[@]}" $bk "${args[@]}" )
102 log "Run: ${cmd[@]}"$'\n'"... &> $out"
103 if [ $overwrite = 0 -a -e "$out" ]; then
108 if [ $debug = 1 ]; then
109 log "skipped (dry-run)"
111 echo "# ${cmd[@]}" > "$out"
112 "${cmd[@]}" >> "$out" 2>&1