Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / smt_LIA / lialogparse.py
diff --git a/JMCR-Stable/smt_LIA/lialogparse.py b/JMCR-Stable/smt_LIA/lialogparse.py
new file mode 100644 (file)
index 0000000..da4a752
--- /dev/null
@@ -0,0 +1,44 @@
+import os
+import sys
+import random
+import re
+import datetime
+import os
+
+#python parse.py account.log
+def analyzeExecution(myfile):
+       totaltime=[0.0, 0.0, 0.0, 0.0];
+       names = ['IDL', 'LIA', 'BV']
+       index =0;
+       with open(myfile, "r") as f:
+               line = f.readline()
+               while line:
+                       if '.smt' in line:
+                               print("Working on a new smt fie " + line);
+                               print(totaltime);
+                               index=0;
+                               #splitted = f.readline().split(' ')
+                               #date_time_str = splitted[0]+ " " + splitted[1]
+                               #date_time_start = datetime.datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')
+                               #f.readline()
+                       if 'real' in line:
+                               print("Parsing time " + line);
+                               splitted = line.split('\t')
+                               time = splitted[1].split("m")
+                               minute = int(time[0])
+                               second = float(time[1].split("s")[0])
+                               print(minute)
+                               print(second)
+                               totaltime[index] += 60*minute + second;
+                               index += 1;
+                       line = f.readline()
+       for i in range(len(names)):
+               print(names[i] + ":" + str(totaltime[i]));
+       #print("final result: " + str(totaltime))
+
+def main():
+       analyzeExecution(sys.argv[1])
+
+if __name__ == "__main__":
+    main()
+