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/ /_/'
83 sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
84 /send\|recv\|wall clock\|Simulation succeeded/d;p;
88 for plat in "${PLATFORMS[@]}"; do
89 tmp=$(basename "$plat" ".xml")
90 plat_output="$RESULTS/plat_$tmp"
91 for topo in "${TOPOLOGIES[@]}"; do
92 topo_output="$plat_output/topo_$topo"
93 for algo in "${ALGORITHMS[@]}"; do
94 algo_output="$topo_output/algo_$algo"
95 [ $debug = 0 ] && mkdir -p "$algo_output"
104 for bk in "" "-b"; do
105 tmp=$(outfile "loba" $bk "${args[@]}")
106 out="$algo_output/$tmp.out"
107 cmd=( "$LOBA" "${COMMON_OPTS[@]}" $bk "${args[@]}" )
108 log "Run: ${cmd[@]}"$'\n'"... &> $out"
109 if [ $overwrite = 0 -a -e "$out" ]; then
114 if [ $debug = 1 ]; then
115 log "skipped (dry-run)"
117 echo "# ${cmd[@]}" > "$out"
118 if "${cmd[@]}" >> "$out" 2>&1; then
121 grep -v '/INFO\]' "$out"
123 ### FIXME : make this step optional