| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Classes | Functions
makePlots Namespace Reference

## Classes
class | TimingInfo

## Functions
def | instancesVsTime (filename)
def | prepareTimingPlots (config="BrunelScenario", path="../options")

## Function Documentation

def makePlots.instancesVsTime | ( |  | filename | ) |

Definition at line 7 of file makePlots.py.

7 def instancesVsTime(filename):
8 logfile = open(filename)
9 nOfInstances = {}
10 runtime = {}
11 # extract all info
12 for line in logfile.readlines():
13 if "I ran" in line:
14 name = line.split("SUCCESS")[0]
15 runtime[name] = float(line.split("runtime of")[1])
16 if name in nOfInstances:
17 number = nOfInstances[name]
18 else:
19 number = 0
20 nOfInstances[name] = number + 1
21 # now sort it
22 x = []
23 y = []
24 for name in runtime:
25 x.append(runtime[name])
26 y.append(nOfInstances[name])
27 fig = plt.figure()
28 ax = fig.add_subplot(111)
29 yo = ax.scatter(x, y)
30 ax.grid(True)
31 plt.xlabel("Runtime (s)")
32 plt.ylabel("# instances")
33 plt.title(
34 "Requested algorithm instances with 10 events and 10 threads in parallel.")
35 plt.savefig("test.pdf")
36
37
makePlots.instancesVsTime
def instancesVsTime(filename)
Definition: makePlots.py:7

def makePlots.prepareTimingPlots | ( |  | config = `"BrunelScenario"`,
|  |  | path = `"../options"`
| ) |  |

Definition at line 48 of file makePlots.py.

48 def prepareTimingPlots(config="BrunelScenario", path="../options"):
49
50 # first read all the timings
51 timings = []
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")
56 timing = TimingInfo(filename, time)
57 timings.append(timing)
58 # now prepare the various plots:
59 # o parallel algos vs. time (for fixed parallel events)
60 fig = plt.figure()
61 ax = fig.add_subplot(111)
62 times = []
63 algos = []
64 for timing in timings:
65 if timing.events == 1:
66 times.append(timing.time)
67 algos.append(timing.algos)
68 ax.plot(algos, times)
69 plt.xlabel("Max algos in parallel")
70 plt.ylabel("runtime (s)")
71 plt.title("Brunel / CPUCruncher profiling.")
72
73 plt.savefig("timing.pdf")
74
75
makePlots.prepareTimingPlots
def prepareTimingPlots(config="BrunelScenario", path="../options")
Definition: makePlots.py:48
makePlots.TimingInfo
Definition: makePlots.py:38