CMS 3D CMS Logo

Classes | Functions | Variables

cmsPerfRegress Namespace Reference

Classes

class  EdmSizeErr
class  Error
class  PerfReportErr
class  SimpMemParseErr
class  TimingParseErr

Functions

def _main
def cmpCallgrindReport
def cmpEdmSizeReport
def cmpIgProfReport
def cmpSimpMemReport
def cmpTimingReport
def createROOT
 Create the root file to save the graphs in.
def createSimplMemGraphs
 Create simple memory check graphs.
def drawChanges
 Draw data differences (comparison between two data sets or releases) on a separate canvas.
def drawGraphs
 Draw superimposed graphs on a separate canvas.
def drawHistos
 Draw superimposed histograms on a separate canvas.
def drawMemChangeGraphs
 Draw the comparison graphs of two memory graphs.
def drawMemGraphs
 Draw two memory graphs superimposed on one another.
def get_max
 Get max value in data set.
def get_min
 Get min value in data set.
def getLimits
 Get limits to plot the graph.
def getMeanLines
 Plot the mean line on a graph.
def getMemDiff
 Produce the difference of two memory data sets.
def getMemOrigScale
def getNpoints
def getParameters
def getSimpleMemLogData
 Parse memory check data from log file.
def getTimingDiff
 Get the difference in timing data (for comparison of two releases)
def getTimingLogData
 Parse timing data from log file.
def getTwoGraphLimits
 Get limits for two graphs that will be superimposed upon one another.
def newGraphAndHisto
 Create a new timing graph and histogram.
def perfreport
def rmtree
def setBatch
 Setup PyRoot as a batch run.
def setupSuperimpose
 Setup graph information for one graph (no need to it on both if they are superimposed)
def ungzip
def ungzip2

Variables

list _cmsver = os.environ['CMSSW_VERSION']
tuple values_set = ('vsize','delta_vsize','rss','delta_rss')

Function Documentation

def cmsPerfRegress::_main ( ) [private]

Definition at line 1163 of file cmsPerfRegress.py.

01164            :
01165     outdir = os.getcwd()
01166     
01167     (file1,file2,secsperbin,reporttype,IgProfMemOptions)  = getParameters()
01168 
01169     try:
01170         if   reporttype == "timing":
01171             rootfilename = "timingrep-regression.root"
01172             cmpTimingReport(rootfilename ,outdir,file1,file2,secsperbin,True)
01173         elif reporttype == "simplememory":
01174             rootfilename = "simpmem-regression.root"
01175             cmpSimpMemReport(rootfilename,outdir,file1,file2,secsperbin,True)
01176         elif reporttype == "edmsize":
01177             cmpEdmSizeReport(outdir,file1,file2)
01178         elif reporttype == "callgrind":
01179             cmpCallgrindReport(outdir,file1,file2)
01180         elif reporttype == "igprof":
01181             cmpIgProfReport(outdir,file1,file2,IgProfMemOptions)            
01182     except TimingParseErr, detail:
01183         print "WARNING: Could not parse data from Timing report file %s; not performing regression" % detail.message
01184     except SimpMemParseErr, detail:
01185         print "WARNING: Could not parse data from Memory report file %s; not performing regression" % detail.message
01186     except PerfReportErr     , detail:
01187         print "WARNING: Could not parse data from Edm file %s; not performing regression" % detail.message
01188     except IOError, detail:
01189         print detail
01190     except OSError, detail:
01191         print detail

def cmsPerfRegress::cmpCallgrindReport (   outdir,
  file1,
  file2 
)

Definition at line 1160 of file cmsPerfRegress.py.

01161                                           :
01162     perfreport(2,file1,file2,outdir)

def cmsPerfRegress::cmpEdmSizeReport (   outdir,
  file1,
  file2 
)

Definition at line 1114 of file cmsPerfRegress.py.

01115                                         :
01116     perfreport(0,file1,file2,outdir)

def cmsPerfRegress::cmpIgProfReport (   outdir,
  file1,
  file2,
  IgProfMemOpt = "" 
)

Definition at line 1129 of file cmsPerfRegress.py.

01130                                                        :
01131     (tfile1, tfile2) = ("", "")
01132     try:
01133         # don't make temp files in /tmp because it's never bloody big enough
01134         (th1, tfile1) = tmp.mkstemp(prefix=os.path.join(outdir,"igprofRegressRep."))
01135         (th2, tfile2) = tmp.mkstemp(prefix=os.path.join(outdir,"igprofRegressRep."))
01136         os.close(th1)
01137         os.close(th2)
01138         os.remove(tfile1)
01139         os.remove(tfile2)
01140         ungzip2(file1,tfile1)
01141         ungzip2(file2,tfile2)        
01142 
01143         perfreport(1,tfile1,tfile2,outdir,IgProfMemOpt)
01144 
01145         os.remove(tfile1)
01146         os.remove(tfile2)
01147     except OSError, detail:
01148         raise PerfReportErr("WARNING: The OS returned the following error when comparing %s and %s\n%s" % (file1,file2,str(detail)))
01149         if os.path.exists(tfile1):
01150             os.remove(tfile1)
01151         if os.path.exists(tfile2):
01152             os.remove(tfile2)
01153     except IOError, detail:
01154         raise PerfReportErr("IOError: When comparing %s and %s using temporary files %s and %s. Error message:\n%s" % (file1,file2,tfile1,tfile2,str(detail)))
01155         if os.path.exists(tfile1):
01156             os.remove(tfile1)
01157         if os.path.exists(tfile2):
01158             os.remove(tfile2)        
01159 

def cmsPerfRegress::cmpSimpMemReport (   rootfilename,
  outdir,
  oldLogfile,
  newLogfile,
  startevt,
  batch = True,
  candle = "",
  prevrev = "" 
)

Definition at line 727 of file cmsPerfRegress.py.

00728                                                                                                         :
00729     if batch:
00730         setBatch()
00731     # the fundamental structure: the key is the evt number the value is a list containing
00732     # VSIZE deltaVSIZE RSS deltaRSS
00733     print "#####LOGFILES in cmsPErfRegress:"
00734     print oldLogfile
00735     print newLogfile
00736     try:
00737         info1 = getSimpleMemLogData(oldLogfile,startevt, candle)
00738         if len(info1) == 0:
00739             raise IndexError
00740     except IndexError:
00741         raise SimpMemParseErr(oldLogfile)
00742     except IOError:
00743         raise SimpMemParseErr(oldLogfile)        
00744     
00745     try:
00746         info2 = getSimpleMemLogData(newLogfile,startevt, candle)
00747         if len(info2) == 0:
00748             raise IndexError
00749     except IndexError:
00750         raise SimpMemParseErr(newLogfile)
00751     except IOError:
00752         raise SimpMemParseErr(newLogfile)        
00753     #print "DDDDD info1 %s"%info1 #Format is of the type:[('GEN,SIM', [(1, {'delta_vsize': 0.0, 'delta_rss': 0.0, 'vsize': 648.42600000000004, 'rss': 426.33199999999999}), (2,{...
00754     #print "DDDDD info2 %s"%info2
00755     canvases = []
00756     # skim the second entry when the event number is the same BUG!!!!!!!
00757     # i take elements in couples!
00758 
00759     candreg = re.compile("(.*)(?:\.log)")
00760     vsize_canvas = None
00761     rss_canvas = None
00762     i = 0
00763     firstRoot = True
00764     newrootfile = None
00765     #The following whileis confusing and not necessary info1 and info2 are supposed to only contain one set of simplememorycheck numbers
00766     #in a tuple as seen above ('GEN,SIM',[(event_number,{'delta_vsize': 0.0, etc
00767     #The data structure is questionable... but it is a remnant of past format of the log files I guess.
00768     #while ( i < len(info1) and i < len(info2)):
00769     #curinfo1 = info1[i]
00770     #curinfo2 = info2[i]
00771     (stepname1, data1) = info1[0]
00772     (stepname2, data2) = info2[0]
00773 
00774     #Again this is not necessary anymore...
00775     #if not stepname1 == stepname2:
00776     #print "WARNING: Could not compare %s step and %s step because they are not the same step" % (stepname1, stepname2)
00777     #        print " Searching for next occurence"
00778     #        x = 1
00779     #        if not (i + 1) > len(info1):
00780     #            found = False
00781     #            for info in info1[i + 1:]:
00782     #               (stepname,trash) = info
00783     #               if stepname == stepname2:
00784     #                    i += x
00785     #print " Next occurence found, skipping in-between steps"
00786     #                    assert i < len(info1)
00787     #                    found = True
00788     #                    break
00789     #                x += 1
00790     #            if found:
00791     #                continue
00792     #        print " No more occurences of this step, continuing" 
00793     #        i += 1
00794     #        continue
00795 
00796     #Not sure what this is for!
00797     #OK it was due to the bug of duplicated info in getSimpleMemLogData parsing!
00798     #No need!
00799     #(data1,npoints1) = getNpoints(data1)
00800     #(data2,npoints2) = getNpoints(data2)
00801     npoints1=len(data1)
00802     npoints2=len(data2)
00803     
00804     legs = []
00805     leg      = ROOT.TLegend(0.6,0.99,0.89,0.8)
00806     legs.append(leg)
00807     leg      = ROOT.TLegend(0.6,0.99,0.89,0.8)
00808     legs.append(leg)
00809     
00810     try:
00811         if len(data1) == 0:
00812             raise IndexError
00813         (vsize_graph1,
00814          vsize_lstevt1,
00815          vsize_peak1,
00816          vsize_minim1,
00817          rss_graph1,
00818          rss_lstevt1,
00819          rss_peak1,
00820          rss_minim1) = createSimplMemGraphs(data1,npoints1,0,legs,prevrev=prevrev)
00821         #candFilename = CandFname[candle]
00822         #outputdir = "%s_%s_SimpleMemReport" % (candFilename,stepname1)
00823         #outputdir = os.path.join(outdir,outputdir)
00824         #print "Graph1"
00825         #vsize_graph1.Print()
00826     except IndexError:
00827         raise SimpMemParseErr(oldLogfile)
00828     
00829     try:
00830         if len(data2) == 0:
00831             raise IndexError
00832         (vsize_graph2,
00833          vsize_lstevt2,
00834          vsize_peak2,
00835          vsize_minim2,
00836          rss_graph2,
00837          rss_lstevt2,
00838          rss_peak2,
00839          rss_minim2) = createSimplMemGraphs(data2,npoints2,1,legs,prevrev=prevrev)
00840         #candFilename = CandFname[candle]
00841         #outputdir = "%s_%s_SimpleMemReport" % (candFilename,stepname1)
00842         #outputdir = os.path.join(outdir,outputdir)
00843         #print "Graph2"
00844         #vsize_graph2.Print()#       os.path.join(outputdir,"vsize_graph2.gif"))
00845     except IndexError:
00846         raise SimpMemParseErr(newLogfile)  
00847     
00848     
00849     (vsize_lstevt, vsize_max_val, vsize_min_val) = getTwoGraphLimits(vsize_lstevt1, vsize_peak1, vsize_lstevt2, vsize_peak2, vsize_minim1, vsize_minim2)
00850     (rss_lstevt  , rss_max_val  , rss_min_val)   = getTwoGraphLimits(rss_lstevt1  , rss_peak1, rss_lstevt2  , rss_peak2, rss_minim1,   rss_minim2)    
00851     
00852     (vsize_min,vsize_max) = getMemOrigScale(vsize_minim1,vsize_minim2,vsize_peak1,vsize_peak2)
00853     (rss_min  ,rss_max  ) = getMemOrigScale(rss_minim1,rss_minim2,rss_peak1,rss_peak2)
00854     
00855     setupSuperimpose(vsize_graph1,
00856                      vsize_graph2,
00857                      vsize_lstevt,
00858                      0,
00859                      reporttype = 1,
00860                      title = "%s_vsize" % stepname1)
00861     setupSuperimpose(rss_graph1  ,
00862                      rss_graph2  ,
00863                      rss_lstevt  ,
00864                      0,
00865                      reporttype = 1,
00866                      title = "%s_rss"  %  stepname2)
00867     
00868     (vsizePerfDiffgraph, vsizeleg) = getMemDiff(data1,data2,npoints2,vsize_lstevt, (vsize_max - vsize_min), stepname1, rss=False)
00869     (rssPerfDiffgraph, rssleg)     = getMemDiff(data1,data2,npoints2,rss_lstevt  , (rss_max - rss_min)    , stepname1, rss=True )        
00870     
00871     vsize_canvas = drawMemGraphs(vsize_graph1, vsize_graph2, vsize_min_val, vsize_max_val, vsize_lstevt, legs[0], "vsize", stepname1)
00872     rss_canvas   = drawMemGraphs(rss_graph1  , rss_graph2  , rss_min_val, rss_max_val, rss_lstevt, legs[1], "rss"  , stepname1)
00873     vsize_change_canvas = drawMemChangeGraphs(vsizePerfDiffgraph, vsizeleg, "vsize", stepname1)         
00874     rss_change_canvas   = drawMemChangeGraphs(rssPerfDiffgraph  , rssleg  , "rss"  , stepname1)         
00875     
00876     if batch:
00877         
00878         
00879         logcandle = ""
00880         candname  = ""            
00881         found = candreg.search(os.path.basename(newLogfile))
00882         
00883         if found:
00884             logcandle = found.groups()[0]
00885             
00886         if   CandFname.has_key(candle):
00887             candFilename = CandFname[candle]
00888         elif CandFname.has_key(logcandle):
00889             candFilename = CandFname[logcandle]
00890         else:
00891             print "%s is an unknown candle!"%candle
00892             candFilename = "Unknown-candle"
00893             
00894         outputdir = "%s_%s_SimpleMemReport" % (candFilename,stepname1)
00895         outputdir = os.path.join(outdir,outputdir)
00896         
00897         if not os.path.exists(outputdir):
00898             os.mkdir(outputdir)
00899 
00900             #print the graphs as files :)
00901 
00902         newrootfile = createROOT(outputdir,rootfilename)                
00903         
00904         vsize_canvas.Print(       os.path.join(outputdir,"vsize_graphs.gif"), "gif")
00905         rss_canvas.Print(         os.path.join(outputdir,"rss_graphs.gif"  ), "gif")
00906         vsize_change_canvas.Print(os.path.join(outputdir,"vsize_change.gif"), "gif")
00907         rss_change_canvas.Print(  os.path.join(outputdir,"rss_change.gif"  ), "gif")
00908         # write it on file
00909         map(lambda x: x.Write(), [vsize_graph1,vsize_graph2, rss_graph1, rss_graph2, vsizePerfDiffgraph, rssPerfDiffgraph])
00910         map(lambda x: x.Write(), [vsize_canvas,rss_canvas,vsize_change_canvas,rss_change_canvas])
00911         newrootfile.Close()
00912     else:
00913         # we have to do this if we are running the application standalone
00914         # For some reason it will not draw some graphs at all if there is more than
00915         # one step.
00916         # If we wait between iterations of this loop the graphs will be drawn correctly.
00917         # Perhaps a graphics buffer problem with ROOT?
00918         # Perhaps a garbage collection problem in python? (Doubt it)
00919         canvases.append(rss_canvas)
00920         canvases.append(vsize_canvas)
00921         canvases.append(vsize_change_canvas)
00922         canvases.append(rss_change_canvas)            
00923         time.sleep(5.0)
00924 
00925     #Eliminated the while loop!    
00926     #i += 1
00927         
00928     #
00929     # Create a one dimensional function and draw it
00930     #
00931 
00932     if batch:
00933         pass
00934     else:
00935         if len(canvases) > 0:
00936             while reduce(lambda x,y: x or y ,canvases):
00937                 time.sleep(2.5)
00938     return 0            
00939         

