4 import matplotlib.pyplot
as plt
8 logfile = open(filename)
12 for line
in logfile.readlines():
14 name = line.split(
"SUCCESS")[0]
15 runtime[name] = float(line.split(
"runtime of")[1])
16 if name
in nOfInstances:
17 number = nOfInstances[name]
20 nOfInstances[name] = number + 1
25 x.append(runtime[name])
26 y.append(nOfInstances[name])
28 ax = fig.add_subplot(111)
31 plt.xlabel(
"Runtime (s)")
32 plt.ylabel(
"# instances")
34 "Requested algorithm instances with 10 events and 10 threads in parallel." 36 plt.savefig(
"test.pdf")
41 name = name.rstrip(
".time")
42 threads, events, algos = name.split(
"_")[1:]
53 for filename
in os.listdir(path):
54 if filename.startswith(config)
and filename.endswith(
"time"):
55 ff = open(os.path.join(path, filename))
56 time = ff.read().rstrip(
"\n")
58 timings.append(timing)
62 ax = fig.add_subplot(111)
65 for timing
in timings:
66 if timing.events == 1:
67 times.append(timing.time)
68 algos.append(timing.algos)
70 plt.xlabel(
"Max algos in parallel")
71 plt.ylabel(
"runtime (s)")
72 plt.title(
"Brunel / CPUCruncher profiling.")
74 plt.savefig(
"timing.pdf")
78 if __name__ ==
"__main__":
def instancesVsTime(filename)
def __init__(self, name, time)
def prepareTimingPlots(config="BrunelScenario", path="../options")