| The Gaudi Framework v27r1

- 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 775 of file GMPBase.py.

## Constructor & Destructor Documentation

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

Definition at line 776 of file GMPBase.py.

776 def __init__( self, workerID, queues, events, params, subworkers ) :
777 GMPComponent.__init__(self,'Worker', workerID, queues, events, params, subworkers )
778 # Identify the writer streams
779 self.writerDict = self.IdentifyWriters( )
780 # Identify the accept/veto checks for each event
781 self.acceptAlgs, self.requireAlgs, self.vetoAlgs = self.getCheckAlgs()
782 self.log.info("Subworker-%i Created OK"%(self.nodeID))
783 self.eventOutput = True
784
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:419
GaudiMP.GMPBase.Subworker.eventOutput
eventOutput
Definition: GMPBase.py:783
GaudiMP.GMPBase.GMPComponent.IdentifyWriters
def IdentifyWriters(self)
Definition: GMPBase.py:561
GaudiMP.GMPBase.Subworker.__init__
def __init__(self, workerID, queues, events, params, subworkers)
Definition: GMPBase.py:776
GaudiMP.GMPBase.Subworker.getCheckAlgs
def getCheckAlgs(self)
Definition: GMPBase.py:880
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:779
GaudiMP.GMPBase.Subworker.vetoAlgs
vetoAlgs
Definition: GMPBase.py:781

## Member Function Documentation

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

Definition at line 896 of file GMPBase.py.

896 def checkExecutedPassed( self, algName ) :
897 if self.a.algorithm( algName )._ialg.isExecuted()\
898 and self.a.algorithm( algName )._ialg.filterPassed() :
899 return True
900 else :
901 return False
902
GaudiMP.GMPBase.Subworker.checkExecutedPassed
def checkExecutedPassed(self, algName)
Definition: GMPBase.py:896

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

Definition at line 785 of file GMPBase.py.

