CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
TimeMemoryG4Info Namespace Reference

Functions

def customise
 

Function Documentation

def TimeMemoryG4Info.customise (   process)

Definition at line 2 of file TimeMemoryG4Info.py.

References mathSSE.return().

2 
3 def customise(process):
4 
5  #Adding SimpleMemoryCheck service:
6  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
7  ignoreTotal=cms.untracked.int32(1),
8  oncePerEventMode=cms.untracked.bool(True))
9  #Adding Timing service:
10  process.Timing=cms.Service("Timing")
11 
12  #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
13  #print process.MessageLogger.__dict__
14  process.MessageLogger.destinations=cms.untracked.vstring('cout'
15  ,'cerr'
16  ,'G4msg'
17  )
18  process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
19  ,'FwkReport'
20  ,'FwkSummary'
21  ,'Root_NoDictionary'
22  ,'TimeReport'
23  ,'TimeModule'
24  ,'TimeEvent'
25  ,'MemoryCheck'
26  ,'PhysicsList'
27  ,'G4cout'
28  ,'G4cerr'
29  )
30  #Configuring the G4msg.log output
31  process.MessageLogger.G4msg = cms.untracked.PSet(
32  noTimeStamps = cms.untracked.bool(True)
33  #First eliminate unneeded output
34  ,threshold = cms.untracked.string('INFO')
35  ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
36  ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
37  ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
38  ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
39  ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
40  ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
41  ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
42  ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
43  ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
44  #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
45  #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
46  #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
47  #
48  #Then add the wanted ones:
49  ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
50  ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
51  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
52  )
53 
54  #Add these 3 lines to put back the summary for timing information at the end of the logfile
55  #(needed for TimeReport report)
56  if hasattr(process,'options'):
57  process.options.wantSummary = cms.untracked.bool(True)
58  else:
59  process.options = cms.untracked.PSet(
60  wantSummary = cms.untracked.bool(True)
61  )
62 
63  return(process)
return((rh^lh)&mask)