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

Private GIT Repository
Add perf.data to .gitignore.
[loba.git] / Experimentations / run-all
index 95d70b1ec8d0f955540455c66392a06a07a2c5ee..5b80fbf49f0f40f2491b4bf81aa2f5ab5a327195 100755 (executable)
@@ -52,7 +52,7 @@ parameters="$1"
 log "Running: $0 $@"
 log "Hostname: $(hostname -f)"
 
 log "Running: $0 $@"
 log "Hostname: $(hostname -f)"
 
-declare -a TOPOLOGIES ALGORITHMS PLATFORMS COMMON_OPTS MORE_ARGS
+declare -a TOPOLOGIES ALGORITHMS PLATFORMS VARIANTS COMMON_OPTS MORE_ARGS
 
 # read parameters
 log "Reading parameters from \"$1\"."
 
 # read parameters
 log "Reading parameters from \"$1\"."
@@ -66,13 +66,19 @@ variable_check LOAD
 variable_check DEADLINE
 
 # default values
 variable_check DEADLINE
 
 # default values
-: ${RESULTS:=$PWD/results}
-: ${LOBA:=$PWD/loba}
+test -n "$VARIANTS" || VARIANTS=( "plain" "bookkeeping" )
+test -n "$RESULTS"  || RESULTS="$PWD/results"
+test -n "$LOBA"     || LOBA="$PWD/loba"
 
 COMMON_OPTS=(
     "${MORE_ARGS[@]}"
 )
 
 
 COMMON_OPTS=(
     "${MORE_ARGS[@]}"
 )
 
+test -f "$LOBA" && test -x "$LOBA" || die "command not found: \"$LOBA\""
+for plat in "${PLATFORMS[@]}"; do
+    test -f "$plat" && test -r "$plat" || die "file not found: \"$plat\""
+done
+
 log "Results put in: \"$RESULTS\"."
 
 [ $debug = 1 ] && log "Running in dry-run mode"
 log "Results put in: \"$RESULTS\"."
 
 [ $debug = 1 ] && log "Running in dry-run mode"
@@ -110,14 +116,14 @@ for plat in "${PLATFORMS[@]}"; do
                 -t"$DEADLINE"
                 "$plat"
             )
                 -t"$DEADLINE"
                 "$plat"
             )
-            for bk in "plain" "bookkeeping"; do
+            for variant in "${VARIANTS[@]}"; do
                 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
                 cmd=( "$LOBA" "${COMMON_OPTS[@]}" )
-                case "$bk" in
+                case "$variant" in
                     "plain") : ;;
                     "bookkeeping") cmd+=( "-b" ) ;;
                     "plain") : ;;
                     "bookkeeping") cmd+=( "-b" ) ;;
-                    *) die "internal error (bk = \"$bk\")" ;;
+                    *) die "unknown variant: \"$variant\"" ;;
                 esac
                 esac
-                out="${algo_output}_${bk}.out"
+                out="${algo_output}_${variant}.out"
                 outf="$out$outsuffix"
                 cmd+=( "${args[@]}" )
                 log "Run: ${cmd[@]}"$'\n'"... &> $outf"
                 outf="$out$outsuffix"
                 cmd+=( "${args[@]}" )
                 log "Run: ${cmd[@]}"$'\n'"... &> $outf"