785 def Engine( self ) :
786 # rename process
787 import os
788 import ctypes
789 libc = ctypes.CDLL('libc.so.6')
790 name = str(self.nodeType) + str(self.nodeID) + '\0'
791 libc.prctl(15,name,0,0,0)
792
793 self.initEvent.set()
794 startEngine = time.time()
795 msg = self.a.service('MessageSvc')
796 msg.Format = '[' + self.log.name + '] % F%18W%S%7W%R%T %0W%M'
797
798 self.log.name = "Worker-%i"%(self.nodeID)
799 self.log.info("Subworker %i starting Engine"%(self.nodeID))
800 self.filerecordsAgent = FileRecordsAgent(self)
801
802 # populate the TESSerializer itemlist
803 self.log.info('EVT WRITERS ON WORKER : %i'\
804 %( len(self.writerDict['events'])))
805
806 nEventWriters = len( self.writerDict[ "events" ] )
807 self.a.addAlgorithm( CollectHistograms(self) )
808
809 # Begin processing
810 Go = True
811 while Go :
812 packet = self.evcom.receive( )
813 if packet : pass
814 else : continue
815 if packet == 'FINISHED' : break
816 evtNumber, tbin = packet # unpack
817 if self.cntr != None:
818
819 self.cntr.setEventCounter( evtNumber )
820
821 self.nIn += 1
822 self.TS.Load( tbin )
823
824 t = time.time()
825 sc = self.a.executeEvent()
826 if self.nIn == 1 :
827 self.firstEvTime = time.time()-t
828 else :
829 self.rTime += (time.time()-t)
830 if sc.isSuccess() :
831 pass
832 else :
833 self.log.name = "Worker-%i"%(self.nodeID)
834 self.log.warning('Did not Execute Event')
835 self.evt.clearStore()
836 continue
837 if self.isEventPassed() :
838 pass
839 else :
840 self.log.name = "Worker-%i"%(self.nodeID)
841 self.log.warning( 'Event did not pass : %i'%(evtNumber) )
842 self.evt.clearStore()
843 continue
844 if self.eventOutput :
845 # It may be the case of generating Event Tags; hence
846 # no event output
847 self.currentEvent = self.getEventNumber( )
848 tb = self.TS.Dump( )
849 self.evcom.send( (self.currentEvent, tb) )
850 self.nOut += 1
851 self.inc.fireIncident(gbl.Incident('Subworker','EndEvent'))
852 self.eventLoopSyncer.set()
853 self.evt.clearStore( )
854 self.log.name = "Worker-%i"%(self.nodeID)
855 self.log.info('Setting <Last> Event %s' %(self.nodeID))
856 self.lastEvent.set()
857
858 self.evcom.finalize()
859 # Now send the FileRecords and stop/finalize the appMgr
860 self.filerecordsAgent.SendFileRecords()
861 self.tTime = time.time()-startEngine
862 self.Finalize()
863 self.Report()
864 #self.finalEvent.set()
865
GaudiMP.GMPBase.GMPComponent.tTime
tTime
Definition: GMPBase.py:473
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:419
GaudiMP.GMPBase.Subworker.eventOutput
eventOutput
Definition: GMPBase.py:783
GaudiMP.GMPBase.GMPComponent.Report
def Report(self)
Definition: GMPBase.py:631
GaudiMP.GMPBase.GMPComponent.nOut
nOut
Definition: GMPBase.py:459
GaudiMP.GMPBase.CollectHistograms
Definition: GMPBase.py:182
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:409
GaudiMP.GMPBase.GMPComponent.rTime
rTime
Definition: GMPBase.py:470
GaudiMP.GMPBase.Subworker.Engine
def Engine(self)
Definition: GMPBase.py:785
GaudiMP.GMPBase.GMPComponent.Finalize
def Finalize(self)
Definition: GMPBase.py:623
GaudiMP.GMPBase.GMPComponent.currentEvent
currentEvent
Definition: GMPBase.py:422
GaudiMP.GMPBase.Subworker.filerecordsAgent
filerecordsAgent
Definition: GMPBase.py:800
GaudiMP.GMPBase.GMPComponent.firstEvTime
firstEvTime
Definition: GMPBase.py:472
GaudiMP.GMPBase.Subworker.isEventPassed
def isEventPassed(self)
Definition: GMPBase.py:903
GaudiMP.GMPBase.GMPComponent.getEventNumber
def getEventNumber(self)
Definition: GMPBase.py:521
GaudiMP.GMPBase.GMPComponent.cntr
cntr
Definition: GMPBase.py:617
GaudiMP.GMPBase.GMPComponent.nIn
nIn
Definition: GMPBase.py:458
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:779
GaudiMP.pTools.FileRecordsAgent
Definition: pTools.py:206

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 880 of file GMPBase.py.

880 def getCheckAlgs( self ) :
881 '''
882 For some output writers, a check is performed to see if the event has
883 executed certain algorithms.
884 These reside in the AcceptAlgs property for those writers
885 '''
886 acc = []
887 req = []
888 vet = []
889 for m in self.writerDict[ "events" ] :
890 if hasattr(m.w, 'AcceptAlgs') : acc += m.w.AcceptAlgs
891 if hasattr(m.w, 'RequireAlgs') : req += m.w.RequireAlgs
892 if hasattr(m.w, 'VetoAlgs') : vet += m.w.VetoAlgs
893 return (acc, req, vet)
894
895
GaudiMP.GMPBase.Subworker.getCheckAlgs
def getCheckAlgs(self)
Definition: GMPBase.py:880
GaudiMP.GMPBase.Subworker.writerDict
writerDict
Definition: GMPBase.py:779

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 903 of file GMPBase.py.

