--- /dev/null
+#!/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 1 ]; then
+ echo "Illegal number of argument"
+ echo "./runbench.sh [tuner.conf] [benchmark]"
+ exit 1
+fi
+
+SATUNE=/scratch/hamed/constraint_compiler/src
+BIN=$SATUNE/bin
+export CLASSPATH=$BIN/original.jar:$SATUNE:$CLASSPATH
+export LD_LIBRARY_PATH=$BIN
+# For Mac OSX
+export DYLD_LIBRARY_PATH=$BIN
+# For sat_solver
+export PATH=$SATUNE:$PATH
+
+
+maxtime=1800
+DUMPDIR=/scratch/hamed/end-to-end/dirk-new/dumps/
+cd $DUMPDIR
+
+DUMP=$(find . -name "*.dump")
+cd ..
+for d in $DUMP; do
+ if [[ $d = *$2* ]]; then
+ echo "Running: ./run.sh tunerrun "$DUMPDIR"$d $maxtime $1 out.out"
+ timeout $maxtime $BIN/tunerrun "$DUMPDIR"$d $maxtime $1 out.out
+ RETCODE=$?
+ echo "Return code: $RETCODE"
+ if [ $RETCODE -eq 141 ]; then #Dump info when SAT Solver gets killed by OS ....
+ echo "Satune got out of memory"
+ echo "deserializing $d ..."
+ echo "SAT Solving time: 400000000.0"
+ echo "CSOLVER solve time: 400000000.0"
+ fi
+ echo "Best tuner"
+ fi
+done
--- /dev/null
+import os
+import sys
+import random
+import re
+
+import os
+
+
+myfile = ''
+
+def validateArgs():
+ global myfile;
+ if len(sys.argv) != 2:
+ print("Wrong argument! Usage: python satunetimecomputer.py satune_trace.log");
+ sys.exit(-1);
+ else:
+ myfile = sys.argv[1];
+
+
+def analyzeExecution():
+ solving=0;
+ total=0;
+ print(myfile);
+ with open(myfile, "r") as f:
+ line = f.readline()
+ while line:
+ if 'SAT Solving time' in line:
+ time =re.findall("\d+\.\d+", line)
+ solving = solving + float(time[0]);
+ elif 'CSOLVER solve time' in line:
+ time =re.findall("\d+\.\d+", line);
+ total = total + float(time[0]);
+
+ line = f.readline()
+
+ print("Total SAT Solving Time: " + str(solving));
+ print("Total SATTune Time: " + str(total));
+
+def main():
+ validateArgs();
+ analyzeExecution();
+
+if __name__ == "__main__":
+ main();
+