The Gaudi Framework  master (594c33fa)
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 359 of file GMPBase.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 360 of file GMPBase.py.

360  def __init__(self, gaudiTESSerializer, evtDataSvc, nodeType, nodeID, log):
361  self.T = gaudiTESSerializer
362  self.evt = evtDataSvc
363  self.buffersIn = []
364  self.buffersOut = []
365  self.nIn = 0
366  self.nOut = 0
367  self.tDump = 0.0
368  self.tLoad = 0.0
369  # logging
370  self.nodeType = nodeType
371  self.nodeID = nodeID
372  self.log = log
373 

Member Function Documentation

◆ Dump()

def GaudiMP.GMPBase.TESSerializer.Dump (   self)

Definition at line 384 of file GMPBase.py.

384  def Dump(self):
385  t = time.time()
386  tb = TBufferFile(TBuffer.kWrite)
387  self.T.dumpBuffer(tb)
388  self.tDump += time.time() - t
389  self.nOut += 1
390  self.buffersOut.append(tb.Length())
391  return tb
392 

◆ Load()

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

Definition at line 374 of file GMPBase.py.

374  def Load(self, tbuf):
375  root = gbl.DataObject()
376  setOwnership(root, False)
377  self.evt.setRoot("/Event", root)
378  t = time.time()
379  self.T.loadBuffer(tbuf)
380  self.tLoad += time.time() - t
381  self.nIn += 1
382  self.buffersIn.append(tbuf.Length())
383 

◆ Report()

def GaudiMP.GMPBase.TESSerializer.Report (   self)

Definition at line 393 of file GMPBase.py.

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

Member Data Documentation

◆ buffersIn

GaudiMP.GMPBase.TESSerializer.buffersIn

Definition at line 363 of file GMPBase.py.

◆ buffersOut

GaudiMP.GMPBase.TESSerializer.buffersOut

Definition at line 364 of file GMPBase.py.

◆ evt

GaudiMP.GMPBase.TESSerializer.evt

Definition at line 362 of file GMPBase.py.

◆ log

GaudiMP.GMPBase.TESSerializer.log

Definition at line 372 of file GMPBase.py.

◆ nIn

GaudiMP.GMPBase.TESSerializer.nIn

Definition at line 365 of file GMPBase.py.

◆ nodeID

GaudiMP.GMPBase.TESSerializer.nodeID

Definition at line 371 of file GMPBase.py.

◆ nodeType

GaudiMP.GMPBase.TESSerializer.nodeType

Definition at line 370 of file GMPBase.py.

◆ nOut

GaudiMP.GMPBase.TESSerializer.nOut

Definition at line 366 of file GMPBase.py.

◆ T

GaudiMP.GMPBase.TESSerializer.T

Definition at line 361 of file GMPBase.py.

◆ tDump

GaudiMP.GMPBase.TESSerializer.tDump

Definition at line 367 of file GMPBase.py.

◆ tLoad

GaudiMP.GMPBase.TESSerializer.tLoad

Definition at line 368 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:130
DataOnDemand.Dump
bool Dump
Definition: DataOnDemand.py:35