3 #Terminate the script if even one command fails
9 PARAMETERS="384 448 512 576 640 704 768"
13 #Checking the number of
14 if [ "$#" -lt 1 ]; then
15 echo "Illegal number of argument"
16 echo "./bench.sh [NUMBER] [--csolver/--dump]"
22 for PAR in $PARAMETERS; do
24 for ((i=0; i<"$1"; i++)); do
25 echo "begin iteration: $i" >>$TEMP
26 if [ "$#" -eq 1 ]; then
28 ./run.sh nqueen $PAR >> $TEMP
30 DIFF=$(echo "$END - $START" | bc)
31 echo "Program Execution Time: $DIFF" >>$TEMP
33 if [ $2 = '--dump' ]; then
35 ./run.sh nqueen $PAR --dump >> $TEMP
37 DIFF=$(echo "$END - $START" | bc)
38 echo "Program Execution Time: $DIFF" >>$TEMP
41 elif [ $2 = '--csolver' ]; then
43 ./run.sh nqueen $PAR --csolver >> $TEMP
45 DIFF=$(echo "$END - $START" | bc)
46 echo "Program Execution Time: $DIFF" >>$TEMP
48 echo "Unknown command : " $2