CMS 3D CMS Logo

Functions

TimeMemoryG4Info Namespace Reference

Functions

def customise

Function Documentation

def TimeMemoryG4Info::customise (   process)

Definition at line 14 of file TimeMemoryG4Info.py.

00015                       :
00016     #Adding SimpleMemoryCheck service:
00017     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
00018                                           ignoreTotal=cms.untracked.int32(1),
00019                                           oncePerEventMode=cms.untracked.bool(True))
00020     #Adding Timing service:
00021     process.Timing=cms.Service("Timing")
00022     
00023     #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
00024     #print process.MessageLogger.__dict__
00025     process.MessageLogger.destinations=cms.untracked.vstring('cout'
00026                                                              ,'cerr'
00027                                                              ,'G4msg'
00028                                                              )
00029     process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
00030                                                            ,'FwkReport'
00031                                                            ,'FwkSummary'
00032                                                            ,'Root_NoDictionary'
00033                                                            ,'TimeReport'
00034                                                            ,'TimeModule'
00035                                                            ,'TimeEvent'
00036                                                            ,'MemoryCheck'
00037                                                            ,'PhysicsList'
00038                                                            ,'G4cout'
00039                                                            ,'G4cerr'
00040                                                            )
00041     #Configuring the G4msg.log output
00042     process.MessageLogger.G4msg =  cms.untracked.PSet(
00043         noTimeStamps = cms.untracked.bool(True)
00044         #First eliminate unneeded output
00045         ,threshold = cms.untracked.string('INFO')
00046         ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
00047         ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00048         ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00049         ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00050         ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
00051         ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00052         ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
00053         ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
00054         ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
00055         #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
00056         #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
00057         #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
00058         #
00059         #Then add the wanted ones:
00060         ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00061         ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00062         ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00063         )
00064 
00065     #Add these 3 lines to put back the summary for timing information at the end of the logfile
00066     #(needed for TimeReport report)
00067     process.options = cms.untracked.PSet(
00068         wantSummary = cms.untracked.bool(True)
00069         )
00070 
00071     #Add the configuration for the Igprof running to dump profile snapshots:
00072     process.IgProfService = cms.Service("IgProfService",
00073         reportFirstEvent            = cms.untracked.int32(1), #Dump first event for baseline studies
00074         reportEventInterval         = cms.untracked.int32( ( (process.maxEvents.input.value()-1)/2) ), # dump in the middle of the run
00075         reportToFileAtPostEvent     = cms.untracked.string("| gzip -c > IgProf.%I.gz")
00076         )
00077         
00078     return(process)