serializing the best tuners adding runbench.sh
authorHamed Gorjiara <hgorjiar@uci.edu>
Thu, 25 Oct 2018 06:52:08 +0000 (23:52 -0700)
committerHamed Gorjiara <hgorjiar@uci.edu>
Thu, 25 Oct 2018 06:52:08 +0000 (23:52 -0700)
deploy-cs.sh
src/Backend/satelemencoder.cc
src/Tuner/multituner.cc
src/learn.sh [deleted file]
src/runbench.sh [new file with mode: 0755]

index 0afc09b..899f6c5 100755 (executable)
@@ -4,7 +4,7 @@
 set -e
 
 BASE=../
-SERVERS="dc-4.calit2.uci.edu dc-5.calit2.uci.edu dc-7.calit2.uci.edu dc-8.calit2.uci.edu dc-9.calit2.uci.edu dc-10.calit2.uci.edu dc-11.calit2.uci.edu"
+SERVERS="dc-4.calit2.uci.edu dc-5.calit2.uci.edu dc-6.calit2.uci.edu dc-7.calit2.uci.edu dc-8.calit2.uci.edu dc-9.calit2.uci.edu dc-10.calit2.uci.edu dc-11.calit2.uci.edu"
 REMOTEDIR="/scratch/hamed/"
 INFILE="constraint_compiler/"
 SRC="constraint_compiler/src/"
index 3aa0927..3f26b5c 100644 (file)
@@ -297,7 +297,7 @@ void SATEncoder::generateAnyValueBinaryIndexEncoding(ElementEncoding *encoding)
        if (encoding->numVars == 0)
                return;
        int index = getMaximumUsedSize(encoding);
-       if ( index != encoding->encArraySize ) {
+       if ( index != (int)encoding->encArraySize ) {
                addConstraintCNF(cnf, generateLTValueConstraint(cnf, encoding->numVars, encoding->variables, index));
        }
        for (int i = index - 1; i >= 0; i--) {
index 206a62e..d8c8fb7 100644 (file)
@@ -111,6 +111,9 @@ void MultiTuner::findBestThreeTuners() {
        for (uint i = 0; i < 3; i++) {
                TunerRecord *tuner = bestTuners[i];
                SearchTuner *stun = tuner->getTuner();
+               char buffer[512];
+               snprintf(buffer, sizeof(buffer), "best%u.tuner", i);
+               stun->serialize(buffer);
                model_print("Tuner %u\n", tuner->tunernumber);
                stun->print();
                for (uint j = 0; j < tuner->problems.getSize(); j++) {
diff --git a/src/learn.sh b/src/learn.sh
deleted file mode 100755 (executable)
index 221fea5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-# run as the following:
-# ./learn.sh [hexiom]
-# ./learn.sh [nqueens]
-# ./learn.sh [sudoku-csolver]
-# ./learn.sh [killerSudoku]
-
-
-
-BIN=./bin
-DUMP=$(find . -name "*.dump")
-cd $BIN
-for d in $DUMP; do
-       if [[ $d = *$@* ]]; then
-               echo $d
-               ./run.sh deserializerautotune "."$d
-       fi
-done
diff --git a/src/runbench.sh b/src/runbench.sh
new file mode 100755 (executable)
index 0000000..1ffa118
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+# run as the following:
+# ./runbench.sh [hexiom] [timeout] [tuner.conf]
+# ./runbench.sh [nqueens] [timeout] [tuner.conf]
+# ./runbench.sh [sudoku-csolver] [timeout] [tuner.conf]
+# ./runbench.sh [killerSudoku] [timeout] [tuner.conf]
+
+if [ "$#" -lt 3 ]; then
+        echo "Illegal number of argument"
+        echo "./runbench.sh [benchmark] [timeout] [tuner.conf]"
+        exit 1
+fi
+
+
+BIN=./bin
+DUMP=$(find . -name "*.dump")
+cd $BIN
+for d in $DUMP; do
+       if [[ $d = *$1* ]]; then
+               echo $d
+               ./run.sh deserializerun "."$d $2 $3 out.out
+               echo "Best tuner"
+       fi
+done