| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
GaudiMP.GMPBase.Subworker Class Reference
Inheritance diagram for GaudiMP.GMPBase.Subworker:
[legend]
Collaboration diagram for GaudiMP.GMPBase.Subworker:
[legend]

## Public Member Functions
def | __init__ (self, workerID, queues, events, params, subworkers)
def | Engine (self)
def | SetServices (self, a, evt, hvt, fsr, inc, pers, ts, cntr)
def | getCheckAlgs (self)
def | checkExecutedPassed (self, algName)
def | isEventPassed (self)
Public Member Functions inherited from GaudiMP.GMPBase.GMPComponent
def | __init__ (self, nodeType, nodeID, queues, events, params, subworkers)
def | Start (self)
def | Engine (self)
def | processConfiguration (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)

## Public Attributes
| writerDict
| vetoAlgs
| eventOutput
| filerecordsAgent
| nIn
| firstEvTime
| currentEvent
| tTime
| a
| evt
| hvt
| fsr
| inc
| pers
| ts
| cntr
| TS
Public Attributes inherited from GaudiMP.GMPBase.GMPComponent
| nodeType
| finalEvent
| lastEvent
| log
| subworkers
| nodeID
| currentEvent
| queues
| num
| app
| evcom
| evcoms
| hq
| fq
| nIn
| nOut
| stat
| iTime
| rTime
| fTime
| firstEvTime
| tTime
| proc
| a
| evt
| hvt
| fsr
| inc
| pers
| ts
| TS
| cntr

## Detailed Description

Definition at line 801 of file GMPBase.py.

## Constructor & Destructor Documentation

def GaudiMP.GMPBase.Subworker.__init__ | ( |  | self,
|  |  | workerID,
|  |  | queues,
|  |  | events,
|  |  | params,
|  |  | subworkers
| ) |  |

Definition at line 802 of file GMPBase.py.

802 def __init__(self, workerID, queues, events, params, subworkers):
803 GMPComponent.__init__(self, 'Worker', workerID,
804 queues, events, params, subworkers)
805 # Identify the writer streams
806 self.writerDict = self.IdentifyWriters()
807 # Identify the accept/veto checks for each event
808 self.acceptAlgs, self.requireAlgs, self.vetoAlgs = self.getCheckAlgs()
809 self.log.info("Subworker-%i Created OK" % (self.nodeID))
810 self.eventOutput = True
811
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:440
GaudiMP.GMPBase.Subworker.eventOutput
eventOutput
Definition: GMPBase.py:810
GaudiMP.GMPBase.GMPComponent.IdentifyWriters
def IdentifyWriters(self)
Definition: GMPBase.py:580
GaudiMP.GMPBase.Subworker.__init__
def __init__(self, workerID, queues, events, params, subworkers)
Definition: GMPBase.py:802
GaudiMP.GMPBase.Subworker.getCheckAlgs
def getCheckAlgs(self)
Definition: GMPBase.py:909
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:806
GaudiMP.GMPBase.Subworker.vetoAlgs
vetoAlgs
Definition: GMPBase.py:808

## Member Function Documentation

def GaudiMP.GMPBase.Subworker.checkExecutedPassed | ( |  | self,
|  |  | algName
| ) |  |

Definition at line 927 of file GMPBase.py.

927 def checkExecutedPassed(self, algName):
928 if self.a.algorithm(algName)._ialg.isExecuted()\
929 and self.a.algorithm(algName)._ialg.filterPassed():
930 return True
931 else:
932 return False
933
GaudiMP.GMPBase.Subworker.checkExecutedPassed
def checkExecutedPassed(self, algName)
Definition: GMPBase.py:927

def GaudiMP.GMPBase.Subworker.Engine | ( |  | self | ) |

Definition at line 812 of file GMPBase.py.

