usage() {
cat >&2 <<EOF
-Usage: $0 [-c] <parameters file>
+Usage: $0 [OPTION] <parameters file>
Options:
-h print this help
-n dry-run mode (for debugging)
log "Running: $0 $@"
log "Hostname: $(hostname -f)"
-declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS
+declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS MORE_ARGS
# read parameters
log "Reading parameters from \"$1\"."
COMMON_OPTS=(
--cfg=contexts/factory:raw
+ "${MORE_ARGS[@]}"
)
log "Results put in: \"$RESULTS\"."
echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
}
+summary() {
+ sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${
+ /send\|recv\|wall clock\|Simulation succeeded/d;p;
+ }' "$1"
+}
+
for plat in "${PLATFORMS[@]}"; do
tmp=$(basename "$plat" ".xml")
plat_output="$RESULTS/plat_$tmp"
log "Run: ${cmd[@]}"$'\n'"... &> $out"
if [ $overwrite = 0 -a -e "$out" ]; then
log "already run !"
- tail -n4 "$out"
+ summary "$out"
continue
fi
if [ $debug = 1 ]; then
log "skipped (dry-run)"
else
echo "# ${cmd[@]}" > "$out"
- out2="/tmp/tmp_loba.o"
- "${cmd[@]}" > "$out2" 2>&1
- tail -17 "$out2" >> "$out"
- tail -n4 "$out"
+ if "${cmd[@]}" >> "$out" 2>&1; then
+ summary "$out"
+ else
+ grep -v '/INFO\]' "$out"
+ fi
+### FIXME : make this step optional
+gzip --best "$out"
fi
done
done