Resolving conflicts
authorHamed Gorjiara <hgorjiar@uci.edu>
Fri, 14 Dec 2018 23:48:48 +0000 (15:48 -0800)
committerHamed Gorjiara <hgorjiar@uci.edu>
Fri, 14 Dec 2018 23:48:48 +0000 (15:48 -0800)
1  2 
src/analyzer/tunerloganalyzer.py

@@@ -136,13 -130,12 +140,13 @@@ def analyzeLogs(file)
                loadTunerInfo(row, argprocess.getFolder()+"/tuner"+str(i)+"used")
                loadSolverTime(row, argprocess.getFolder()+"/log"+str(i))
                loadProblemName(row, argprocess.getFolder()+"/problem"+str(i))
-               dump(file, row)
+               data.append(dump(file, row))
                rows.append(row)
-       return rows
+       return rows, data
  
 -def tunerNumberAnalysis(file, rows):
 +def tunerCountAnalysis(file, rows):
        global TUNABLEHEADER
 +      global PROBLEMS
        tunercount = {}
        tunernumber = {}
        for row in rows:
                        tunernumber[mystr] += "-" + str(row["TUNERNUMBER"])
  
        problems = set(map(lambda x: x["PROBLEM"], rows))
-       print "Number of repititive tuners"
+       print ("Number of repititive tuners")
        for key in tunercount:
                if tunercount[key] > 1:
 -                      print (key + "(ids:" + tunernumber[key]  + ") = #" + str(tunercount[key]))
 +                      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 transformDataset(rows):
+       print(rows)
++
++
  def main():
+       global TUNABLEHEADER
        file = open("tuner.csv", "w")
-       rows = analyzeLogs(file)
+       rows, data = analyzeLogs(file)
 -      tunerNumberAnalysis(file, rows)
 +      tunerCountAnalysis(file, combineRowForEachTuner(rows) )
        file.close()
-       return
+       #transformDataset(data)
+       pl.plot(data, TUNABLEHEADER)
 -      return
++
  
  if __name__ == "__main__":
        main()