GaudiMP.GMPBase.Reader Class Reference
Inheritance diagram for GaudiMP.GMPBase.Reader:
Collaboration diagram for GaudiMP.GMPBase.Reader:

Public Member Functions

def __init__ (self, queues, events, params, subworkers)
 
def processConfiguration (self)
 
def DumpEvent (self)
 
def DoFirstEvent (self)
 
def Engine (self)
 
def __init__ (self, queues, events, params, subworkers)
 
def processConfiguration (self)
 
def DumpEvent (self)
 
def DoFirstEvent (self)
 
def Engine (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)
 
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

 evtMax
 
 nOut
 
 app
 
 currentEvent
 
 firstEvTime
 
 stat
 
 tTime
 
- 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 648 of file GMPBase.py.

Constructor & Destructor Documentation

def GaudiMP.GMPBase.Reader.__init__ (   self,
  queues,
  events,
  params,
  subworkers 
)

Definition at line 649 of file GMPBase.py.

649  def __init__( self, queues, events, params, subworkers ) :
650  GMPComponent.__init__(self, 'Reader', -1, queues, events, params, subworkers )
651 
def __init__(self, queues, events, params, subworkers)
Definition: GMPBase.py:649
def GaudiMP.GMPBase.Reader.__init__ (   self,
  queues,
  events,
  params,
  subworkers 
)

Definition at line 649 of file GMPBase.py.

649  def __init__( self, queues, events, params, subworkers ) :
650  GMPComponent.__init__(self, 'Reader', -1, queues, events, params, subworkers )
651 
def __init__(self, queues, events, params, subworkers)
Definition: GMPBase.py:649

Member Function Documentation

def GaudiMP.GMPBase.Reader.DoFirstEvent (   self)

Definition at line 671 of file GMPBase.py.

671  def DoFirstEvent( self ) :
672  # Do First Event ------------------------------------------------------
673  # Check Termination Criteria
674  startFirst = time.time()
675  self.log.info('Reader : First Event')
676  if self.nOut == self.evtMax :
677  self.log.info('evtMax( %i ) reached'%(self.evtMax))
678  self.lastEvent.set()
679  return SUCCESS
680  else :
681  # Continue to read, dump and send event
682  self.a.run(1)
683  if not bool(self.evt['/Event']) :
684  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
685  self.lastEvent.set()
686  return SUCCESS
687  else :
688  # Popluate TESSerializer list and send Event
689  if self.app == "Gauss":
690  lst = self.evt.getHistoNames()
691  else:
692  try :
693  lst = self.evt.getList()
694  if self.app == "DaVinci":
695  daqnode = self.evt.retrieveObject( '/Event/DAQ' ).registry()
696  setOwnership( daqnode, False )
697  self.evt.getList( daqnode, lst, daqnode.address().par() )
698  except :
699  self.log.critical('Reader could not acquire TES List!')
700  self.lastEvent.set()
701  return FAILURE
702  self.log.info('Reader : TES List : %i items'%(len(lst)))
703  for l in lst :
704  self.ts.addItem(l)
706  tb = self.TS.Dump( )
707  self.log.info('First Event Sent')
708  self.evcom.send( (self.currentEvent, tb) )
709  self.nOut += 1
710  self.eventLoopSyncer.set()
711  self.evt.clearStore( )
712  self.firstEvTime = time.time()-startFirst
713  return SUCCESS
714 
def DoFirstEvent(self)
Definition: GMPBase.py:671
def GaudiMP.GMPBase.Reader.DoFirstEvent (   self)

Definition at line 671 of file GMPBase.py.

