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
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
73 log "Results put in: \"$RESULTS\"."
75 [ $debug = 1 ] && log "Running in dry-run mode"
78 echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
81 for plat in "${PLATFORMS[@]}"; do
82 tmp=$(basename "$plat" ".xml")
83 plat_output="$RESULTS/plat_$tmp"
84 for topo in "${TOPOLOGIES[@]}"; do
85 topo_output="$plat_output/topo_$topo"
86 for algo in "${ALGORITHMS[@]}"; do
87 algo_output="$topo_output/algo_$algo"
88 [ $debug = 0 ] && mkdir -p "$algo_output"
98 tmp=$(outfile "loba" $bk "${args[@]}")
99 out="$algo_output/$tmp.out"
100 cmd=( "$LOBA" "${COMMON_OPTS[@]}" $bk "${args[@]}" )
101 log "Run: ${cmd[@]}"$'\n'"... &> $out"
102 if [ $overwrite = 0 -a -e "$out" ]; then
107 if [ $debug = 1 ]; then
108 log "skipped (dry-run)"
110 echo "# ${cmd[@]}" > "$out"
111 "${cmd[@]}" >> "$out" 2>&1