|
def | __init__ (self, workerID, queues, events, params, subworkers) |
|
def | processConfiguration (self) |
|
def | Engine (self) |
|
def | getCheckAlgs (self) |
|
def | checkExecutedPassed (self, algName) |
|
def | isEventPassed (self) |
|
def | __init__ (self, nodeType, nodeID, queues, events, params, subworkers) |
|
def | Start (self) |
|
def | SetupGaudiPython (self) |
|
def | StartGaudiPython (self) |
|
def | LoadTES (self, tbufferfile) |
|
def | getEventNumber (self) |
|
def | IdentifyWriters (self) |
|
def | dumpHistograms (self) |
|
def | Initialize (self) |
|
def | Finalize (self) |
|
def | Report (self) |
|
Definition at line 996 of file GMPBase.py.
◆ __init__()
def GaudiMP.GMPBase.Worker.__init__ |
( |
|
self, |
|
|
|
workerID, |
|
|
|
queues, |
|
|
|
events, |
|
|
|
params, |
|
|
|
subworkers |
|
) |
| |
Definition at line 997 of file GMPBase.py.
997 def __init__(self, workerID, queues, events, params, subworkers):
998 GMPComponent.__init__(
999 self,
"Worker", workerID, queues, events, params, subworkers
1002 self.writerDict = self.IdentifyWriters()
1004 self.acceptAlgs, self.requireAlgs, self.vetoAlgs = self.getCheckAlgs()
1005 self.log.name =
"Worker-%i" % (self.nodeID)
1006 self.log.info(
"Worker-%i Created OK" % (self.nodeID))
1007 self.eventOutput =
True
◆ checkExecutedPassed()
def GaudiMP.GMPBase.Worker.checkExecutedPassed |
( |
|
self, |
|
|
|
algName |
|
) |
| |
Definition at line 1188 of file GMPBase.py.
1188 def checkExecutedPassed(self, algName):
1190 self.a.algorithm(algName)._ialg.isExecuted()
1191 and self.a.algorithm(algName)._ialg.filterPassed()
◆ Engine()
def GaudiMP.GMPBase.Worker.Engine |
( |
|
self | ) |
|
Reimplemented from GaudiMP.GMPBase.GMPComponent.
Definition at line 1049 of file GMPBase.py.
1053 libc = ctypes.CDLL(
"libc.so.6")
1054 name = str(self.nodeType) + str(self.nodeID) +
"\0"
1055 libc.prctl(15, ctypes.create_unicode_buffer(name), 0, 0, 0)
1057 startEngine = time.time()
1058 self.log.info(
"Worker %i starting Engine" % (self.nodeID))
1060 self.filerecordsAgent = FileRecordsAgent(self)
1063 self.log.info(
"EVT WRITERS ON WORKER : %i" % (len(self.writerDict[
"events"])))
1065 nEventWriters = len(self.writerDict[
"events"])
1069 for m
in self.writerDict[
"events"]:
1070 for item
in m.ItemList:
1071 hsh = item.find(
"#")
1075 for item
in m.OptItemList:
1076 hsh = item.find(
"#")
1079 optItemList.add(item)
1081 itemList -= optItemList
1082 for item
in sorted(itemList):
1083 self.log.info(
" adding ItemList Item to ts : %s" % (item))
1084 self.ts.addItem(item)
1085 for item
in sorted(optItemList):
1086 self.log.info(
" adding Optional Item to ts : %s" % (item))
1087 self.ts.addOptItem(item)
1089 self.log.info(
"There is no Event Output for this app")
1090 self.eventOutput =
False
1095 packet = self.evcom.receive()
1100 if packet ==
"FINISHED":
1102 evtNumber, tbin = packet
1103 if self.cntr != cppyy.nullptr:
1104 self.cntr.setEventCounter(evtNumber)
1108 self.log.info(
"Fork new subworkers")
1111 for k
in self.subworkers:
1123 self.a.addAlgorithm(CollectHistograms(self))
1130 self.firstEvTime = time.time() - t
1132 self.rTime += time.time() - t
1136 self.log.warning(
"Did not Execute Event")
1137 self.evt.clearStore()
1139 if self.isEventPassed():
1142 self.log.warning(
"Event did not pass : %i" % (evtNumber))
1143 self.evt.clearStore()
1145 if self.eventOutput:
1148 self.currentEvent = self.getEventNumber()
1150 self.evcom.send((self.currentEvent, tb))
1152 self.inc.fireIncident(gbl.Incident(
"Worker",
"EndEvent"))
1153 self.eventLoopSyncer.set()
1154 self.evt.clearStore()
1155 self.log.info(
"Setting <Last> Event")
1156 self.lastEvent.set()
1158 self.evcom.finalize()
1159 self.log.info(
"Worker-%i Finished Processing Events" % (self.nodeID))
1161 self.filerecordsAgent.SendFileRecords()
1163 self.tTime = time.time() - startEngine
1166 for k
in self.subworkers:
1167 self.log.info(
"Join subworkers")
◆ getCheckAlgs()
def GaudiMP.GMPBase.Worker.getCheckAlgs |
( |
|
self | ) |
|
For some output writers, a check is performed to see if the event has
executed certain algorithms.
These reside in the AcceptAlgs property for those writers
Definition at line 1170 of file GMPBase.py.
1170 def getCheckAlgs(self):
1172 For some output writers, a check is performed to see if the event has
1173 executed certain algorithms.
1174 These reside in the AcceptAlgs property for those writers
1179 for m
in self.writerDict[
"events"]:
1180 if hasattr(m.w,
"AcceptAlgs"):
1181 acc += m.w.AcceptAlgs
1182 if hasattr(m.w,
"RequireAlgs"):
1183 req += m.w.RequireAlgs
1184 if hasattr(m.w,
"VetoAlgs"):
1186 return (acc, req, vet)
◆ isEventPassed()
def GaudiMP.GMPBase.Worker.isEventPassed |
( |
|
self | ) |
|
Check the algorithm status for an event.
Depending on output writer settings, the event
may be declined based on various criteria.
This is a transcript of the check that occurs in GaudiSvc::OutputStream
Definition at line 1197 of file GMPBase.py.
1197 def isEventPassed(self):
1199 Check the algorithm status for an event.
1200 Depending on output writer settings, the event
1201 may be declined based on various criteria.
1202 This is a transcript of the check that occurs in GaudiSvc::OutputStream
1206 self.log.debug(
"self.acceptAlgs is %s" % (str(self.acceptAlgs)))
1208 for name
in self.acceptAlgs:
1209 if self.checkExecutedPassed(name):
1215 self.log.debug(
"self.requireAlgs is %s" % (str(self.requireAlgs)))
1216 for name
in self.requireAlgs:
1217 if self.checkExecutedPassed(name):
1220 self.log.info(
"Evt declined (requireAlgs) : %s" % (name))
1223 self.log.debug(
"self.vetoAlgs is %s" % (str(self.vetoAlgs)))
1224 for name
in self.vetoAlgs:
1225 if self.checkExecutedPassed(name):
1228 self.log.info(
"Evt declined : (vetoAlgs) : %s" % (name))
◆ processConfiguration()
def GaudiMP.GMPBase.Worker.processConfiguration |
( |
|
self | ) |
|
Reimplemented from GaudiMP.GMPBase.GMPComponent.
Definition at line 1009 of file GMPBase.py.
1009 def processConfiguration(self):
1014 self.config[
"EventSelector"].Input = []
1015 self.config[
"ApplicationMgr"].OutStream = []
1016 if "HistogramPersistencySvc" in self.config.
keys():
1017 self.config[
"HistogramPersistencySvc"].OutputFile =
""
1018 formatHead =
"[Worker-%i]" % (self.nodeID)
1019 self.config[
"MessageSvc"].Format =
"%-13s " % formatHead + self.msgFormat
1021 for key, lst
in self.writerDict.items():
1022 self.log.info(
"Writer Type : %s\t : %i" % (key, len(lst)))
1024 for m
in self.writerDict[
"tuples"]:
1027 newName = m.getNewName(
".",
".w%i." % (self.nodeID))
1028 self.config[m.key].Output = newName
1036 if self.app ==
"Gauss":
1038 if "ToolSvc.EvtCounter" not in self.config:
1039 from Configurables
import EvtCounter
1041 counter = EvtCounter()
1043 counter = self.config[
"ToolSvc.EvtCounter"]
1044 counter.UseIncident =
False
1047 self.log.warning(
"Cannot configure EvtCounter")
◆ app
GaudiMP.GMPBase.Worker.app |
◆ currentEvent
GaudiMP.GMPBase.Worker.currentEvent |
◆ eventOutput
GaudiMP.GMPBase.Worker.eventOutput |
◆ filerecordsAgent
GaudiMP.GMPBase.Worker.filerecordsAgent |
◆ firstEvTime
GaudiMP.GMPBase.Worker.firstEvTime |
◆ nIn
GaudiMP.GMPBase.Worker.nIn |
◆ tTime
GaudiMP.GMPBase.Worker.tTime |
◆ vetoAlgs
GaudiMP.GMPBase.Worker.vetoAlgs |
◆ writerDict
GaudiMP.GMPBase.Worker.writerDict |
The documentation for this class was generated from the following file: