The Gaudi Framework  v36r1 (3e2fb5a8)
makePlots Namespace Reference

Classes

class  TimingInfo
 

Functions

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

Function Documentation

◆ instancesVsTime()

def makePlots.instancesVsTime (   filename)

Definition at line 17 of file makePlots.py.

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

◆ prepareTimingPlots()

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

Definition at line 59 of file makePlots.py.

59 def prepareTimingPlots(config="BrunelScenario", path="../options"):
60 
61  # first read all the timings
62  timings = []
63  for filename in os.listdir(path):
64  if filename.startswith(config) and filename.endswith("time"):
65  ff = open(os.path.join(path, filename))
66  time = ff.read().rstrip("\n")
67  timing = TimingInfo(filename, time)
68  timings.append(timing)
69  # now prepare the various plots:
70  # o parallel algos vs. time (for fixed parallel events)
71  fig = plt.figure()
72  ax = fig.add_subplot(111)
73  times = []
74  algos = []
75  for timing in timings:
76  if timing.events == 1:
77  times.append(timing.time)
78  algos.append(timing.algos)
79  ax.plot(algos, times)
80  plt.xlabel("Max algos in parallel")
81  plt.ylabel("runtime (s)")
82  plt.title("Brunel / CPUCruncher profiling.")
83 
84  plt.savefig("timing.pdf")
85 
86 
makePlots.prepareTimingPlots
def prepareTimingPlots(config="BrunelScenario", path="../options")
Definition: makePlots.py:59
makePlots.instancesVsTime
def instancesVsTime(filename)
Definition: makePlots.py:17