From 79b7c458b86dc3e32074fc29468e955bb5ab149f Mon Sep 17 00:00:00 2001 From: Ian Gent Date: Fri, 10 Aug 2018 18:51:43 +0100 Subject: solvability script --- solvability.sh | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/solvability.sh b/solvability.sh index eae6636..1770fc0 100755 --- a/solvability.sh +++ b/solvability.sh @@ -3,44 +3,19 @@ if [ "$#" != 4 ]; then echo "Usage: \"\" " - echo "e.g.: ./solvability.sh 1000 40 \"sol --type alpha-star --timeout 6000 --str smart-solvability\" results.csv" + echo "e.g.: ./solvability.sh 1000 40 \"sol --type alpha-star --timeout 6000 --str smart-solvability\" results" exit 1 fi -tmp=".tmp" - -cleanup () { - if [ -d "$tmp" ]; then - rm -r "$tmp" - fi -} - -writetofile () { - if [ -d "$tmp" ]; then - echo "Attempted Seed, Outcome, Time Taken(ms), States Searched, Unique States Searched, Backtracks, Dominance Moves, States Removed From Cache, Final States In Cache, Final Buckets In Cache, Maximum Search Depth, Final Search Depth" > "$out" - cat "$tmp"/*/*/stdout >> "$out" - fi -} - -exitfn () { - if [ -d "$tmp" ]; then - writetofile - cleanup - exit - fi -} - - seeds="$1" cores="$2" sol_command="$3" +minramfree="100G" out="$4" -cleanup -trap "exitfn" INT +echo "Attempted Seed, Outcome, Time Taken(ms), States Searched, Unique States Searched, Backtracks, Dominance Moves, States Removed From Cache, Final States In Cache, Final Buckets In Cache, Maximum Search Depth, Final Search Depth" > "$out.csv" -parallel --results "$tmp" --progress -j"$cores" "$sol_command" --ra {} --class ::: $(seq "$seeds") >/dev/null +seq "$seeds" | parallel --joblog $out.log --progress --memfree $minramfree -j"$cores" "$sol_command" --ra {} --class >> "$out.csv" -exitfn -- cgit v1.2.1