6 Produces the backlog plot, parsing the output of the EventLoopManager. 7 Lines with the pattern "Event backlog" are looked for. 8 Events in flight are looked for as well. 18 Colors=[kBlue,kGreen+2]
19 MarkerStyles=[kOpenCircle,kFullCircle]
31 global NEventsInFlight
33 ifile = open(logfilename,
"r") 34 lines=ifile.readlines() 38 if "Event backlog" in line:
39 content.append( re.match(
".* \(max= ([0-9]*), min= ([0-9]*) \) = ([0-9]*).*",line).groups())
40 elif "Running with" in line:
41 NEventsInFlight,NThreads=
map(int, re.match(
".*Running with ([0-9]*).* ([0-9]*) threads",line).groups())
48 graph = TGraph(len(max_min_blog_vals))
50 for maxn,minn,blog
in max_min_blog_vals:
52 graph.SetPoint(counter,counter+1,float(blog))
57 graph.SetMarkerSize(MarkesSize)
58 graph.SetMarkerStyle(MarkerStyles[graphCounter])
59 graph.SetMarkerColor(Colors[graphCounter])
60 graph.SetLineWidth(LineWidth)
61 graph.SetLineColor(Colors[graphCounter])
62 graph.SetLineStyle(LineStyles[graphCounter])
69 global NEventsInFlight
71 graph.SetPoint(0,0.,float(NEventsInFlight))
72 graph.SetPoint(1,float(nevts)+1,float(NEventsInFlight))
73 graph.SetLineWidth(3 )
74 graph.SetLineColor(kRed)
76 graph.SetTitle(
"GaudiHive Backlog (Brunel, 100 evts);Events Finished;Event Backlog")
80 def getText(x,y,text,scale,angle,colour,font,NDC=False):
81 lat = TLatex(float(x),float(y),
82 "#scale[%s]{#color[%s]{#font[%s]{%s}}}"%(scale,colour,font,text))
86 lat.SetTextAngle(angle)
89 def doPlot(logfilename,logfilename_copy):
90 global NEventsInFlight
100 canvas= TCanvas (
"Backlog",
"Backlog",1100,900)
103 inFlightgraph.Draw(
"APL")
104 inFlightgraph.GetYaxis().SetRangeUser(0.,maxY*1.2)
105 inFlightgraph.GetXaxis().SetRangeUser(0.,float(n_vals+1))
107 graph_c.Draw(
"PLSame")
110 eventInFlightLabel=
getText(float(n_vals+1)*1.03,NEventsInFlight,
"#splitline{# Simultaneous}{ Events}",.6,270,2,12)
111 eventInFlightLabel.Draw()
112 nThreadsLabel=
getText(.15,.7,
"%s Threads"%NThreads,.6,0,2,12,
True)
116 legend = TLegend(.7,.75,.9,.9)
117 legend.SetFillColor(kWhite)
118 legend.SetHeader(
"Algo Management")
119 legend.AddEntry(graph,
"No Cloning",LegendDrawOpts)
120 legend.AddEntry(graph_c,
"Cloning enabled",LegendDrawOpts)
123 a= raw_input(
"press enter to continue")
125 canvas.Print(
"EventBacklog.png")
127 if __name__ ==
"__main__":
130 print "Usage: plotBacklogPyRoot.py logfilename logfilename_copy" 132 doPlot(sys.argv[1],sys.argv[2])
def getText(x, y, text, scale, angle, colour, font, NDC=False)
struct GAUDI_API map
Parametrisation class for map-like implementation.
def parseLog(logfilename)
def createInFlightGraph(nevts)
def doPlot(logfilename, logfilename_copy)
def createGraph(max_min_blog_vals)