diff options
Diffstat (limited to 'benchmarks/run-h48-benchmarks.sh')
| -rwxr-xr-x | benchmarks/run-h48-benchmarks.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/benchmarks/run-h48-benchmarks.sh b/benchmarks/run-h48-benchmarks.sh new file mode 100755 index 0000000..4b4d174 --- /dev/null +++ b/benchmarks/run-h48-benchmarks.sh | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # This script must be run from the main repository folder. | ||
| 4 | |||
| 5 | scr="./benchmarks/scrambles" | ||
| 6 | out="./benchmarks/results_h48.py" | ||
| 7 | |||
| 8 | get_solve_time() { | ||
| 9 | THREADS="$1" ./build.sh tool solve_file "$2" "$3" "$4" 0 | \ | ||
| 10 | tail -n 1 | sed 's/Total time: //; s/s$//' | ||
| 11 | } | ||
| 12 | |||
| 13 | do_all() { | ||
| 14 | low=$1 | ||
| 15 | cutoff=$2 | ||
| 16 | high=$3 | ||
| 17 | t=$4 | ||
| 18 | n=$5 | ||
| 19 | name=$6 | ||
| 20 | |||
| 21 | printf '%s = {\n' "$name" >> "$out" | ||
| 22 | for i in $(seq "$low" "$high"); do | ||
| 23 | t17="$(get_solve_time $t h48h$i "$scr/scrambles-17.txt" $n)" | ||
| 24 | t18="$(get_solve_time $t h48h$i "$scr/scrambles-18.txt" $n)" | ||
| 25 | t19="$(get_solve_time $t h48h$i "$scr/scrambles-19.txt" $n)" | ||
| 26 | printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" | ||
| 27 | if [ "$i" -ge "$cutoff" ]; then | ||
| 28 | t20="$(get_solve_time $t h48h$i "$scr/scrambles-20.txt" $n)" | ||
| 29 | tsf="$(get_solve_time $t h48h$i "$scr/superflip.txt" $n)" | ||
| 30 | printf ', 20: %s, "superflip": %s},\n' $t20 $tsf >> "$out" | ||
| 31 | else | ||
| 32 | printf '},\n' >> "$out" | ||
| 33 | fi | ||
| 34 | done | ||
| 35 | printf '}\n\n' >> "$out" | ||
| 36 | } | ||
| 37 | |||
| 38 | ./build.sh clean && ./build.sh | ||
| 39 | printf '' > "$out" | ||
| 40 | |||
| 41 | do_all 6 10 11 1 1 "h48_single_thread" | ||
| 42 | do_all 6 9 11 4 1 "h48_4_threads" | ||
| 43 | do_all 6 9 11 16 1 "h48_16_threads" | ||
| 44 | do_all 6 10 11 16 999999 "h48_all_solutions" | ||