812 def Engine(self):
813 # rename process
814 import os
815 import ctypes
816 libc = ctypes.CDLL('libc.so.6')
817 name = str(self.nodeType) + str(self.nodeID) + '\0'
818 libc.prctl(15, name, 0, 0, 0)
819
820 self.initEvent.set()
821 startEngine = time.time()
822 msg = self.a.service('MessageSvc')
823 msg.Format = '[' + self.log.name + '] % F%18W%S%7W%R%T %0W%M'
824
825 self.log.name = "Worker-%i" % (self.nodeID)
826 self.log.info("Subworker %i starting Engine" % (self.nodeID))
827 self.filerecordsAgent = FileRecordsAgent(self)
828
829 # populate the TESSerializer itemlist
830 self.log.info('EVT WRITERS ON WORKER : %i'
831 % (len(self.writerDict['events'])))
832
833 nEventWriters = len(self.writerDict["events"])
834 self.a.addAlgorithm(CollectHistograms(self))
835
836 # Begin processing
837 Go = True
838 while Go:
839 packet = self.evcom.receive()
840 if packet:
841 pass
842 else:
843 continue
844 if packet == 'FINISHED':
845 break
846 evtNumber, tbin = packet # unpack
847 if self.cntr != None:
848
849 self.cntr.setEventCounter(evtNumber)
850
851 self.nIn += 1
852 self.TS.Load(tbin)
853
854 t = time.time()
855 sc = self.a.executeEvent()
856 if self.nIn == 1:
857 self.firstEvTime = time.time() - t
858 else:
859 self.rTime += (time.time() - t)
860 if sc.isSuccess():
861 pass
862 else:
863 self.log.name = "Worker-%i" % (self.nodeID)
864 self.log.warning('Did not Execute Event')
865 self.evt.clearStore()
866 continue
867 if self.isEventPassed():
868 pass
869 else:
870 self.log.name = "Worker-%i" % (self.nodeID)
871 self.log.warning('Event did not pass : %i' % (evtNumber))
872 self.evt.clearStore()
873 continue
874 if self.eventOutput:
875 # It may be the case of generating Event Tags; hence
876 # no event output
877 self.currentEvent = self.getEventNumber()
878 tb = self.TS.Dump()
879 self.evcom.send((self.currentEvent, tb))
880 self.nOut += 1
881 self.inc.fireIncident(gbl.Incident('Subworker', 'EndEvent'))
882 self.eventLoopSyncer.set()
883 self.evt.clearStore()
884 self.log.name = "Worker-%i" % (self.nodeID)
885 self.log.info('Setting <Last> Event %s' % (self.nodeID))
886 self.lastEvent.set()
887
888 self.evcom.finalize()
889 # Now send the FileRecords and stop/finalize the appMgr
890 self.filerecordsAgent.SendFileRecords()
891 self.tTime = time.time() - startEngine
892 self.Finalize()
893 self.Report()
894 # self.finalEvent.set()
895
GaudiMP.GMPBase.GMPComponent.tTime
tTime
Definition: GMPBase.py:495
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:440
GaudiMP.GMPBase.Subworker.eventOutput
eventOutput
Definition: GMPBase.py:810
GaudiMP.GMPBase.GMPComponent.Report
def Report(self)
Definition: GMPBase.py:652
GaudiMP.GMPBase.GMPComponent.nOut
nOut
Definition: GMPBase.py:481
GaudiMP.GMPBase.CollectHistograms
Definition: GMPBase.py:187
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:430
GaudiMP.GMPBase.GMPComponent.rTime
rTime
Definition: GMPBase.py:492
GaudiMP.GMPBase.Subworker.Engine
def Engine(self)
Definition: GMPBase.py:812
GaudiMP.GMPBase.GMPComponent.Finalize
def Finalize(self)
Definition: GMPBase.py:644
GaudiMP.GMPBase.GMPComponent.currentEvent
currentEvent
Definition: GMPBase.py:443
GaudiMP.GMPBase.Subworker.filerecordsAgent
filerecordsAgent
Definition: GMPBase.py:827
GaudiMP.GMPBase.GMPComponent.firstEvTime
firstEvTime
Definition: GMPBase.py:494
GaudiMP.GMPBase.Subworker.isEventPassed
def isEventPassed(self)
Definition: GMPBase.py:934
GaudiMP.GMPBase.GMPComponent.getEventNumber
def getEventNumber(self)
Definition: GMPBase.py:540
GaudiMP.GMPBase.GMPComponent.cntr
cntr
Definition: GMPBase.py:638
GaudiMP.GMPBase.GMPComponent.nIn
nIn
Definition: GMPBase.py:480
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:806
GaudiMP.pTools.FileRecordsAgent
Definition: pTools.py:210

def GaudiMP.GMPBase.Subworker.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 909 of file GMPBase.py.

909 def getCheckAlgs(self):
910 '''
911 For some output writers, a check is performed to see if the event has
912 executed certain algorithms.
913 These reside in the AcceptAlgs property for those writers
914 '''
915 acc = []
916 req = []
917 vet = []
918 for m in self.writerDict["events"]:
919 if hasattr(m.w, 'AcceptAlgs'):
920 acc += m.w.AcceptAlgs
921 if hasattr(m.w, 'RequireAlgs'):
922 req += m.w.RequireAlgs
923 if hasattr(m.w, 'VetoAlgs'):
924 vet += m.w.VetoAlgs
925 return (acc, req, vet)
926
GaudiMP.GMPBase.Subworker.getCheckAlgs
def getCheckAlgs(self)
Definition: GMPBase.py:909
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:806

