model_print("Round %u of %u\n", r, budget);
for (uint i = 0; i < tuners.getSize(); i++){
TunerRecord *tuner = tuners.get(i);
+ bool isNew = true;
for (uint j = 0; j < problems.getSize(); j++){
Problem *problem = problems.get(j);
long long metric = tuner->getTime(problem);
tuner->setTime(problem, metric);
else
tuner->setTime(problem, -2);
- if(j == 0 && tunerExists(tuner->getTuner())){
+ if(tunerExists(tuner->getTuner())){
//Solving the first problem and noticing the tuner
//already exists
+ isNew = false;
break;
- } else if(j == 0 && !tunerExists(tuner->getTuner())){
- explored.push(tuner);
}
}
}
+ if(isNew){
+ explored.push(tuner);
+ }
+
}
uint tSize = tuners.getSize();
for (uint i = 0; i < tSize; i++) {
def getRunNumber(self):
return self.args.number[0]
+PROBLEMS = []
+
TUNABLEHEADER = ["DECOMPOSEORDER", "MUSTREACHGLOBAL", "MUSTREACHLOCAL", "MUSTREACHPRUNE", "OPTIMIZEORDERSTRUCTURE",
"ORDERINTEGERENCODING", "PREPROCESS", "NODEENCODING", "EDGEENCODING", "MUSTEDGEPRUNE", "ELEMENTOPT",
"ENCODINGGRAPHOPT", "ELEMENTOPTSETS", "PROXYVARIABLE", "MUSTVALUE", "NAIVEENCODER", "VARIABLEORDER",
row["EXECTIME"] = configs["EXECTIME"]
def loadProblemName(row,filename):
+ global PROBLEMS
with open(filename) as f:
- row["PROBLEM"] = f.readline().replace("\n","")
+ problem = f.readline().replace("\n","")
+ probNumber = int(f.readline())
+ if probNumber >= len(PROBLEMS):
+ PROBLEMS.insert(probNumber,problem)
+ elif PROBLEMS[probNumber] != problem:
+ PROBLEMS[probNumber] = problem
+ row["PROBLEM"] = problem
+
def loadTunerNumber(row, filename):
with open(filename) as f:
row["TUNERNUMBER"] = f.readline().replace("\n","")
def tunerCountAnalysis(file, rows):
global TUNABLEHEADER
+ global PROBLEMS
tunercount = {}
tunernumber = {}
for row in rows:
if tunercount[key] > 1:
print key + "(ids:" + tunernumber[key] + ") = #" + str(tunercount[key])
+def combineRowForEachTuner(rows):
+ global PROBLEMS
+ newRows = []
+ combined = None
+ for row in rows:
+ if row["PROBLEM"] == PROBLEMS[0]:
+ combined = row
+ for key in row:
+ if row[key]:
+ combined[key] = row[key]
+ if row["PROBLEM"] == PROBLEMS[len(PROBLEMS)-1]:
+ newRows.append(combined)
+ return newRows
def main():
file = open("tuner.csv", "w")
rows = analyzeLogs(file)
- tunerCountAnalysis(file, rows)
+ tunerCountAnalysis(file, combineRowForEachTuner(rows) )
file.close()
return