4 import matplotlib.pyplot
as plt
7 logfile = open(filename)
11 for line
in logfile.readlines():
13 name = line.split(
"SUCCESS")[0]
14 runtime[name] = float(line.split(
"runtime of")[1] )
15 if name
in nOfInstances: number = nOfInstances[name]
17 nOfInstances[name] = number+1
22 x.append( runtime[name] )
23 y.append( nOfInstances[name] )
25 ax = fig.add_subplot(111)
28 plt.xlabel(
"Runtime (s)")
29 plt.ylabel(
"# instances")
30 plt.title(
"Requested algorithm instances with 10 events and 10 threads in parallel.")
31 plt.savefig(
"test.pdf")
36 name = name.rstrip(
".time")
37 threads, events, algos = name.split(
"_")[1:]
47 for filename
in os.listdir(path):
48 if filename.startswith(config)
and filename.endswith(
"time"):
49 ff = open( os.path.join(path,filename) )
50 time = ff.read().rstrip(
"\n")
52 timings.append(timing)
56 ax = fig.add_subplot(111)
59 for timing
in timings:
60 if timing.events == 1:
61 times.append(timing.time)
62 algos.append(timing.algos)
64 plt.xlabel(
"Max algos in parallel")
65 plt.ylabel(
"runtime (s)")
66 plt.title(
"Brunel / CPUCruncher profiling.")
68 plt.savefig(
"timing.pdf")
72 if __name__ ==
"__main__":
def instancesVsTime(filename)
def __init__(self, name, time)
def prepareTimingPlots(config="BrunelScenario", path="../options")