def GaudiMP.GMPBase.Subworker.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 934 of file GMPBase.py.

934 def isEventPassed(self):
935 '''
936 Check the algorithm status for an event.
937 Depending on output writer settings, the event
938 may be declined based on various criteria.
939 This is a transcript of the check that occurs in GaudiSvc::OutputStream
940 '''
941 passed = False
942
943 self.log.debug('self.acceptAlgs is %s' % (str(self.acceptAlgs)))
944 if self.acceptAlgs:
945 for name in self.acceptAlgs:
946 if self.checkExecutedPassed(name):
947 passed = True
948 break
949 else:
950 passed = True
951
952 self.log.debug('self.requireAlgs is %s' % (str(self.requireAlgs)))
953 for name in self.requireAlgs:
954 if self.checkExecutedPassed(name):
955 pass
956 else:
957 self.log.info('Evt declined (requireAlgs) : %s' % (name))
958 passed = False
959
960 self.log.debug('self.vetoAlgs is %s' % (str(self.vetoAlgs)))
961 for name in self.vetoAlgs:
962 if self.checkExecutedPassed(name):
963 pass
964 else:
965 self.log.info('Evt declined : (vetoAlgs) : %s' % (name))
966 passed = False
967 return passed
968
969 # =============================================================================
970
971
GaudiMP.GMPBase.Subworker.checkExecutedPassed
def checkExecutedPassed(self, algName)
Definition: GMPBase.py:927
GaudiMP.GMPBase.Subworker.isEventPassed
def isEventPassed(self)
Definition: GMPBase.py:934
GaudiMP.GMPBase.Subworker.vetoAlgs
vetoAlgs
Definition: GMPBase.py:808

def GaudiMP.GMPBase.Subworker.SetServices | ( |  | self,
|  |  | a,
|  |  | evt,
|  |  | hvt,
|  |  | fsr,
|  |  | inc,
|  |  | pers,
|  |  | ts,
|  |  | cntr
| ) |  |

Definition at line 896 of file GMPBase.py.

896 def SetServices(self, a, evt, hvt, fsr, inc, pers, ts, cntr):
897 self.a = a
898 self.evt = evt
899 self.hvt = hvt
900 self.fsr = fsr
901 #self.inc = inc
902 self.inc = self.a.service('IncidentSvc', 'IIncidentSvc')
903 self.pers = pers
904 self.ts = ts
905 self.cntr = cntr
906 self.TS = TESSerializer(self.ts, self.evt,
907 self.nodeType, self.nodeID, self.log)
908
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:440
GaudiMP.GMPBase.TESSerializer
Definition: GMPBase.py:330
GaudiMP.GMPBase.GMPComponent.fsr
fsr
Definition: GMPBase.py:521
GaudiMP.GMPBase.GMPComponent.log
log
Definition: GMPBase.py:438
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:430
GaudiMP.GMPBase.GMPComponent.pers
pers
Definition: GMPBase.py:523
GaudiMP.GMPBase.GMPComponent.inc
inc
Definition: GMPBase.py:522
GaudiMP.GMPBase.GMPComponent.hvt
hvt
Definition: GMPBase.py:520
GaudiMP.GMPBase.GMPComponent.a
a
Definition: GMPBase.py:513
GaudiMP.GMPBase.GMPComponent.ts
ts
Definition: GMPBase.py:524
GaudiMP.GMPBase.Subworker.SetServices
def SetServices(self, a, evt, hvt, fsr, inc, pers, ts, cntr)
Definition: GMPBase.py:896
GaudiMP.GMPBase.GMPComponent.cntr
cntr
Definition: GMPBase.py:638
GaudiMP.GMPBase.GMPComponent.evt
evt
Definition: GMPBase.py:519
GaudiMP.GMPBase.GMPComponent.TS
TS
Definition: GMPBase.py:525

## Member Data Documentation

GaudiMP.GMPBase.Subworker.a

Definition at line 897 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.cntr

Definition at line 905 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.currentEvent

Definition at line 877 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.eventOutput

Definition at line 810 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.evt

Definition at line 898 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.filerecordsAgent

Definition at line 827 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.firstEvTime

Definition at line 857 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.fsr

Definition at line 900 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.hvt

Definition at line 899 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.inc

Definition at line 902 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.nIn

Definition at line 856 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.pers

Definition at line 903 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.ts

Definition at line 904 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.TS

Definition at line 906 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.tTime

Definition at line 891 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.vetoAlgs

Definition at line 808 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.writerDict

Definition at line 806 of file GMPBase.py.

The documentation for this class was generated from the following file:

- GaudiMP/python/GaudiMP/GMPBase.py