From 18d01dc41a2e100108621914b459c3f7ed3a858e Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Sun, 29 Jan 2012 12:54:33 +0100 Subject: [PATCH] read *all* the runs --- prefix/parseDat.py | 85 +++++++++++++++++++++++----------------------- prefix/runAll.sh | 1 - 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/prefix/parseDat.py b/prefix/parseDat.py index 0b3fa0e..87af602 100755 --- a/prefix/parseDat.py +++ b/prefix/parseDat.py @@ -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 diff --git a/prefix/runAll.sh b/prefix/runAll.sh index 0338499..92bcf2d 100755 --- a/prefix/runAll.sh +++ b/prefix/runAll.sh @@ -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}" -- 2.43.0