def cmsPerfRegress::cmpTimingReport (   rootfilename,
  outdir,
  oldLogfile,
  newLogfile,
  secsperbin,
  batch = True,
  prevrev = "" 
)

Definition at line 940 of file cmsPerfRegress.py.

00941                                                                                                :
00942     if batch:
00943         setBatch()
00944     
00945     data1 = getTimingLogData(oldLogfile)
00946     data2 = getTimingLogData(newLogfile)        
00947         
00948     try:
00949         (min_val1,max_val1,nbins1,npoints1,last_event1) = getLimits(data1,secsperbin)
00950     except IndexError, detail:
00951         raise TimingParseErr(oldLogfile)
00952     
00953     try:
00954         (min_val2,max_val2,nbins2,npoints2,last_event2) = getLimits(data2,secsperbin)
00955     except IndexError, detail:
00956         raise TimingParseErr(newLogfile)
00957 
00958     hsStack  = ROOT.THStack("hsStack","Histogram Comparison")
00959     leg      = ROOT.TLegend(0.6,0.99,0.89,0.8)
00960     histoleg = ROOT.TLegend(0.5,0.8,0.89,0.89)    
00961 
00962     #
00963     
00964     (graph1,histo1,mean1) = newGraphAndHisto(histoleg,leg,npoints1,nbins1,min_val1,max_val1,data1,0,prevrev)
00965     hsStack.Add(histo1)
00966     (graph2,histo2,mean2) = newGraphAndHisto(histoleg,leg,npoints2,nbins2,min_val2,max_val2,data2,1,prevrev)
00967     hsStack.Add(histo2)
00968 
00969     (biggestLastEvt,biggestMaxval, trashthis) = getTwoGraphLimits(last_event1,max_val1,last_event2,max_val2,min_val1,min_val2)
00970     
00971     (changegraph,chgleg) = getTimingDiff(data1,data2,npoints2,biggestLastEvt,biggestMaxval)
00972     setupSuperimpose(graph1,graph2,biggestLastEvt,biggestMaxval)
00973     avg_line1 = getMeanLines(mean1,last_event1,0)
00974     avg_line2 = getMeanLines(mean2,last_event2,1)
00975 
00976     #
00977     # Create a one dimensional function and draw it
00978     #
00979     histo1.GetXaxis().SetTitle("s")            
00980     graph_canvas   = drawGraphs(graph1,graph2,avg_line1,avg_line2,leg)
00981     changes_canvas = drawChanges(changegraph,chgleg)
00982     histo_canvas   = drawHistos(hsStack,histoleg)
00983     
00984     newrootfile = None
00985     if batch:
00986 
00987         newrootfile = createROOT(outdir,rootfilename)      
00988 
00989         cput = ROOT.TTree()
00990         #  array(typecode, initializer)
00991         #  typecode is i for int, f for float etc.
00992         tot_a1 = array( "f", [ 0 ] )
00993         tot_a2 = array( "f", [ 0 ] )
00994 
00995         tot_a1[0] = mean1
00996         tot_a2[0] = mean2
00997 
00998         cput.Branch("total1",tot_a1,"total1/F")
00999         cput.Branch("total2",tot_a2,"total2/F")
01000         cput.Fill()
01001         cput.Write("cpu_time_tuple",ROOT.TObject.kOverwrite)
01002         
01003         names = ["graphs.gif","changes.gif","histos.gif"]
01004         
01005         graph_canvas.Print(  os.path.join(outdir,names[0]),"gif")
01006         changes_canvas.Print(os.path.join(outdir,names[1]),"gif")
01007         histo_canvas.Print(  os.path.join(outdir,names[2]),"gif")
01008         
01009         map(lambda x:x.Write(),[graph1,graph2,changegraph,hsStack,histo1,histo2])
01010         
01011         graph_canvas.Write()    # to file
01012         changes_canvas.Write()
01013         histo_canvas.Write() 
01014         newrootfile.Close()   
01015 
01016         return names
01017     else:
01018         
01019         while graph_canvas or histo_canvas or changes_canvas:
01020             time.sleep(2.5)
01021         return 0
    