671  def DoFirstEvent( self ) :
672  # Do First Event ------------------------------------------------------
673  # Check Termination Criteria
674  startFirst = time.time()
675  self.log.info('Reader : First Event')
676  if self.nOut == self.evtMax :
677  self.log.info('evtMax( %i ) reached'%(self.evtMax))
678  self.lastEvent.set()
679  return SUCCESS
680  else :
681  # Continue to read, dump and send event
682  self.a.run(1)
683  if not bool(self.evt['/Event']) :
684  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
685  self.lastEvent.set()
686  return SUCCESS
687  else :
688  # Popluate TESSerializer list and send Event
689  if self.app == "Gauss":
690  lst = self.evt.getHistoNames()
691  else:
692  try :
693  lst = self.evt.getList()
694  if self.app == "DaVinci":
695  daqnode = self.evt.retrieveObject( '/Event/DAQ' ).registry()
696  setOwnership( daqnode, False )
697  self.evt.getList( daqnode, lst, daqnode.address().par() )
698  except :
699  self.log.critical('Reader could not acquire TES List!')
700  self.lastEvent.set()
701  return FAILURE
702  self.log.info('Reader : TES List : %i items'%(len(lst)))
703  for l in lst :
704  self.ts.addItem(l)
706  tb = self.TS.Dump( )
707  self.log.info('First Event Sent')
708  self.evcom.send( (self.currentEvent, tb) )
709  self.nOut += 1
710  self.eventLoopSyncer.set()
711  self.evt.clearStore( )
712  self.firstEvTime = time.time()-startFirst
713  return SUCCESS
714 
def DoFirstEvent(self)
Definition: GMPBase.py:671
def GaudiMP.GMPBase.Reader.DumpEvent (   self)

Definition at line 664 of file GMPBase.py.

664  def DumpEvent( self ) :
665  tb = TBufferFile( TBuffer.kWrite )
666  # print '----Reader dumping Buffer!!!'
667  self.ts.dumpBuffer( tb )
668  # print '\tBuffer Dumped, size : %i'%( tb.Length() )
669  return tb
670 
def DumpEvent(self)
Definition: GMPBase.py:664
def GaudiMP.GMPBase.Reader.DumpEvent (   self)

Definition at line 664 of file GMPBase.py.

664  def DumpEvent( self ) :
665  tb = TBufferFile( TBuffer.kWrite )
666  # print '----Reader dumping Buffer!!!'
667  self.ts.dumpBuffer( tb )
668  # print '\tBuffer Dumped, size : %i'%( tb.Length() )
669  return tb
670 
def DumpEvent(self)
Definition: GMPBase.py:664
def GaudiMP.GMPBase.Reader.Engine (   self)

Definition at line 715 of file GMPBase.py.

715  def Engine( self ) :
716  # rename process
717  import os
718  import ctypes
719  libc = ctypes.CDLL('libc.so.6')
720  name = str(self.nodeType) + str(self.nodeID) + '\0'
721  libc.prctl(15,name,0,0,0)
722 
723 
724  startEngine = time.time()
725  self.log.name = 'Reader'
726  self.log.info('Reader Process starting')
727 
728  self.Initialize()
729 
730  # add the Histogram Collection Algorithm
731  self.a.addAlgorithm( CollectHistograms(self) )
732 
733  self.log.info('Reader Beginning Distribution')
734  sc = self.DoFirstEvent( )
735  if sc.isSuccess() :
736  self.log.info('Reader First Event OK')
737  else :
738  self.log.critical('Reader Failed on First Event')
739  self.stat = FAILURE
740 
741  # Do All Others -------------------------------------------------------
742  while True :
743  # Check Termination Criteria
744  if self.nOut == self.evtMax :
745  self.log.info('evtMax( %i ) reached'%(self.evtMax))
746  break
747  # Check Health
748  if not self.stat.isSuccess() :
749  self.log.critical( 'Reader is Damaged!' )
750  break
751  # Continue to read, dump and send event
752  t = time.time()
753  self.a.run(1)
754  self.rTime += (time.time()-t)
755  if not bool(self.evt['/Event']) :
756  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
757  break
758  self.currentEvent = self.getEventNumber( )
759  tb = self.TS.Dump( )
760  self.evcom.send( (self.currentEvent, tb) )
761  # clean up
762  self.nOut += 1
763  self.eventLoopSyncer.set()
764  self.evt.clearStore( )
765  self.log.info('Setting <Last> Event')
766  self.lastEvent.set()
767 
768  # Finalize
769  self.log.info( 'Reader : Event Distribution complete.' )
770  self.evcom.finalize()
771  self.Finalize()
772  self.tTime = time.time() - startEngine
773  self.Report()
774 
775 # =============================================================================
def DoFirstEvent(self)
Definition: GMPBase.py:671
def GaudiMP.GMPBase.Reader.Engine (   self)

