CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/Validation/Performance/python/TimeMemoryInfo.py

Go to the documentation of this file.
00001 #G.Benelli
00002 #This fragment is used to add the SimpleMemoryCheck
00003 #and Timing services output to the log for the Performance Suite profiling.
00004 #It is meant to be used with the cmsDriver.py option
00005 #--customise in the following fashion:
00006 #E.g.
00007 #cmsDriver.py MinBias.cfi -n 50 --step=GEN,SIM --customise=Validation/Performance/TimeMemoryInfo.py >& MinBias_GEN,SIM.log&
00008 #Note there is no need to specify the "python" directory in the path.
00009 
00010 import FWCore.ParameterSet.Config as cms
00011 def customise(process):
00012     #Adding SimpleMemoryCheck service:
00013     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
00014                                           ignoreTotal=cms.untracked.int32(1),
00015                                           oncePerEventMode=cms.untracked.bool(True))
00016     #Adding Timing service:
00017     process.Timing=cms.Service("Timing")
00018     
00019     #Add these 3 lines to put back the summary for timing information at the end of the logfile
00020     #(needed for TimeReport report)
00021     process.options = cms.untracked.PSet(
00022         wantSummary = cms.untracked.bool(True)
00023         )
00024 
00025     #Add the configuration for the Igprof running to dump profile snapshots:
00026     process.IgProfService = cms.Service("IgProfService",
00027         reportFirstEvent            = cms.untracked.int32(1),  #Dump first event for baseline studies
00028         reportEventInterval         = cms.untracked.int32( ((process.maxEvents.input.value()-1)/2) ), # dump in the middle of the run
00029         reportToFileAtPostEvent     = cms.untracked.string("| gzip -c > IgProf.%I.gz")
00030         )
00031     
00032     return(process)