The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiMP.GMPBase.TESSerializer Class Reference

Public Member Functions

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

Public Attributes

 T = gaudiTESSerializer
 evt = evtDataSvc
list buffersIn = []
list buffersOut = []
int nIn = 0
int nOut = 0
float tDump = 0.0
float tLoad = 0.0
 nodeType = nodeType
 nodeID = nodeID
 log = log

Detailed Description

Definition at line 359 of file GMPBase.py.

Constructor & Destructor Documentation

◆ __init__()

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()

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()

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()

GaudiMP.GMPBase.TESSerializer.Report ( self)

Definition at line 393 of file GMPBase.py.

393 def Report(self):
394 evIn = f"Events Loaded : {self.nIn}"
395 evOut = f"Events Dumped : {self.nOut}"
396 din = sum(self.buffersIn)
397 dataIn = f"Data Loaded : {din}"
398 dataInMb = f"Data Loaded (MB) : {din / MB:5.2f}"
399 if self.nIn:
400 avgIn = f"Avg Buf Loaded : {din / (self.nIn * MB):5.2f}"
401 maxIn = f"Max Buf Loaded : {max(self.buffersIn) / MB:5.2f}"
402 else:
403 avgIn = "Avg Buf Loaded : N/A"
404 maxIn = "Max Buf Loaded : N/A"
405 dout = sum(self.buffersOut)
406 dataOut = f"Data Dumped : {dout}"
407 dataOutMb = f"Data Dumped (MB) : {dout / MB:5.2f}"
408 if self.nOut:
409 avgOut = f"Avg Buf Dumped : {din / (self.nOut * MB):5.2f}"
410 maxOut = f"Max Buf Dumped : {max(self.buffersOut) / MB:5.2f}"
411 else:
412 avgOut = "Avg Buf Dumped : N/A"
413 maxOut = "Max Buf Dumped : N/A"
414 dumpTime = f"Total Dump Time : {self.tDump:5.2f}"
415 loadTime = f"Total Load Time : {self.tLoad:5.2f}"
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 = f"{self.nodeType}-{self.nodeID} TESSerializer"
432 for line in lines:
433 self.log.info(line)
434 self.log.name = f"{self.nodeType}-{self.nodeID}"
435
436
437# =============================================================================
438
439

Member Data Documentation

◆ buffersIn

list GaudiMP.GMPBase.TESSerializer.buffersIn = []

Definition at line 363 of file GMPBase.py.

◆ buffersOut

list GaudiMP.GMPBase.TESSerializer.buffersOut = []

Definition at line 364 of file GMPBase.py.

◆ evt

GaudiMP.GMPBase.TESSerializer.evt = evtDataSvc

Definition at line 362 of file GMPBase.py.

◆ log

GaudiMP.GMPBase.TESSerializer.log = log

Definition at line 372 of file GMPBase.py.

◆ nIn

int GaudiMP.GMPBase.TESSerializer.nIn = 0

Definition at line 365 of file GMPBase.py.

◆ nodeID

GaudiMP.GMPBase.TESSerializer.nodeID = nodeID

Definition at line 371 of file GMPBase.py.

◆ nodeType

GaudiMP.GMPBase.TESSerializer.nodeType = nodeType

Definition at line 370 of file GMPBase.py.

◆ nOut

int GaudiMP.GMPBase.TESSerializer.nOut = 0

Definition at line 366 of file GMPBase.py.

◆ T

GaudiMP.GMPBase.TESSerializer.T = gaudiTESSerializer

Definition at line 361 of file GMPBase.py.

◆ tDump

float GaudiMP.GMPBase.TESSerializer.tDump = 0.0

Definition at line 367 of file GMPBase.py.

◆ tLoad

float GaudiMP.GMPBase.TESSerializer.tLoad = 0.0

Definition at line 368 of file GMPBase.py.


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