]> AND Private Git Repository - loba.git/blobdiff - Experimentations/run-all
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
run-all: report error messages on failure.
[loba.git] / Experimentations / run-all
index 9453bc3884f1c867787b48e756028a7fa68cd5d9..638c0a5997ba9f7d7d530087351fc4477a011c0b 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 
 usage() {
     cat >&2 <<EOF
 
 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)
 Options:
     -h  print this help
     -n  dry-run mode (for debugging)
@@ -49,7 +49,7 @@ parameters="$1"
 log "Running: $0 $@"
 log "Hostname: $(hostname -f)"
 
 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\"."
 
 # read parameters
 log "Reading parameters from \"$1\"."
@@ -68,6 +68,7 @@ variable_check DEADLINE
 
 COMMON_OPTS=(
     --cfg=contexts/factory:raw
 
 COMMON_OPTS=(
     --cfg=contexts/factory:raw
+    "${MORE_ARGS[@]}"
 )
 
 log "Results put in: \"$RESULTS\"."
 )
 
 log "Results put in: \"$RESULTS\"."
@@ -78,6 +79,12 @@ outfile() {
     echo "$*" | sed 's,[^ ]*/,,g;s/\.xml//;y/ /_/'
 }
 
     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"
 for plat in "${PLATFORMS[@]}"; do
     tmp=$(basename "$plat" ".xml")
     plat_output="$RESULTS/plat_$tmp"
@@ -101,15 +108,18 @@ for plat in "${PLATFORMS[@]}"; do
                 log "Run: ${cmd[@]}"$'\n'"... &> $out"
                 if [ $overwrite = 0 -a -e "$out" ]; then
                     log "already run !"
                 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"
                     continue
                 fi
                 if [ $debug = 1 ]; then
                     log "skipped (dry-run)"
                 else
                     echo "# ${cmd[@]}" > "$out"
-                    "${cmd[@]}" > "$out" 2>&1
-                    tail -n4 "$out"
+                    if "${cmd[@]}" >> "$out" 2>&1; then
+                        summary "$out"
+                    else
+                        grep -v '/INFO\]' "$out"
+                    fi
                 fi
             done
         done
                 fi
             done
         done