def cmsPerfRegress::createROOT (   outdir,
  filename 
)

Create the root file to save the graphs in.

Definition at line 143 of file cmsPerfRegress.py.

00144                                :
00145 
00146     # Save in file
00147     rootfilename = os.path.join(outdir,filename)
00148     myfile = None
00149     exists = os.path.exists(rootfilename)
00150     if exists:
00151         myfile=ROOT.TFile(rootfilename,'UPDATE')
00152     else:
00153         myfile=ROOT.TFile(rootfilename,'RECREATE')        
00154     return myfile

def cmsPerfRegress::createSimplMemGraphs (   data,
  npoints,
  graph_num,
  legs,
  prevrev = "" 
)

Create simple memory check graphs.

Definition at line 547 of file cmsPerfRegress.py.

00548                                                                 :
00549     colors = [2,4]    
00550     values = ["vsize", "rss"]
00551     
00552     prevRevName = "???"
00553     if not prevrev == "":
00554         (head, tail) = os.path.split(prevrev)
00555         prevRevName  = os.path.basename(tail)
00556         
00557     releaseNames = ["Previous (%s)" % prevRevName,_cmsver]        
00558 
00559     #fill the graphs
00560     graphs = []
00561     minim  = -1
00562     peak   = -1
00563     peaks  = []
00564     minims = []
00565     idx = 0
00566     for value in values:
00567         leg = legs[idx]
00568 
00569         graph = ROOT.TGraph(npoints)
00570         graph.SetTitle(value)
00571         graph.SetLineColor(colors[graph_num])
00572         graph.SetMarkerStyle(8)
00573         graph.SetMarkerSize(.7)
00574         graph.SetMarkerColor(1)
00575         graph.SetLineWidth(3)
00576         graph.GetXaxis().SetTitle("Event")
00577         graph.GetYaxis().SetTitleOffset(1.3)
00578         graph.GetYaxis().SetTitle("MB")
00579 
00580         total = 0
00581         point_counter=0
00582         rms   = 0
00583         first = True
00584         for event_number,vals_dict in data:
00585             if first:
00586                 minim = vals_dict[value]
00587                 peak  = vals_dict[value]
00588                 first = False
00589             if vals_dict[value] > peak:
00590                 peak = vals_dict[value]
00591             if vals_dict[value] < minim:
00592                 minim = vals_dict[value]
00593             graph.SetPoint(point_counter, event_number, vals_dict[value])
00594             total += vals_dict[value]
00595             rms   += vals_dict[value] * vals_dict[value]
00596             point_counter+=1
00597 
00598         rms  = math.sqrt(rms / float(point_counter))
00599         mean = total / float(point_counter)
00600         last_event=data[-1][0]
00601         peaks.append(peak)
00602         minims.append(minim)
00603         graph.GetXaxis().SetRangeUser(0,last_event+1)
00604         leg.AddEntry(graph     , "%s release" % releaseNames[graph_num], "l")
00605         leg.AddEntry(graph     , "Mean: %s" % str(mean)                , "l")            
00606         leg.AddEntry(graph     , "RMS : %s" % str(rms)                 , "l")
00607         leg.AddEntry(graph     , "Peak: %s" % str(peak)                , "l")
00608         graphs.append(graph)
00609         idx += 1
00610 
00611     return (graphs[0] , last_event, peaks[0], minims[0], graphs[1], last_event, peaks[1], minims[1])

def cmsPerfRegress::drawChanges (   graph,
  chgleg 
)

Draw data differences (comparison between two data sets or releases) on a separate canvas.

Definition at line 490 of file cmsPerfRegress.py.

00491                              :
00492     graph_canvas = ROOT.TCanvas("change_canvas")
00493     graph_canvas.cd()
00494     graph.Draw("ALP")
00495     chgleg.Draw()
00496     return graph_canvas    

def cmsPerfRegress::drawGraphs (   graph1,
  graph2,
  avg1,
  avg2,
  leg 
)

Draw superimposed graphs on a separate canvas.

Definition at line 467 of file cmsPerfRegress.py.

00468                                            :
00469     graph_canvas = ROOT.TCanvas("graph_canvas")
00470     graph_canvas.cd()
00471     graph1.Draw("ALP")
00472     graph2.Draw("LP")
00473     avg1.Draw("Same")
00474     avg2.Draw("Same")
00475     leg.Draw()
00476     return graph_canvas

def cmsPerfRegress::drawHistos (   histo_stack,
  hstleg 
)

Draw superimposed histograms on a separate canvas.

Definition at line 480 of file cmsPerfRegress.py.

00481                                   :
00482     histo_canvas = ROOT.TCanvas("histo_canvas")
00483     histo_canvas.cd()
00484     histo_stack.Draw("nostack")
00485     hstleg.Draw()
00486     return histo_canvas

def cmsPerfRegress::drawMemChangeGraphs (   graph,
  leg,
  memtype,
  stepname 
)

Draw the comparison graphs of two memory graphs.

Definition at line 709 of file cmsPerfRegress.py.

00710                                                    :
00711     graph_canvas=ROOT.TCanvas("%s_%s_change_canvas" % (memtype,stepname))
00712     graph_canvas.cd()
00713     graph.Draw("ALP" )
00714     leg.Draw()    
00715     graph_canvas.ForceUpdate()
00716     graph_canvas.Flush()
00717     return graph_canvas

def cmsPerfRegress::drawMemGraphs (   graph1,
  graph2,
  min_val,
  max_val,
  last_event,
  leg,
  memtype,
  stepname 
)

Draw two memory graphs superimposed on one another.

Definition at line 694 of file cmsPerfRegress.py.

00695                                                                                 :
00696     graph_canvas=ROOT.TCanvas("%s_%s_canvas" % (memtype,stepname))
00697     graph_canvas.cd()
00698     graph1.GetYaxis().SetRangeUser(min_val,max_val)
00699     graph1.GetXaxis().SetRangeUser(0,last_event)        
00700     graph1.Draw("ALP")
00701     graph2.Draw("LP" )
00702     leg.Draw()    
00703     graph_canvas.ForceUpdate()
00704     graph_canvas.Flush()
00705     return graph_canvas

def cmsPerfRegress::get_max (   data,
  index = 1 
)

Get max value in data set.

Definition at line 108 of file cmsPerfRegress.py.

00109                          :
00110     max_time=-1
00111     for el in data:
00112         sec=el[index]
00113         if max_time<sec:
00114             max_time=sec
00115     return max_time

def cmsPerfRegress::get_min (   data,
  index = 1 
)

Get min value in data set.

