aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/run-h48-benchmarks.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-12-17 09:26:53 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-12-17 09:26:53 +0100
commit36f37564cd566e91771cd1f92ac3886917c769d1 (patch)
tree037b21f46dafb4edce8aeef25fc3d6e1d607df12 /benchmarks/run-h48-benchmarks.sh
parentc6ab40b1602443938e431b996b28fb3d888365bb (diff)
downloadnissy-core-36f37564cd566e91771cd1f92ac3886917c769d1.tar.gz
nissy-core-36f37564cd566e91771cd1f92ac3886917c769d1.zip
Update benchmarks
Diffstat (limited to 'benchmarks/run-h48-benchmarks.sh')
-rwxr-xr-xbenchmarks/run-h48-benchmarks.sh44
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
5scr="./benchmarks/scrambles"
6out="./benchmarks/results_h48.py"
7
8get_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
13do_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
39printf '' > "$out"
40
41do_all 6 10 11 1 1 "h48_single_thread"
42do_all 6 9 11 4 1 "h48_4_threads"
43do_all 6 9 11 16 1 "h48_16_threads"
44do_all 6 10 11 16 999999 "h48_all_solutions"

Generated with cgit - Back to sebastiano.tronto.net