The Gaudi Framework  master (594c33fa)
GaudiMP.GMPBase.Writer Class Reference
Inheritance diagram for GaudiMP.GMPBase.Writer:
Collaboration diagram for GaudiMP.GMPBase.Writer:

Public Member Functions

def __init__ (self, queues, events, params, subworkers)
 
def processConfiguration (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 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
 
 status
 
 histoAgent
 
 filerecordsAgent
 
 currentEvent
 
- Public Attributes inherited from GaudiMP.GMPBase.GMPComponent
 nodeType
 
 finalEvent
 
 lastEvent
 
 log
 
 subworkers
 
 nodeID
 
 msgFormat
 
 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 1236 of file GMPBase.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 1237 of file GMPBase.py.

1237  def __init__(self, queues, events, params, subworkers):
1238  GMPComponent.__init__(self, "Writer", -2, queues, events, params, subworkers)
1239  # Identify the writer streams
1240  self.writerDict = self.IdentifyWriters()
1241  # This keeps track of workers as they finish
1242  self.status = [False] * self.nWorkers
1243  self.log.name = "Writer--2"
1244 

Member Function Documentation

◆ Engine()

def GaudiMP.GMPBase.Writer.Engine (   self)

Reimplemented from GaudiMP.GMPBase.GMPComponent.

Definition at line 1254 of file GMPBase.py.

1254  def Engine(self):
1255  # rename process
1256  import ctypes
1257 
1258  libc = ctypes.CDLL("libc.so.6")
1259  name = str(self.nodeType) + str(self.nodeID) + "\0"
1260  libc.prctl(15, ctypes.create_unicode_buffer(name), 0, 0, 0)
1261 
1262  self.Initialize()
1263  self.histoAgent = HistoAgent(self)
1264  self.filerecordsAgent = FileRecordsAgent(self)
1265 
1266  # Begin processing
1267  Go = True
1268  current = -1
1269  while Go:
1270  current = (current + 1) % self.nWorkers
1271  packet = self.evcoms[current].receive(timeout=0.01)
1272  if packet is None:
1273  continue
1274  if packet == "FINISHED":
1275  self.log.info("Writer got FINISHED flag : Worker %i" % (current))
1276 
1277  self.status[current] = True
1278  if all(self.status):
1279  self.log.info("FINISHED recd from all workers, break loop")
1280  break
1281  continue
1282  # otherwise, continue as normal
1283  self.nIn += 1 # update central count (maybe needed by FSR store)
1284  evtNumber, tbin = packet # unpack
1285  self.TS.Load(tbin)
1286  t = time.time()
1287  self.a.executeEvent()
1288  self.rTime += time.time() - t
1289  self.currentEvent = self.getEventNumber()
1290  self.evt.clearStore()
1291  self.eventLoopSyncer.set()
1292  self.log.name = "Writer--2"
1293  self.log.info("Setting <Last> Event")
1294  self.lastEvent.set()
1295 
1296  # finalisation steps
1297  [e.finalize() for e in self.evcoms]
1298  # Now do Histograms
1299  sc = self.histoAgent.Receive()
1300  sc = self.histoAgent.RebuildHistoStore()
1301  if sc.isSuccess():
1302  self.log.info("Histo Store rebuilt ok")
1303  else:
1304  self.log.warning("Histo Store Error in Rebuild")
1305 
1306  # Now do FileRecords
1307  sc = self.filerecordsAgent.Receive()
1308  self.filerecordsAgent.Rebuild()
1309  self.Finalize()
1310  # self.rTime = time.time()-startEngine
1311  self.Report()
1312 
1313 
1314 # =============================================================================
1315 
1316 # =============================================================================
1317 
1318 

◆ processConfiguration()

def GaudiMP.GMPBase.Writer.processConfiguration (   self)

Reimplemented from GaudiMP.GMPBase.GMPComponent.

Definition at line 1245 of file GMPBase.py.

1245  def processConfiguration(self):
1246  # Writer :
1247  # No input
1248  # No Algs
1249  self.config["ApplicationMgr"].TopAlg = []
1250  self.config["EventSelector"].Input = []
1251 
1252  self.config["MessageSvc"].Format = "%-13s " % "[Writer]" + self.msgFormat
1253 

Member Data Documentation

◆ currentEvent

GaudiMP.GMPBase.Writer.currentEvent

Definition at line 1289 of file GMPBase.py.

◆ filerecordsAgent

GaudiMP.GMPBase.Writer.filerecordsAgent

Definition at line 1264 of file GMPBase.py.

◆ histoAgent

GaudiMP.GMPBase.Writer.histoAgent

Definition at line 1263 of file GMPBase.py.

◆ status

GaudiMP.GMPBase.Writer.status

Definition at line 1242 of file GMPBase.py.

◆ writerDict

GaudiMP.GMPBase.Writer.writerDict

Definition at line 1240 of file GMPBase.py.


The documentation for this class was generated from the following file:
GaudiPartProp.decorators.all
all
decorate service
Definition: decorators.py:53
GaudiPython.Pythonizations.executeEvent
executeEvent
Helpers for re-entrant interfaces.
Definition: Pythonizations.py:574