X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/bd0d55b6e8fb8c48072740d52c09af1f0b043f2f..6b7dedf20c9bd5bca561df7ca9d664939ca66161:/Experimentations/run-all?ds=inline diff --git a/Experimentations/run-all b/Experimentations/run-all index 5584528..581ee1f 100755 --- a/Experimentations/run-all +++ b/Experimentations/run-all @@ -10,6 +10,7 @@ Options: -h print this help -n dry-run mode (for debugging) -c (continue) do not overwrite previous results + -z compress output files with gzip EOF exit $1 } @@ -34,11 +35,13 @@ array_check() { # read args overwrite=1 debug=0 -while getopts "chn" c; do +compress=0 +while getopts "chnz" c; do case "$c" in 'c') overwrite=0 ;; 'h') usage 0 ;; 'n') debug=1 ;; + 'z') compress=1 ;; '?') usage 1 ;; esac done @@ -80,19 +83,26 @@ outfile() { } summary() { - sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${ - /send\|recv\|wall clock\|Simulation succeeded/d;p; - }' "$1" + gzip -cdf "$@" \ + | sed -n '\!^\[main/INFO\] ,----\[ Results \]!,${ + /send\|recv\|wall clock\|Simulation succeeded/d;p; + }' } +if [ $compress = 1 ]; then + outsuffix=".gz" +else + outsuffix="" +fi + for plat in "${PLATFORMS[@]}"; do tmp=$(basename "$plat" ".xml") plat_output="$RESULTS/plat_$tmp" for topo in "${TOPOLOGIES[@]}"; do topo_output="$plat_output/topo_$topo" + [ $debug = 0 ] && mkdir -p "$topo_output" for algo in "${ALGORITHMS[@]}"; do algo_output="$topo_output/algo_$algo" - [ $debug = 0 ] && mkdir -p "$algo_output" args=( -T"$topo" -a"$algo" @@ -101,22 +111,36 @@ for plat in "${PLATFORMS[@]}"; do -t"$DEADLINE" "$plat" ) - for bk in "" "-b"; do - tmp=$(outfile "loba" $bk "${args[@]}") - out="$algo_output/$tmp.out" - cmd=( "$LOBA" "${COMMON_OPTS[@]}" $bk "${args[@]}" ) - log "Run: ${cmd[@]}"$'\n'"... &> $out" - if [ $overwrite = 0 -a -e "$out" ]; then + for bk in "plain" "bookkeeping"; do + cmd=( "$LOBA" "${COMMON_OPTS[@]}" ) + case "$bk" in + "plain") : ;; + "bookkeeping") cmd+=( "-b" ) ;; + *) die "internal error (bk = \"$bk\")" ;; + esac + out="${algo_output}_${bk}.out" + outf="$out$outsuffix" + cmd+=( "${args[@]}" ) + log "Run: ${cmd[@]}"$'\n'"... &> $outf" + if [ $overwrite = 0 -a -e "$outf" ]; then log "already run !" - summary "$out" + summary "$outf" continue fi if [ $debug = 1 ]; then log "skipped (dry-run)" - else - echo "# ${cmd[@]}" > "$out" - "${cmd[@]}" >> "$out" 2>&1 + continue + fi + rm -f "$outf"; + echo "# ${cmd[@]}" > "$out" + if "${cmd[@]}" >> "$out" 2>&1; then summary "$out" + else + grep -v '/INFO\]' "$out" + fi + if [ $compress = 1 ]; then + log "Compress output file." + gzip --best "$out" fi done done