aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/run-egg-benchmarks.sh
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/run-egg-benchmarks.sh')
-rwxr-xr-xbenchmarks/run-egg-benchmarks.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/benchmarks/run-egg-benchmarks.sh b/benchmarks/run-egg-benchmarks.sh
index d29db27..f5e7c32 100755
--- a/benchmarks/run-egg-benchmarks.sh
+++ b/benchmarks/run-egg-benchmarks.sh
@@ -1,30 +1,41 @@
1# egg-solver built with:
2# cargo build --release --locked
3# mkdir -p tables
4# target/release/gen $i auto tables/h$i # i from 0 to 11
5# target/release/bench tables/h$i tune # i from 0 to 11
6
1scr="../nissy-core/benchmarks/scrambles" 7scr="../nissy-core/benchmarks/scrambles"
2out="../nissy-core/benchmarks/results_egg.py" 8out="../nissy-core/benchmarks/results_egg.py"
3 9
4get_solve_time() { 10get_solve_time() {
5 ./target/release/solve -t "$1" --table "tables/h$2" <"$3" \ 11 if [ -n "$4" ]; then
12 solve_all="./target/release/solve --all-optimal"
13 else
14 solve_all="./target/release/solve"
15 fi
16 $solve_all -t "$1" -c 1 --table "tables/h$2" <"$3" \
6 | tail -1 | sed 's/.*cubes wall //; s/ wall.*//' 17 | tail -1 | sed 's/.*cubes wall //; s/ wall.*//'
7} 18}
8 19
9do_all() { 20do_all() {
10 echo "doing all $1 $2"
11 t=$1 21 t=$1
12 name=$2 22 name=$2
23
13 printf '%s = {\n' "$name" >> "$out" 24 printf '%s = {\n' "$name" >> "$out"
14 for i in 6 7 8 9 10 11 ; do 25 for i in 6 7 8 9 10 11 ; do
15 echo "Doing 17 moves for h$i with $t threads..." 26 echo "Doing 17 moves for h$i with $t threads..."
16 t17="$(get_solve_time $t $i "$scr/scrambles-17.txt")" 27 t17="$(get_solve_time $t $i "$scr/scrambles-17.txt" "$3")"
17 echo "Doing 18 moves for h$i with $t threads..." 28 echo "Doing 18 moves for h$i with $t threads..."
18 t18="$(get_solve_time $t $i "$scr/scrambles-18.txt")" 29 t18="$(get_solve_time $t $i "$scr/scrambles-18.txt" "$3")"
19 echo "Doing 19 moves for h$i with $t threads..." 30 echo "Doing 19 moves for h$i with $t threads..."
20 t19="$(get_solve_time $t $i "$scr/scrambles-19.txt")" 31 t19="$(get_solve_time $t $i "$scr/scrambles-19.txt" "$3")"
21 printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" 32 printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out"
22 if [ "$i" -ge 10 ]; then 33 if [ "$i" -ge 10 ]; then
23 echo "Doing 20 moves for h$i with $t threads..." 34 echo "Doing 20 moves for h$i with $t threads..."
24 t20="$(get_solve_time $t $i "$scr/scrambles-20.txt")" 35 t20="$(get_solve_time $t $i "$scr/scrambles-20.txt" "$3")"
25 printf ', 20: %s' $t20 >> "$out" 36 printf ', 20: %s' $t20 >> "$out"
26 echo "Doing superflip moves for h$i with $t threads..." 37 echo "Doing superflip moves for h$i with $t threads..."
27 tsf="$(get_solve_time $t $i "$scr/superflip.txt")" 38 tsf="$(get_solve_time $t $i "$scr/superflip.txt" "$3")"
28 printf ', "superflip": %s},\n' $tsf >> "$out" 39 printf ', "superflip": %s},\n' $tsf >> "$out"
29 else 40 else
30 printf '},\n' >> "$out" 41 printf '},\n' >> "$out"
@@ -38,3 +49,4 @@ printf '' > "$out"
38do_all 1 "egg_single_thread" 49do_all 1 "egg_single_thread"
39do_all 4 "egg_4_threads" 50do_all 4 "egg_4_threads"
40do_all 16 "egg_16_threads" 51do_all 16 "egg_16_threads"
52do_all 16 "egg_all_solutions" "all"

Generated with cgit - Back to sebastiano.tronto.net