CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TimeMemoryG4Info.py
Go to the documentation of this file.
1 #G.Benelli Dec 21 2007
2 #This fragment is used for the simulation (SIM) step
3 #It includes a MessageLogger tweak to dump G4msg.log
4 #in addition to the the SimpleMemoryCheck and Timing
5 #services output for the log used by the Performance Suite profiling.
6 #It is meant to be used with the cmsDriver.py option
7 #--customise in the following fashion:
8 #E.g.
9 #./cmsDriver.py MinBias.cfi -n 50 --step=GEN,SIM --customise=Validation/Performance/TimeMemoryG4Info.py >& MinBias_GEN,SIM.log&
10 #Note there is no need to specify the "python" directory in the path.
11 
12 
13 import FWCore.ParameterSet.Config as cms
14 def customise(process):
15  #Adding SimpleMemoryCheck service:
16  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
17  ignoreTotal=cms.untracked.int32(1),
18  oncePerEventMode=cms.untracked.bool(True))
19  #Adding Timing service:
20  process.Timing=cms.Service("Timing")
21 
22  #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
23  #print process.MessageLogger.__dict__
24  process.MessageLogger.destinations=cms.untracked.vstring('cout'
25  ,'cerr'
26  ,'G4msg'
27  )
28  process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
29  ,'FwkReport'
30  ,'FwkSummary'
31  ,'Root_NoDictionary'
32  ,'TimeReport'
33  ,'TimeModule'
34  ,'TimeEvent'
35  ,'MemoryCheck'
36  ,'PhysicsList'
37  ,'G4cout'
38  ,'G4cerr'
39  )
40  #Configuring the G4msg.log output
41  process.MessageLogger.G4msg = cms.untracked.PSet(
42  noTimeStamps = cms.untracked.bool(True)
43  #First eliminate unneeded output
44  ,threshold = cms.untracked.string('INFO')
45  ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
46  ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
47  ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
48  ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
49  ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
50  ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
51  ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
52  ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
53  ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
54  #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
55  #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
56  #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
57  #
58  #Then add the wanted ones:
59  ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
60  ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
61  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
62  )
63 
64  #Add these 3 lines to put back the summary for timing information at the end of the logfile
65  #(needed for TimeReport report)
66  process.options = cms.untracked.PSet(
67  wantSummary = cms.untracked.bool(True)
68  )
69 
70  #Add the configuration for the Igprof running to dump profile snapshots:
71  process.IgProfService = cms.Service("IgProfService",
72  reportFirstEvent = cms.untracked.int32(1), #Dump first event for baseline studies
73  reportEventInterval = cms.untracked.int32(50),#Dump every 50 events (51,101,151,201)->Will run 201 events for Step1, GEN-SIM,DIGI tests (5 profiles + end of job one)
74  reportToFileAtPostEvent = cms.untracked.string("| gzip -c > IgProf.%I.gz")
75  )
76 
77  return(process)
return((rh^lh)&mask)