The Gaudi Framework  v36r6 (b1ee9983)
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 1249 of file GMPBase.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 1250 of file GMPBase.py.

1250  def __init__(self, queues, events, params, subworkers):
1251  GMPComponent.__init__(self, "Writer", -2, queues, events, params, subworkers)
1252  # Identify the writer streams
1253  self.writerDict = self.IdentifyWriters()
1254  # This keeps track of workers as they finish
1255  self.status = [False] * self.nWorkers
1256  self.log.name = "Writer--2"
1257 

Member Function Documentation

◆ Engine()

def GaudiMP.GMPBase.Writer.Engine (   self)

Reimplemented from GaudiMP.GMPBase.GMPComponent.

Definition at line 1267 of file GMPBase.py.

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

◆ processConfiguration()

def GaudiMP.GMPBase.Writer.processConfiguration (   self)

Reimplemented from GaudiMP.GMPBase.GMPComponent.

Definition at line 1258 of file GMPBase.py.

1258  def processConfiguration(self):
1259  # Writer :
1260  # No input
1261  # No Algs
1262  self.config["ApplicationMgr"].TopAlg = []
1263  self.config["EventSelector"].Input = []
1264 
1265  self.config["MessageSvc"].Format = "%-13s " % "[Writer]" + self.msgFormat
1266 

Member Data Documentation

◆ currentEvent

GaudiMP.GMPBase.Writer.currentEvent

Definition at line 1305 of file GMPBase.py.

◆ filerecordsAgent

GaudiMP.GMPBase.Writer.filerecordsAgent

Definition at line 1279 of file GMPBase.py.

◆ histoAgent

GaudiMP.GMPBase.Writer.histoAgent

Definition at line 1278 of file GMPBase.py.

◆ status

GaudiMP.GMPBase.Writer.status

Definition at line 1255 of file GMPBase.py.

◆ writerDict

GaudiMP.GMPBase.Writer.writerDict

Definition at line 1253 of file GMPBase.py.


The documentation for this class was generated from the following file:
AlgSequencer.all
all
Definition: AlgSequencer.py:61
GaudiPython.Pythonizations.executeEvent
executeEvent
Helpers for re-entrant interfaces.
Definition: Pythonizations.py:584