Definition at line 119 of file cmsPerfRegress.py.

00120                          :
00121     min_time=1e20
00122     for el in data:
00123         sec=el[index]
00124         if min_time>sec:
00125             min_time=sec
00126     return min_time  

def cmsPerfRegress::getLimits (   data,
  secsperbin 
)

Get limits to plot the graph.

Definition at line 338 of file cmsPerfRegress.py.

00339                               :
00340     min_val=get_min(data,1)
00341     max_val=get_max(data,1)
00342     interval=int(max_val-min_val)
00343     
00344     min_val=min_val-interval*0.2
00345     max_val=max_val+interval*0.2
00346     interval=int(max_val-min_val)
00347     
00348     nbins=int(interval/secsperbin)
00349 
00350     npoints=len(data)
00351 
00352     last_event=data[-1][0]
00353 
00354     return (min_val,max_val,interval,npoints,last_event)

def cmsPerfRegress::getMeanLines (   avg,
  last_event,
  graph_num 
)

Plot the mean line on a graph.

Definition at line 387 of file cmsPerfRegress.py.

00388                                           :
00389     colors = [2,4]
00390     avg_line=ROOT.TLine(1,avg,last_event,avg)
00391     avg_line.SetLineColor(colors[graph_num])
00392     avg_line.SetLineWidth(2)
00393 
00394     return avg_line

def cmsPerfRegress::getMemDiff (   data1,
  data2,
  npoints,
  last_event,
  orig_max_val,
  stepname,
  rss = False 
)

Produce the difference of two memory data sets.

Definition at line 615 of file cmsPerfRegress.py.

00616                                                                               :
00617     data3 = []
00618     memtype = "vsize"
00619     if rss:
00620         memtype = "rss"
00621 
00622     graph=ROOT.TGraph(npoints)
00623     total = 0
00624     rms = 0
00625     evt_counter=0
00626     peak  = -1
00627     minum = -1
00628     first = True
00629     for x in range(len(data2)):
00630         try:
00631             (evtnum2,valdict2) = data2[x]
00632             (evtnum1,valdict1) = data1[x]
00633             if evtnum2 == evtnum1:
00634                 diffMBytes = valdict2[memtype] - valdict1[memtype]
00635 
00636                 if first:
00637                     peak  = diffMBytes
00638                     minum = diffMBytes
00639                     first = False
00640                 if diffMBytes > peak:
00641                     peak  = diffMBytes
00642                 if diffMBytes < minum:
00643                     minum = diffMBytes   
00644                 graph.SetPoint(evt_counter,evtnum2,diffMBytes)
00645                 evt_counter+=1
00646                 total += diffMBytes
00647                 rms += (diffMBytes * diffMBytes)
00648         except IndexError:
00649             pass
00650         except ValueError:
00651             pass
00652    
00653     mean  = total / evt_counter
00654     rms   = math.sqrt(rms / float(evt_counter))
00655         
00656     min_val  = minum
00657     max_val  = peak
00658     interval = int(max_val-min_val)
00659     
00660     min_val=min_val-interval*0.2
00661     max_val=max_val+interval*0.2
00662     interval=int(max_val-min_val)
00663     # Determine the max value to be something that makes the scale similar to what
00664     # the original graph had. Unless we can't seem the maximum value.
00665 
00666     new_max = min_val + orig_max_val
00667     if new_max < max_val:
00668         pass
00669     else :
00670         max_val = new_max
00671     
00672     graph.SetTitle("Change in %s memory usage for each event between revs for step %s" % (memtype,stepname))
00673     graph.SetName('MemoryUsagePerEvent')    
00674     graph.GetXaxis().SetTitle("Event Number")
00675     graph.GetYaxis().SetTitle("Change in memory usage between revs (MBs)")    
00676     graph.GetYaxis().SetTitleOffset(1.3)
00677     graph.SetLineColor(2)
00678     graph.SetMarkerStyle(8)
00679     graph.SetMarkerSize(.7)
00680     graph.SetMarkerColor(1)
00681     graph.SetLineWidth(3)    
00682     graph.GetXaxis().SetLimits(0,last_event)
00683     graph.GetYaxis().SetRangeUser(min_val,max_val)
00684     leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
00685     leg.AddEntry(graph, "Mean: %s" % str(mean), "l")            
00686     leg.AddEntry(graph, "RMS : %s" % str(rms) , "l")
00687     leg.AddEntry(graph, "Peak: %s" % str(peak), "l")
00688     leg.AddEntry(graph, "Trough: %s" % str(minum)  , "l")                    
00689 
00690     return (graph,leg)

def cmsPerfRegress::getMemOrigScale (   fst_min,
  snd_min,
  fst_max,
  snd_max 
)

Definition at line 718 of file cmsPerfRegress.py.

00719                                                     :
00720     minim = fst_min
00721     if snd_min < minim:
00722         minim = snd_min
00723     maxim = fst_max
00724     if snd_max > maxim:
00725         maxim = snd_max
00726     return (minim,maxim)
        
def cmsPerfRegress::getNpoints (   data)

Definition at line 513 of file cmsPerfRegress.py.

00514                     :
00515     new_data=[]
00516     try:
00517         #This was necessary due to a bug in the getSimpleMemLogData parsing!!! no more necessary!
00518         if data[0][0]==data[1][0]:
00519             print 'Two modules seem to have some output.\nCollapsing ...'
00520             i=0
00521             while True:
00522                 dataline1=data[i]
00523                 i+=1
00524                 dataline2=data[i]
00525                 new_eventnumber=dataline1[0]
00526                 new_vsize=dataline2[1]['vsize']
00527                 new_delta_vsize=dataline1[1]['delta_vsize']+dataline2[1]['delta_vsize']
00528                 new_rss=dataline2[1]['rss']
00529                 new_delta_rss=dataline1[1]['delta_rss']+dataline2[1]['delta_rss']
00530 
00531                 new_data.append((new_eventnumber,{'vsize':new_vsize,
00532                                                   'delta_vsize':new_delta_vsize,
00533                                                   'rss':new_rss,
00534                                                   'delta_rss':new_delta_rss}))
00535                 i+=1
00536                 if i==len(data): break
00537 
00538             data=new_data
00539             print 'Collapsing: Done!'        
00540     except IndexError:
00541         pass
00542 
00543     return (data,len(data))

def cmsPerfRegress::getParameters ( )

Definition at line 67 of file cmsPerfRegress.py.

Referenced by LMFUnique::setByID().

