16 import matplotlib.pyplot
as plt
20 logfile = open(filename)
24 for line
in logfile.readlines():
26 name = line.split(
"SUCCESS")[0]
27 runtime[name] = float(line.split(
"runtime of")[1])
28 if name
in nOfInstances:
29 number = nOfInstances[name]
32 nOfInstances[name] = number + 1
37 x.append(runtime[name])
38 y.append(nOfInstances[name])
40 ax = fig.add_subplot(111)
43 plt.xlabel(
"Runtime (s)")
44 plt.ylabel(
"# instances")
46 "Requested algorithm instances with 10 events and 10 threads in parallel."
48 plt.savefig(
"test.pdf")
53 name = name.rstrip(
".time")
54 threads, events, algos = name.split(
"_")[1:]
64 for filename
in os.listdir(path):
65 if filename.startswith(config)
and filename.endswith(
"time"):
66 ff = open(os.path.join(path, filename))
67 time = ff.read().rstrip(
"\n")
69 timings.append(timing)
73 ax = fig.add_subplot(111)
76 for timing
in timings:
77 if timing.events == 1:
78 times.append(timing.time)
79 algos.append(timing.algos)
81 plt.xlabel(
"Max algos in parallel")
82 plt.ylabel(
"runtime (s)")
83 plt.title(
"Brunel / CPUCruncher profiling.")
85 plt.savefig(
"timing.pdf")
89 if __name__ ==
"__main__":