run-vcube-benchmarks.sh (1251B)
1 #!/bin/sh 2 3 # This script can be used to run benchmarks for vcube, similar to the 4 # benchmarks for H48 run by run-h48-benchmarks.sh. Before running this script, 5 # move it to the vcube folder and and adjust the paths below if necessary. 6 7 scr="../nissy-core/benchmarks/scrambles" 8 out="../nissy-core/benchmarks/results_vcube.py" 9 10 get_solve_time() { 11 ./vc-optimal -w "$1" -c "$2" <"$3" \ 12 2>&1 >/dev/null | sed 's/Total time: //; s/ real.*//' 13 } 14 15 do_all() { 16 t=$1 17 name=$2 18 printf '%s = {\n' "$name" >> "$out" 19 for i in 112 208 308 404 212 ; do 20 t17="$(get_solve_time $t $i "$scr/scrambles-17.txt")" 21 t18="$(get_solve_time $t $i "$scr/scrambles-18.txt")" 22 t19="$(get_solve_time $t $i "$scr/scrambles-19.txt")" 23 printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" 24 if [ "$i" -ge 212 ]; then 25 t20="$(get_solve_time $t $i "$scr/scrambles-20.txt")" 26 printf ', 20: %s' $t20 >> "$out" 27 if [ "$t" = 1 ]; then 28 tsf="$(get_solve_time $t $i "$scr/superflip.txt")" 29 printf ', "superflip": %s},\n' $tsf >> "$out" 30 else 31 printf '},\n' >> "$out" 32 fi 33 else 34 printf '},\n' >> "$out" 35 fi 36 done 37 printf '}\n\n' >> "$out" 38 } 39 40 printf '' > "$out" 41 42 do_all 1 "vcube_single_thread" 43 do_all 4 "vcube_4_threads" 44 do_all 16 "vcube_16_threads"