00068                    :
00069     parser = opt.OptionParser()
00070     #
00071     # Options
00072     #
00073     parser.add_option('-n',
00074                       type="int",
00075                       help='Number of secs per bin. Default is 1.' ,
00076                       default=1,
00077                       dest='startevt')
00078     parser.add_option('-t',
00079                       '--report-type',
00080                       type="choice",
00081                       choices= ("timing", "simplememory","edmsize","igprof","callgrind",""),
00082                       help='Type of report to perform regrssion on. Default is TimingReport.' ,
00083                       default="timing",
00084                       dest='reporttype')
00085     parser.add_option('-i',
00086                       '--IgProfMemOption',
00087                       type="choice",
00088                       choices= ("-y MEM_TOTAL", "-y MEM_LIVE",""),
00089                       help='Eventual IgProfMem counter to use for the regression. Default is no argument (IgProfPerf).' ,
00090                       default="",
00091                       dest='igprofmem')
00092     (options,args) = parser.parse_args()
00093     if len(args) < 2:
00094         parser.error("ERROR: Not enough arguments")
00095         sys.exit()
00096 
00097 
00098     path1 = os.path.abspath(args[0])
00099     path2 = os.path.abspath(args[1])    
00100     if os.path.exists(path1) and os.path.exists(path2):
00101         return (path1, path2, options.startevt, options.reporttype, options.igprofmem)
00102     else:
00103         print "Error: one of the paths does not exist"
00104         sys.exit()

def cmsPerfRegress::getSimpleMemLogData (   logfile_name,
  startevt,
  candle 
)

Parse memory check data from log file.

Definition at line 183 of file cmsPerfRegress.py.

