The Gaudi Framework  v36r6 (b1ee9983)
GaudiMP.GMPBase.TESSerializer Class Reference
Inheritance diagram for GaudiMP.GMPBase.TESSerializer:
Collaboration diagram for GaudiMP.GMPBase.TESSerializer:

Public Member Functions

def __init__ (self, gaudiTESSerializer, evtDataSvc, nodeType, nodeID, log)
 
def Load (self, tbuf)
 
def Dump (self)
 
def Report (self)
 

Public Attributes

 T
 
 evt
 
 buffersIn
 
 buffersOut
 
 nIn
 
 nOut
 
 tDump
 
 tLoad
 
 nodeType
 
 nodeID
 
 log
 

Detailed Description

Definition at line 364 of file GMPBase.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiMP.GMPBase.TESSerializer.__init__ (   self,
  gaudiTESSerializer,
  evtDataSvc,
  nodeType,
  nodeID,
  log 
)

Definition at line 365 of file GMPBase.py.

365  def __init__(self, gaudiTESSerializer, evtDataSvc, nodeType, nodeID, log):
366  self.T = gaudiTESSerializer
367  self.evt = evtDataSvc
368  self.buffersIn = []
369  self.buffersOut = []
370  self.nIn = 0
371  self.nOut = 0
372  self.tDump = 0.0
373  self.tLoad = 0.0
374  # logging
375  self.nodeType = nodeType
376  self.nodeID = nodeID
377  self.log = log
378 

Member Function Documentation

◆ Dump()

def GaudiMP.GMPBase.TESSerializer.Dump (   self)

Definition at line 389 of file GMPBase.py.

389  def Dump(self):
390  t = time.time()
391  tb = TBufferFile(TBuffer.kWrite)
392  self.T.dumpBuffer(tb)
393  self.tDump += time.time() - t
394  self.nOut += 1
395  self.buffersOut.append(tb.Length())
396  return tb
397 

◆ Load()

def GaudiMP.GMPBase.TESSerializer.Load (   self,
  tbuf 
)

Definition at line 379 of file GMPBase.py.

379  def Load(self, tbuf):
380  root = gbl.DataObject()
381  setOwnership(root, False)
382  self.evt.setRoot("/Event", root)
383  t = time.time()
384  self.T.loadBuffer(tbuf)
385  self.tLoad += time.time() - t
386  self.nIn += 1
387  self.buffersIn.append(tbuf.Length())
388 

◆ Report()

def GaudiMP.GMPBase.TESSerializer.Report (   self)

Definition at line 398 of file GMPBase.py.

398  def Report(self):
399  evIn = "Events Loaded : %i" % (self.nIn)
400  evOut = "Events Dumped : %i" % (self.nOut)
401  din = sum(self.buffersIn)
402  dataIn = "Data Loaded : %i" % (din)
403  dataInMb = "Data Loaded (MB) : %5.2f Mb" % (din / MB)
404  if self.nIn:
405  avgIn = "Avg Buf Loaded : %5.2f Mb" % (din / (self.nIn * MB))
406  maxIn = "Max Buf Loaded : %5.2f Mb" % (max(self.buffersIn) / MB)
407  else:
408  avgIn = "Avg Buf Loaded : N/A"
409  maxIn = "Max Buf Loaded : N/A"
410  dout = sum(self.buffersOut)
411  dataOut = "Data Dumped : %i" % (dout)
412  dataOutMb = "Data Dumped (MB) : %5.2f Mb" % (dout / MB)
413  if self.nOut:
414  avgOut = "Avg Buf Dumped : %5.2f Mb" % (din / (self.nOut * MB))
415  maxOut = "Max Buf Dumped : %5.2f Mb" % (max(self.buffersOut) / MB)
416  else:
417  avgOut = "Avg Buf Dumped : N/A"
418  maxOut = "Max Buf Dumped : N/A"
419  dumpTime = "Total Dump Time : %5.2f" % (self.tDump)
420  loadTime = "Total Load Time : %5.2f" % (self.tLoad)
421 
422  lines = (
423  evIn,
424  evOut,
425  dataIn,
426  dataInMb,
427  avgIn,
428  maxIn,
429  dataOut,
430  dataOutMb,
431  avgOut,
432  maxOut,
433  dumpTime,
434  loadTime,
435  )
436  self.log.name = "%s-%i TESSerializer" % (self.nodeType, self.nodeID)
437  for line in lines:
438  self.log.info(line)
439  self.log.name = "%s-%i" % (self.nodeType, self.nodeID)
440 
441 
442 # =============================================================================
443 
444 

Member Data Documentation

◆ buffersIn

GaudiMP.GMPBase.TESSerializer.buffersIn

Definition at line 368 of file GMPBase.py.

◆ buffersOut

GaudiMP.GMPBase.TESSerializer.buffersOut

Definition at line 369 of file GMPBase.py.

◆ evt

GaudiMP.GMPBase.TESSerializer.evt

Definition at line 367 of file GMPBase.py.

◆ log

GaudiMP.GMPBase.TESSerializer.log

Definition at line 377 of file GMPBase.py.

◆ nIn

GaudiMP.GMPBase.TESSerializer.nIn

Definition at line 370 of file GMPBase.py.

◆ nodeID

GaudiMP.GMPBase.TESSerializer.nodeID

Definition at line 376 of file GMPBase.py.

◆ nodeType

GaudiMP.GMPBase.TESSerializer.nodeType

Definition at line 375 of file GMPBase.py.

◆ nOut

GaudiMP.GMPBase.TESSerializer.nOut

Definition at line 371 of file GMPBase.py.

◆ T

GaudiMP.GMPBase.TESSerializer.T

Definition at line 366 of file GMPBase.py.

◆ tDump

GaudiMP.GMPBase.TESSerializer.tDump

Definition at line 372 of file GMPBase.py.

◆ tLoad

GaudiMP.GMPBase.TESSerializer.tLoad

Definition at line 373 of file GMPBase.py.


The documentation for this class was generated from the following file:
max
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:225
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:136