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 6 of file makePlots.py.

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

Definition at line 43 of file makePlots.py.

43 def prepareTimingPlots(config="BrunelScenario", path = "../options"):
44 
45  # first read all the timings
46  timings = []
47  for filename in os.listdir(path):
48  if filename.startswith(config) and filename.endswith("time"):
49  ff = open( os.path.join(path,filename) )
50  time = ff.read().rstrip("\n")
51  timing = TimingInfo(filename,time)
52  timings.append(timing)
53  # now prepare the various plots:
54  # o parallel algos vs. time (for fixed parallel events)
55  fig = plt.figure()
56  ax = fig.add_subplot(111)
57  times = []
58  algos = []
59  for timing in timings:
60  if timing.events == 1:
61  times.append(timing.time)
62  algos.append(timing.algos)
63  ax.plot(algos, times)
64  plt.xlabel("Max algos in parallel")
65  plt.ylabel("runtime (s)")
66  plt.title("Brunel / CPUCruncher profiling.")
67 
68  plt.savefig("timing.pdf")
69 
70 
def prepareTimingPlots(config="BrunelScenario", path="../options")
Definition: makePlots.py:43