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.")
35 plt.savefig(
"test.pdf")
40 name = name.rstrip(
".time")
41 threads, events, algos = name.split(
"_")[1:]
52 for filename
in os.listdir(path):
53 if filename.startswith(config)
and filename.endswith(
"time"):
54 ff = open(os.path.join(path, filename))
55 time = ff.read().rstrip(
"\n")
57 timings.append(timing)
61 ax = fig.add_subplot(111)
64 for timing
in timings:
65 if timing.events == 1:
66 times.append(timing.time)
67 algos.append(timing.algos)
69 plt.xlabel(
"Max algos in parallel")
70 plt.ylabel(
"runtime (s)")
71 plt.title(
"Brunel / CPUCruncher profiling.")
73 plt.savefig(
"timing.pdf")
77 if __name__ ==
"__main__":
def instancesVsTime(filename)
def __init__(self, name, time)
def prepareTimingPlots(config="BrunelScenario", path="../options")