| # Gaudi Framework, version v21r7p1 |

Home |  | Generated: 15 Feb 2010

# GaudiPython::Parallel::Reader Class Reference

List of all members.

## Public Member Functions
def | __init__
def | readerConfig
def | read
## Public Attributes
| inq
| c
| commonQ
| cstatq
| workers
| qToParent
| qLimit
| id
| ct
| a
| evt
| hvt
| ts
| omitHistos
## Private Attributes
| _app

## Detailed Description

Definition at line 396 of file Parallel.py.

## Member Function Documentation

def GaudiPython::Parallel::Reader::__init__ | ( |  | self,
|  |  | inq,
|  |  | commonQueue,
|  |  | rstatq,
|  |  | qToParent,
|  |  | workers,
|  |  | config,
|  |  | qLimit,
|  |  | _app |
| ) |  |  |

Definition at line 397 of file Parallel.py.

    00397                                                                                              :
    00398         self.inq       = inq
    00399         self.c         = config
    00400         self.commonQ   = commonQueue
    00401         self.cstatq    = rstatq
    00402         self.workers   = workers
    00403         self.qToParent = qToParent
    00404         self.qLimit    = qLimit
    00405         self.id        = -1
    00406         self._app      = _app
    00407
    00408         # from ParallelStats import constructReaderDict
    00409         # self.constructReaderDict = constructReaderDict
    00410
    00411         r = Process( target=self.read )
    00412         r.start()
    00413
        def readerConfig( self ) :

def GaudiPython::Parallel::Reader::readerConfig | ( |  | self | ) |

Definition at line 414 of file Parallel.py.

    00414                              :
    00415         ks = self.c.keys()
    00416         if 'ApplicationMgr' in ks :
    00417             self.c['ApplicationMgr'].OutStream = []
    00418             if self._app == 'Gauss' : pass
    00419             else : self.c['ApplicationMgr'].TopAlg  = []
    00420         else :
    00421             self.qToParent.put(None)
    00422             print 'Reader : readerConfig : ApplicationMgr not available for configuration?'
    00423
    00424         try    : self.c['HistogramPersistencySvc'].OutputFile = ''
    00425         except : print 'Reader : No Histogram output to cancel!  Config continues...'
    00426
    00427         if 'MessageSvc' in ks :
    00428             self.c['MessageSvc'].Format      = '[Reader]% F%18W%S%7W%R%T %0W%M'
    00429             self.c['MessageSvc'].OutputLevel = ERROR
    00430         else :
    00431             self.qToParent.put(None)
    00432             print 'Reader : readerConfig : MessageSvc not available for configuration?'
    00433         if self._app == 'Gauss' :
    00434             gs = self.c['GaussSequencer']
    00435             # Sequencer has two stages : generation and simulation, so let
    00436             # the reader generate events one by one, and pass to workers for full Simulation step
    00437             ed = [gs.Members[0]]
    00438             gs.Members = ed
    00439
        def read( self ):

def GaudiPython::Parallel::Reader::read | ( |  | self | ) |

Definition at line 440 of file Parallel.py.

    00440                     :
    00441         currentProcess().setName('+Reader+')
    00442         appendPostConfigAction( self.readerConfig() )
    00443
    00444         # print '[ GaudiPython.Parallel ] Reader Started : Process %i'%( os.getpid() )
    00445
    00446         self.ct       = 0
    00447
    00448         # GaudiPython Tools
    00449         self.a = AppMgr()
    00450         self.evt = self.a.evtsvc()
    00451         self.hvt = self.a.histsvc()
    00452         self.ts = gbl.GaudiPython.TESSerializer(self.evt._idp)
    00453         self.omitHistos = ['/stat/CaloPIDs']
    00454         collectHistos = CollectHistograms( self )
    00455         self.a.addAlgorithm( collectHistos )
    00456         self.a.initialize()
    00457         self.a.start()
    00458
    00459         for i in xrange( self.c['ApplicationMgr'].EvtMax ) :
    00460             self.a.run(1)
    00461             self.ts = gbl.GaudiPython.TESSerializer(self.evt._idp)
    00462
    00463             if self._app == 'Gauss' :
    00464                 if self.evt.getHistoNames() :
    00465                     for i in self.evt.getHistoNames() : self.ts.addOptItem(i,1)
    00466             else :
    00467                 if self.evt.getList() :
    00468                     for i in self.evt.getList() : self.ts.addOptItem(i,1)
    00469             buf = dumpTES( self )
    00470             sent = False
    00471             while sent == False :
    00472                 try :
    00473                     self.inq.put( buf, block=True )
    00474                     while self.inq._buffer : pass # try pause until the background thread is complete
    00475                     sent = True ; self.ct += 1
    00476                 except :
    00477                     self.errs += 1
    00478             self.evt.clearStore()
    00479         # signal the end
    00480         for w in range(self.workers) : self.inq.put(None)
    00481
    00482
    00483         # Termination
    00484         self.a.stop()
    00485         self.a.finalize()
    00486
    00487         # print '='*80
    00488         # print 'Reader Finished, AppMgr stopped, finalized.'
    00489         # print line
    00490         # print 'Events Sent : %i'%( self.ct )
    00491         # print '='*80
    00492
    00493         self.qToParent.put(None) # ; print 'READER has returned None Flag to setupSystem'
    00494
    00495 # ===========================================================================================
    00496 # The Worker
    00497 # ===========================================================================================
    00498
    class Worker( ) :

## Member Data Documentation

GaudiPython::Parallel::Reader::inq

Definition at line 398 of file Parallel.py.

GaudiPython::Parallel::Reader::c

Definition at line 399 of file Parallel.py.

GaudiPython::Parallel::Reader::commonQ

Definition at line 400 of file Parallel.py.

GaudiPython::Parallel::Reader::cstatq

Definition at line 401 of file Parallel.py.

GaudiPython::Parallel::Reader::workers

Definition at line 402 of file Parallel.py.

GaudiPython::Parallel::Reader::qToParent

Definition at line 403 of file Parallel.py.

GaudiPython::Parallel::Reader::qLimit

Definition at line 404 of file Parallel.py.

GaudiPython::Parallel::Reader::id

Definition at line 405 of file Parallel.py.

GaudiPython::Parallel::Reader::_app`[private]`

Definition at line 406 of file Parallel.py.

GaudiPython::Parallel::Reader::ct

Definition at line 446 of file Parallel.py.

GaudiPython::Parallel::Reader::a

Definition at line 449 of file Parallel.py.

GaudiPython::Parallel::Reader::evt

Definition at line 450 of file Parallel.py.

GaudiPython::Parallel::Reader::hvt

Definition at line 451 of file Parallel.py.

GaudiPython::Parallel::Reader::ts

Definition at line 452 of file Parallel.py.

GaudiPython::Parallel::Reader::omitHistos

Definition at line 453 of file Parallel.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r7p1/GaudiPython/python/GaudiPython/Parallel.py