Definition at line 715 of file GMPBase.py.

715  def Engine( self ) :
716  # rename process
717  import os
718  import ctypes
719  libc = ctypes.CDLL('libc.so.6')
720  name = str(self.nodeType) + str(self.nodeID) + '\0'
721  libc.prctl(15,name,0,0,0)
722 
723 
724  startEngine = time.time()
725  self.log.name = 'Reader'
726  self.log.info('Reader Process starting')
727 
728  self.Initialize()
729 
730  # add the Histogram Collection Algorithm
731  self.a.addAlgorithm( CollectHistograms(self) )
732 
733  self.log.info('Reader Beginning Distribution')
734  sc = self.DoFirstEvent( )
735  if sc.isSuccess() :
736  self.log.info('Reader First Event OK')
737  else :
738  self.log.critical('Reader Failed on First Event')
739  self.stat = FAILURE
740 
741  # Do All Others -------------------------------------------------------
742  while True :
743  # Check Termination Criteria
744  if self.nOut == self.evtMax :
745  self.log.info('evtMax( %i ) reached'%(self.evtMax))
746  break
747  # Check Health
748  if not self.stat.isSuccess() :
749  self.log.critical( 'Reader is Damaged!' )
750  break
751  # Continue to read, dump and send event
752  t = time.time()
753  self.a.run(1)
754  self.rTime += (time.time()-t)
755  if not bool(self.evt['/Event']) :
756  self.log.warning('No More Events! (So Far : %i)'%(self.nOut))
757  break
758  self.currentEvent = self.getEventNumber( )
759  tb = self.TS.Dump( )
760  self.evcom.send( (self.currentEvent, tb) )
761  # clean up
762  self.nOut += 1
763  self.eventLoopSyncer.set()
764  self.evt.clearStore( )
765  self.log.info('Setting <Last> Event')
766  self.lastEvent.set()
767 
768  # Finalize
769  self.log.info( 'Reader : Event Distribution complete.' )
770  self.evcom.finalize()
771  self.Finalize()
772  self.tTime = time.time() - startEngine
773  self.Report()
774 
775 # =============================================================================
def DoFirstEvent(self)
Definition: GMPBase.py:671
def GaudiMP.GMPBase.Reader.processConfiguration (   self)

Definition at line 652 of file GMPBase.py.

652  def processConfiguration( self ) :
653  # Reader :
654  # No algorithms
655  # No output
656  # No histos
657  self.config[ 'ApplicationMgr' ].TopAlg = []
658  self.config[ 'ApplicationMgr' ].OutStream = []
659  if "HistogramPersistencySvc" in self.config.keys() :
660  self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
661  self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
662  self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax
663 
def processConfiguration(self)
Definition: GMPBase.py:652
def GaudiMP.GMPBase.Reader.processConfiguration (   self)

Definition at line 652 of file GMPBase.py.

652  def processConfiguration( self ) :
653  # Reader :
654  # No algorithms
655  # No output
656  # No histos
657  self.config[ 'ApplicationMgr' ].TopAlg = []
658  self.config[ 'ApplicationMgr' ].OutStream = []
659  if "HistogramPersistencySvc" in self.config.keys() :
660  self.config[ 'HistogramPersistencySvc' ].OutputFile = ''
661  self.config['MessageSvc'].Format = '[Reader]% F%18W%S%7W%R%T %0W%M'
662  self.evtMax = self.config[ 'ApplicationMgr' ].EvtMax
663 
def processConfiguration(self)
Definition: GMPBase.py:652

Member Data Documentation

GaudiMP.GMPBase.Reader.app

Definition at line 689 of file GMPBase.py.

GaudiMP.GMPBase.Reader.currentEvent

Definition at line 705 of file GMPBase.py.

GaudiMP.GMPBase.Reader.evtMax

Definition at line 662 of file GMPBase.py.

GaudiMP.GMPBase.Reader.firstEvTime

Definition at line 712 of file GMPBase.py.

GaudiMP.GMPBase.Reader.nOut

Definition at line 676 of file GMPBase.py.

GaudiMP.GMPBase.Reader.stat

Definition at line 739 of file GMPBase.py.

GaudiMP.GMPBase.Reader.tTime

Definition at line 772 of file GMPBase.py.


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