read *all* the runs
authorDavid Kaufmann <astra@ionic.at>
Sun, 29 Jan 2012 11:54:33 +0000 (12:54 +0100)
committerDavid Kaufmann <astra@ionic.at>
Sun, 29 Jan 2012 11:54:33 +0000 (12:54 +0100)
prefix/parseDat.py
prefix/runAll.sh

index 0b3fa0e74256046b1bb45bf3c3073cc35390c6af..87af602ee6b2f067315d37eb887574b4e72db02b 100755 (executable)
@@ -1,44 +1,45 @@
 #!/usr/bin/env python2
 
-from optparse import OptionParser
-
-parser = OptionParser()
-parser.add_option("-i", "--infile", dest="infilename", help="read unparsed data from FILE", metavar="FILE", default="prefix.pre.dat")
-parser.add_option("-o", "--outfile", dest="outfilename", help="write parsed data to FILE.alg.dat", metavar="FILE", default="prefix")
-
-(options, args) = parser.parse_args()
-
-in_file = open(options.infilename, "r")
-
-algos = {
-               'datapar': [],
-               'hillis_sum': [],
-               'hillis_partial': [],
-               'seq': [],
-               'recurse': []
-               }
-
-text = in_file.read()
-lines = text.split("\n")
-for line in lines:
-       if line == "":
-               continue
-       elements = line.split(" ")
-       for elem in elements:
-               (key, value) = elem.split("=", 1)
-               if key == 'binname':
-                       (_, prog) = value.split("/", 1)
-               elif key == 'size':
-                       size = value
-               elif key == 'time':
-                       time = value
-       algos[prog].append({'size': size, 'time': time})
-
-in_file.close()
-
-for key in algos:
-       out_file = open("stats/"+options.outfilename+"."+key+".dat", "w")
-       for res in algos[key]:
-               out_file.write(res['size']+";"+res['time']+"\n")
-       out_file.close()
-
+import os
+
+statsdir = 'stats/raw/'
+
+runs = os.listdir(statsdir)
+#print runs
+
+bigrunlist = []
+for i in runs:
+       runfiles = os.listdir(statsdir+i)
+#      print runfiles
+       for file in runfiles:
+#              print "File: %s%s/%s" % (statsdir, i, file)
+               splitfilename = file.replace('hillis_', 'hillis-').split('_')
+               splitfilename[1] = splitfilename[1].replace('hillis-', 'hillis_')
+               dict = {}
+               dict['sched'] = splitfilename[0]
+               dict['algo'] = splitfilename[1]
+               dict['n'] = int(splitfilename[2].lstrip('n'))
+               fd = open(statsdir+i+'/'+file, "r")
+               fd_text = fd.read()
+               fd.close()
+               fd_lines = fd_text.split("\n")
+               for line in fd_lines:
+                       if line == "":
+                               continue
+                       elements = line.split(" ")
+                       for elem in elements:
+                               (key, value) = elem.split("=", 1)
+                               if key == 'binname':
+                                       (_, prog) = value.split("/", 1)
+                                       if prog != dict['algo']:
+                                               print "Failed: %s is not %s" % (prog, dict['algo'])
+                               elif key == 'size':
+                                       size = int(value)
+                                       if size != dict['n']:
+                                               print "Failed: %s is not %s" % (size, dict['nvalue'])
+                               elif key == 'time':
+                                       time = float(value)
+                       dict['time'] = time
+                       bigrunlist.append(dict)
+for i in bigrunlist:
+       print i
index 033849983782c5c9b98b83e3f3491b2f19f8aff5..92bcf2da83276008cf12ea24e133f8a0f136499c 100755 (executable)
@@ -20,7 +20,6 @@ RUNLIST="$(seq 0 250000 1000000) $(seq 0 2500000 10000000)"
 # $(seq 0 25000000 100000000)"
 
 #TODO: siehe oben
-rm -rf stats
 echo "STARTING: stats/raw/${STARTTS}"
 mkdir -p "stats/raw/${STARTTS}"