903 def isEventPassed( self ) :
904 '''
905 Check the algorithm status for an event.
906 Depending on output writer settings, the event
907 may be declined based on various criteria.
908 This is a transcript of the check that occurs in GaudiSvc::OutputStream
909 '''
910 passed = False
911
912 self.log.debug('self.acceptAlgs is %s'%(str(self.acceptAlgs)))
913 if self.acceptAlgs :
914 for name in self.acceptAlgs :
915 if self.checkExecutedPassed( name ) :
916 passed = True
917 break
918 else :
919 passed = True
920
921 self.log.debug('self.requireAlgs is %s'%(str(self.requireAlgs)))
922 for name in self.requireAlgs :
923 if self.checkExecutedPassed( name ) :
924 pass
925 else :
926 self.log.info('Evt declined (requireAlgs) : %s'%(name) )
927 passed = False
928
929 self.log.debug('self.vetoAlgs is %s'%(str(self.vetoAlgs)))
930 for name in self.vetoAlgs :
931 if self.checkExecutedPassed( name ) :
932 pass
933 else :
934 self.log.info( 'Evt declined : (vetoAlgs) : %s'%(name) )
935 passed = False
936 return passed
937
938 # =============================================================================
GaudiMP.GMPBase.Subworker.checkExecutedPassed
def checkExecutedPassed(self, algName)
Definition: GMPBase.py:896
GaudiMP.GMPBase.Subworker.isEventPassed
def isEventPassed(self)
Definition: GMPBase.py:903
GaudiMP.GMPBase.Subworker.vetoAlgs
vetoAlgs
Definition: GMPBase.py:781

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

Definition at line 866 of file GMPBase.py.

866 def SetServices(self,a, evt, hvt, fsr, inc, pers, ts , cntr):
867 self.a = a
868 self.evt = evt
869 self.hvt = hvt
870 self.fsr = fsr
871 #self.inc = inc
872 self.inc = self.a.service('IncidentSvc','IIncidentSvc')
873 self.pers = pers
874 self.ts = ts
875 self.cntr = cntr
876 self.TS = TESSerializer( self.ts, self.evt,
877 self.nodeType, self.nodeID, self.log )
878
879
GaudiMP.GMPBase.GMPComponent.nodeID
nodeID
Definition: GMPBase.py:419
GaudiMP.GMPBase.TESSerializer
Definition: GMPBase.py:313
GaudiMP.GMPBase.GMPComponent.fsr
fsr
Definition: GMPBase.py:502
GaudiMP.GMPBase.GMPComponent.log
log
Definition: GMPBase.py:417
GaudiMP.GMPBase.GMPComponent.nodeType
nodeType
Definition: GMPBase.py:409
GaudiMP.GMPBase.GMPComponent.pers
pers
Definition: GMPBase.py:504
GaudiMP.GMPBase.GMPComponent.inc
inc
Definition: GMPBase.py:503
GaudiMP.GMPBase.GMPComponent.hvt
hvt
Definition: GMPBase.py:501
GaudiMP.GMPBase.GMPComponent.a
a
Definition: GMPBase.py:494
GaudiMP.GMPBase.GMPComponent.ts
ts
Definition: GMPBase.py:505
GaudiMP.GMPBase.Subworker.SetServices
def SetServices(self, a, evt, hvt, fsr, inc, pers, ts, cntr)
Definition: GMPBase.py:866
GaudiMP.GMPBase.GMPComponent.cntr
cntr
Definition: GMPBase.py:617
GaudiMP.GMPBase.GMPComponent.evt
evt
Definition: GMPBase.py:500
GaudiMP.GMPBase.GMPComponent.TS
TS
Definition: GMPBase.py:506

## Member Data Documentation

GaudiMP.GMPBase.Subworker.a

Definition at line 867 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.cntr

Definition at line 875 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.currentEvent

Definition at line 847 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.eventOutput

Definition at line 783 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.evt

Definition at line 868 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.filerecordsAgent

Definition at line 800 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.firstEvTime

Definition at line 827 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.fsr

Definition at line 870 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.hvt

Definition at line 869 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.inc

Definition at line 872 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.nIn

Definition at line 826 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.pers

Definition at line 873 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.ts

Definition at line 874 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.TS

Definition at line 876 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.tTime

Definition at line 861 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.vetoAlgs

Definition at line 781 of file GMPBase.py.

GaudiMP.GMPBase.Subworker.writerDict

Definition at line 779 of file GMPBase.py.

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

- GaudiMP/python/GaudiMP/GMPBase.py