00184                                                       :
00185     data=[]
00186     values_set=('vsize','delta_vsize','rss','delta_rss')
00187     
00188     # open file and read it and fill the structure!
00189     logfile=open(logfile_name,'r')
00190     logfile_lines=logfile.readlines()
00191     logfile.close()
00192     
00193     step = ""
00194     steps = []
00195     #print candle
00196     #print CandFname[candle]
00197     #Get the step from log filename:
00198 
00199     #Catching the case of command line use in which the candle is unknown (and the log name does not match the perfsuite naming convention
00200     if candle:
00201         stepreg = re.compile("%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],"TimingReport"))
00202     else:
00203         stepreg = re.compile("([^_]*(_PILEUP)?)_%s((.log)|(.gz))?"%"TimingReport")
00204         
00205     #print logfile_name
00206     found=stepreg.search(logfile_name)
00207     if found:
00208         step=found.groups()[0]
00209         print "Determined step from log filename to be %s"%step
00210     else:
00211         print "Could not determine step from log filename"
00212         
00213     #steps.append((step,data))
00214 
00215     #Rewriting the following code... what a mess!
00216     # we get the info we need!
00217     #i=0   
00218     #while i < len(logfile_lines):
00219         #line=logfile_lines[i]
00220         #Format has changed... we use the output of individual steps, so no need to read into the logfile to find which step we are
00221         #referring too (by the way it would not work now!)... the step info comes from the logfilename done above...
00222         #if "RelValreport" in line and "cmsDriver" in line and "step" in line:
00223         #    stepreg = re.compile("--step=([^ ]*)")
00224         #    found = stepreg.search(line)
00225         #    if found:
00226         #        if step == "":
00227         #            step = found.groups()[0]
00228         #        else:
00229         #            steps.append((step,data))
00230         #            step = found.groups()[0]
00231         #            data = []        
00232         #if '%MSG-w MemoryCheck:' in line:
00233         #    line=line[:-1] #no \n!
00234         #    line_content_list=line.split(' ')
00235         #    event_number=int(line_content_list[-1])
00236         #    if event_number<startevt:
00237         #        i+=1
00238         #        continue
00239         #    i+=1 # we inspect the following line
00240         #    try:
00241         #        line=logfile_lines[i]
00242         #    except IndexError:
00243         #        continue
00244         #    line=line[:-1] #no \n!
00245         #    line_content_list=line.split(' ')
00246         #    vsize=float(line_content_list[4])
00247         #    delta_vsize=float(line_content_list[5])
00248         #    rss=float(line_content_list[7])
00249         #    delta_rss=float(line_content_list[8])
00250         #    
00251         #    data.append((event_number,{'vsize':vsize,
00252         #                               'delta_vsize':delta_vsize,
00253         #                               'rss':rss,
00254         #                               'delta_rss':delta_rss}))
00255         #i += 1
00256     event_number= startevt
00257     for line in logfile_lines:
00258         #Match SimpleMemoryCheck output to get the event number
00259         if '%MSG-w MemoryCheck:' in line: #Harcoded based on format: %MSG-w MemoryCheck:  PostModule 12-Jan-2009 16:00:29 CET Run: 1 Event: 1
00260             tokens=line.split()
00261             if int(tokens[-1])>= startevt:
00262                 event_number=int(tokens[-1])
00263         if 'VSIZE' in line: #Harcoded based on format: MemoryCheck: event : VSIZE 648.426 0 RSS 426.332 0
00264             tokens=line.split()
00265             vsize=float(tokens[4])
00266             delta_vsize=float(tokens[5])
00267             rss=float(tokens[7])
00268             delta_rss=float(tokens[8])
00269             data.append((event_number,{'vsize':vsize,
00270                                        'delta_vsize':delta_vsize,
00271                                        'rss':rss,
00272                                        'delta_rss':delta_rss
00273                                        }
00274                          )
00275                         )
00276             
00277     if not len(data) == 0:
00278         #print "!!!!!!!!!!!!!Adding step %s and data!"%step
00279         steps.append((step,data))
00280 
00281     #print "PRINTOUT@@@@@@"
00282     #print steps
00283     return steps

def cmsPerfRegress::getTimingDiff (   data1,
  data2,
  npoints,
  last_event,
  orig_max_val 
)

Get the difference in timing data (for comparison of two releases)

Definition at line 398 of file cmsPerfRegress.py.

00399                                                               :
00400     data3 = []
00401     for x in range(len(data2)):
00402         try:
00403             if data2[x][0] == data1[x][0]:
00404                 avgEventNum = data2[x][0]
00405                 diffSecs    = data2[x][1] - data1[x][1]                
00406                 data3.append((avgEventNum,diffSecs))                
00407         except IndexError:
00408             pass
00409         except ValueError:
00410             pass
00411 
00412     graph=ROOT.TGraph(npoints)
00413 
00414     evt_counter=0
00415     peak = data3[0][1]
00416     for evt_num,secs in data3:
00417         if secs > peak:
00418             peak = secs
00419         graph.SetPoint(evt_counter,evt_num,secs)
00420         evt_counter+=1
00421 
00422     allsecs = []
00423     map(lambda x: allsecs.append(x[1]),data3)
00424     total = reduce(lambda x,y: x + y,allsecs)
00425     mean  = total / evt_counter
00426     rms   = math.sqrt(reduce(lambda x,y: x + y,map(lambda x: x * x,allsecs)) / evt_counter)
00427         
00428     min_val=get_min(data3,1)
00429     max_val=get_max(data3,1)
00430     interval=int(max_val-min_val)
00431     
00432     min_val=min_val-interval*0.2
00433     max_val=max_val+interval*0.2
00434     interval=int(max_val-min_val)
00435 
00436     # Determine the max value to be something that makes the scale similar to what
00437     # the original graph had. Unless we can't seem the maximum value.
00438 
00439     new_max = min_val + orig_max_val
00440     if new_max < max_val:
00441         pass
00442     else :
00443         max_val = new_max
00444     
00445     graph.SetTitle('Change in processing time for each event between revs')
00446     graph.SetName('SecondsPerEvent')    
00447     graph.GetXaxis().SetTitle("Event Number")
00448     graph.GetYaxis().SetTitle("Change in processing time between revs (s)")    
00449     graph.GetYaxis().SetTitleOffset(1.3)
00450     graph.SetLineColor(2)
00451     graph.SetMarkerStyle(8)
00452     graph.SetMarkerSize(.7)
00453     graph.SetMarkerColor(1)
00454     graph.SetLineWidth(3)        
00455     graph.GetXaxis().SetLimits(0,last_event)
00456     graph.GetYaxis().SetRangeUser(min_val,max_val)
00457     leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
00458     leg.AddEntry(graph, "Mean: %s" % str(mean), "l")            
00459     leg.AddEntry(graph, "RMS : %s" % str(rms) , "l")
00460     leg.AddEntry(graph, "Peak: %s" % str(peak), "l")
00461     leg.AddEntry(graph, "Total time change: %s" % str(total)  , "l")                    
00462 
00463     return (graph,leg)

def cmsPerfRegress::getTimingLogData (   logfile_name)

Parse timing data from log file.

Definition at line 158 of file cmsPerfRegress.py.

00159                                   :
00160     data=[]
00161     
00162     # open file and read it and fill the structure!
00163     logfile=open(logfile_name,'r')
00164     logfile_lines=logfile.readlines()
00165     logfile.close()
00166 
00167     # we get the info we need!
00168     i=0
00169     while i < len(logfile_lines):
00170         line=logfile_lines[i]
00171         if 'TimeEvent>' in line:
00172             line=line.strip()
00173             line_content_list = line.split(' ')[0:]
00174             event_number = int(line_content_list[1])
00175             seconds = float(line_content_list[3])
00176             data.append((event_number,seconds))
00177         i+=1
00178 
00179     return data

def cmsPerfRegress::getTwoGraphLimits (   last_event1,
  max_val1,
  last_event2,
  max_val2,
  min_val1 = -1,
  min_val2 = -1 
)

Get limits for two graphs that will be superimposed upon one another.

Definition at line 500 of file cmsPerfRegress.py.

00501                                                                                         :
00502     biggestLastEvt = last_event1
00503     biggestMaxval  = max_val1
00504     lowest_val     = min_val1
00505     
00506     if min_val2 < lowest_val:
00507         lowest_val = min_val2
00508     if last_event2 > biggestLastEvt:
00509         biggestLastEvt = last_event2
00510     if max_val2 > biggestMaxval:
00511         biggestMaxval  = max_val2
00512     return (biggestLastEvt,biggestMaxval,lowest_val)

def cmsPerfRegress::newGraphAndHisto (   histoleg,
  leg,
  npoints,
  nbins,
  min_val,
  max_val,
  data,
  graph_num,
  prevrev = "" 
)

Create a new timing graph and histogram.

Definition at line 288 of file cmsPerfRegress.py.

00289                                                                                           :
00290     
00291     colors = [2,4]
00292     prevRevName = "???"
00293     if not prevrev == "":
00294         (head, tail) = os.path.split(prevrev)
00295         prevRevName  = os.path.basename(tail)
00296     releaseNames = ["Previous (%s)" % prevRevName,_cmsver]
00297 
00298     histo=ROOT.TH1F("Seconds per event (histo: %s)" % graph_num,'Seconds per event',nbins,min_val,max_val)
00299 
00300     graph=ROOT.TGraph(npoints)
00301         
00302     evt_counter=0
00303     peak = data[0][1]
00304     for evt_num,secs in data:
00305         if secs > peak:
00306             peak = secs
00307         graph.SetPoint(evt_counter,evt_num,secs)
00308         histo.Fill(secs)        
00309         evt_counter+=1
00310 
00311     allsecs = []
00312     map(lambda x: allsecs.append(x[1]),data)
00313     total = reduce(lambda x,y: x + y,allsecs)
00314     mean  = total / evt_counter
00315     rms   = math.sqrt(reduce(lambda x,y: x + y,map(lambda x: x * x,allsecs)) / evt_counter)
00316                 
00317         
00318     graph.SetMarkerStyle(8)
00319     graph.SetMarkerSize(.7)
00320     graph.SetMarkerColor(1)
00321     graph.SetLineWidth(3)
00322     graph.SetLineColor(colors[graph_num]) # for each iterate through colors
00323     histo.SetLineColor(colors[graph_num])
00324     histo.SetStats(1)
00325     histoleg.AddEntry(histo, "%s release" % releaseNames[graph_num], "l")
00326     leg.AddEntry(graph     , "%s release" % releaseNames[graph_num], "l")
00327     leg.AddEntry(graph     , "Mean: %s" % str(mean)                , "l")            
00328     leg.AddEntry(graph     , "RMS : %s" % str(rms)                 , "l")
00329     leg.AddEntry(graph     , "Peak: %s" % str(peak)                , "l")
00330     leg.AddEntry(graph     , "Total time: %s" % str(total)         , "l")                    
00331     if graph_num == 0 :
00332         histo.SetFillColor(colors[graph_num])
00333 
00334     return (graph,histo,mean)

def cmsPerfRegress::perfreport (   perftype,
  file1,
  file2,
  outdir,
  IgProfMemopt = "" 
)

Definition at line 1046 of file cmsPerfRegress.py.

01047                                                            :
01048     src = ""
01049     try:
01050         src = os.environ["CMSSW_SEARCH_PATH"]
01051     except KeyError , detail:
01052         print "ERROR: scramv1 environment could not be located", detail 
01053 
01054     vars = src.split(":")
01055     loc  = vars[0]
01056 
01057     proftype = ""
01058     if   perftype == 0: # EdmSize
01059         proftype = "-fe"
01060     elif perftype == 1: # IgProf
01061         proftype = "-fi"
01062     else:               # Callgrind
01063         proftype = "-ff"
01064 
01065     cmssw_release_base = ""
01066     cmssw_data = ""
01067     try:
01068         cmssw_release_base = os.environ['CMSSW_RELEASE_BASE']
01069         cmssw_data = os.environ['CMSSW_DATA_PATH']
01070     except KeyError, detail:
01071         raise PerfReportErr
01072 
01073     xmlfile = os.path.join(cmssw_release_base,"src","Validation","Performance","doc","regress.xml")
01074 
01075     prRoot = "/afs/cern.ch/user/g/gbenelli/public/PerfReport2/2.0.1"
01076 
01077     # this might be useful at some point
01078     #cd %s ; eval `scramv1 runtime -csh`  ; source $CMSSW_DATA_PATH/perfreport/2.0.0/etc/profile.d/init.csh; cd - ; %s\"" % (loc,perfcmd)
01079 
01080     # Before adding Danilo's 2.1 we did this
01081     #perfcmd = "perfreport -tmp %s -i %s -r %s -o %s" % (proftype,file2,file1,outdir)    
01082     #cmd = "tcsh -c \"source %s/perfreport/2.0.0/etc/profile.d/init.csh; cd - ; %s\"" % (cmssw_data,perfcmd)
01083 
01084     # now we do
01085 
01086     tmpdir  = tmp.mkdtemp(prefix=os.path.join(outdir,"tmp"))
01087 
01088     perfcmd = "%s %s %s -c %s -t%s -i %s -r %s -o %s" % (os.path.join(prRoot,"bin","perfreport"),proftype,IgProfMemopt,xmlfile,tmpdir,file2,file1,outdir)            
01089     cmd     = "tcsh -c \"cd %s ; eval `scramv1 runtime -csh` ; cd - ;source %s/etc/profile.d/init.csh ; %s\"" % (loc,prRoot,perfcmd)
01090     #Obsolete popen4-> subprocess.Popen
01091     #process  = os.popen(cmd)
01092     process = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
01093     exitstat = process.wait()
01094     cmdout   = process.stdout.read()
01095     exitstat = process.returncode
01096 
01097     try:
01098         rmtree(tmpdir)        #Brute force solution rm -RF tmpdir done in rmtree()
01099         #os.rmdir(tmpdir)
01100     except IOError, detail:
01101         print "WARNING: Could not remove dir because IO%s" % detail                
01102     except OSError, detail:
01103         print "WARNING: Could not remove dir because %s" % detail                
01104 
01105     if True:
01106         print cmd
01107         print cmdout
01108 
01109     if not exitstat == None:
01110         sig     = exitstat >> 16    # Get the top 16 bits
01111         xstatus = exitstat & 0xffff # Mask out all bits except the bottom 16
01112         raise PerfReportErr("ERROR: PerfReport returned a non-zero exit status (%s, SIG_INT = %s) run %s. Dump follows: \n%s" % (perfcmd,xstatus,sig,cmdout))
01113     
    
def cmsPerfRegress::rmtree (   path)

Definition at line 1022 of file cmsPerfRegress.py.

01023                 :
01024     try:
01025         #os.remove(path)
01026         #Brute force solution:
01027         RemoveCmd="rm -Rf %s"%path
01028         os.system(RemoveCmd)
01029     except OSError, detail:
01030         if detail.errno == 39:
01031             try:
01032                 gen = os.walk(path)
01033                 nodes    = gen.next()
01034                 nodes[0] = par
01035                 nodes[1] = dirs
01036                 nodes[2] = files
01037                 for f in files:
01038                     os.remove(os.path.join(path,f))
01039                 for d in dirs:
01040                     rmtree(os.path.join(path,d))
01041             except OSError, detail:
01042                 print detail
01043             except IOError, detail:
01044                 print detail
01045             os.remove(path)

def cmsPerfRegress::setBatch ( )

Setup PyRoot as a batch run.

Definition at line 130 of file cmsPerfRegress.py.

00131               :
00132     __argv=sys.argv # trick for a strange behaviour of the TApp..
00133     sys.argv=sys.argv[:1]
00134     ROOT.gROOT.SetStyle("Plain") # style paranoia
00135     sys.argv=__argv
00136     #Cannot use this option when the logfile includes
00137     #a large number of events... PyRoot seg-faults.
00138     #Set ROOT in batch mode to avoid canvases popping up!
00139     ROOT.gROOT.SetBatch(1)

def cmsPerfRegress::setupSuperimpose (   graph1,
  graph2,
  last_event,
  max_val,
  reporttype = 0,
  title = "" 
)

Setup graph information for one graph (no need to it on both if they are superimposed)

Definition at line 358 of file cmsPerfRegress.py.

00359                                                                                :
00360     name   = ""
00361     xtitle = ""
00362     ytitle = ""
00363     if   reporttype == 0:
00364         title  = 'Seconds per event'
00365         name   = 'SecondsPerEvent'
00366         xtitle = "Event"
00367         ytitle = "Processing time for each event (s)"
00368         graph1.GetYaxis().SetRangeUser(0,max_val)
00369         graph2.GetYaxis().SetRangeUser(0,max_val)            
00370     elif reporttype == 1:
00371         name   = "%s_graph" % title
00372         xtitle = "Event"
00373         ytitle = "MB"
00374         
00375     graph1.SetTitle(title)
00376     graph1.SetName(name)
00377     graph1.GetXaxis().SetTitle(xtitle)
00378     graph1.GetYaxis().SetTitleOffset(1.3)
00379     graph1.GetYaxis().SetTitle(ytitle)
00380     graph1.GetXaxis().SetLimits(0,last_event)
00381     # Do I need to set limits on graph 2? I don't know
00382     # I'm doing it anyway, can't hurt.
00383     graph2.GetXaxis().SetLimits(0,last_event)

def cmsPerfRegress::ungzip (   inf,
  outh 
)

Definition at line 1117 of file cmsPerfRegress.py.

01118                     :
01119     gzf = gzip.open(inf,"r")
01120     print "ungzipping"
01121     for char in gzf:
01122         os.write(outh,char)
01123     os.close(outh)
01124     print "finish ungzipping"
01125     gzf.close()

def cmsPerfRegress::ungzip2 (   inf,
  out 
)

Definition at line 1126 of file cmsPerfRegress.py.

01127                     :
01128     os.system("gzip -c -d %s > %s" % (inf,out)) 


Variable Documentation

list cmsPerfRegress::_cmsver = os.environ['CMSSW_VERSION']

Definition at line 13 of file cmsPerfRegress.py.

tuple cmsPerfRegress::values_set = ('vsize','delta_vsize','rss','delta_rss')

Definition at line 14 of file cmsPerfRegress.py.