|
| def | __init__ (self, gmpComponent) |
| |
| def | localCmp (self, tupA, tupB) |
| |
| def | SendFileRecords (self) |
| |
| def | Receive (self) |
| |
| def | Rebuild (self) |
| |
| def | MergeFSRobject (self, sourceNode, path, ob) |
| |
| def | ProcessTimeSpanFSR (self, path, ob) |
| |
| def | ProcessEventCountFSR (self, path, ob) |
| |
| def | MergeLumiFSR (self, path, keyedC) |
| |
| def | __init__ (self, gmpComponent) |
| |
| def | localCmp (self, tupA, tupB) |
| |
| def | SendFileRecords (self) |
| |
| def | Receive (self) |
| |
| def | Rebuild (self) |
| |
| def | MergeFSRobject (self, sourceNode, path, ob) |
| |
| def | ProcessTimeSpanFSR (self, path, ob) |
| |
| def | ProcessEventCountFSR (self, path, ob) |
| |
| def | MergeLumiFSR (self, path, keyedC) |
| |
Definition at line 206 of file pTools.py.
| def GaudiMP.pTools.FileRecordsAgent.__init__ |
( |
|
self, |
|
|
|
gmpComponent |
|
) |
| |
| def GaudiMP.pTools.FileRecordsAgent.__init__ |
( |
|
self, |
|
|
|
gmpComponent |
|
) |
| |
| def GaudiMP.pTools.FileRecordsAgent.localCmp |
( |
|
self, |
|
|
|
tupA, |
|
|
|
tupB |
|
) |
| |
Definition at line 215 of file pTools.py.
221 if valA<valB :
return -1
222 elif valA>valB :
return 1
| def GaudiMP.pTools.FileRecordsAgent.localCmp |
( |
|
self, |
|
|
|
tupA, |
|
|
|
tupB |
|
) |
| |
Definition at line 215 of file pTools.py.
221 if valA<valB :
return -1
222 elif valA>valB :
return 1
| def GaudiMP.pTools.FileRecordsAgent.MergeFSRobject |
( |
|
self, |
|
|
|
sourceNode, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 349 of file pTools.py.
351 if path ==
'/FileRecords/TimeSpanFSR' :
354 elif path ==
'/FileRecords/EventCountFSR' :
358 elif "KeyedContainer" in ob.__class__.__name__ :
361 if "LumiFSR" in ob.__class__.__name__ :
364 self.log.info(
"Skipping Merge of Keyed Container %s for %s"\
365 %(ob.__class__.__name__,path))
| def GaudiMP.pTools.FileRecordsAgent.MergeFSRobject |
( |
|
self, |
|
|
|
sourceNode, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 349 of file pTools.py.
351 if path ==
'/FileRecords/TimeSpanFSR' :
354 elif path ==
'/FileRecords/EventCountFSR' :
358 elif "KeyedContainer" in ob.__class__.__name__ :
361 if "LumiFSR" in ob.__class__.__name__ :
364 self.log.info(
"Skipping Merge of Keyed Container %s for %s"\
365 %(ob.__class__.__name__,path))
| def GaudiMP.pTools.FileRecordsAgent.MergeLumiFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
keyedC |
|
) |
| |
Definition at line 393 of file pTools.py.
394 from ROOT
import string
396 keyedContainer = self.fsr.retrieveObject(path)
398 assert keyedContainer.numberOfObjects() == 1
399 l = keyedContainer.containedObject(0)
402 nCont = keyedC.numberOfObjects()
403 for i
in xrange(nCont) :
404 obj = keyedC.containedObject(i)
406 baseLumi.merge( nextLumi )
408 newLumi = gbl.LHCb.LumiFSR()
409 for r
in baseLumi.runs :
410 newLumi.addRunNumber( r )
411 for f
in baseLumi.files :
412 newLumi.addFileID( string(f) )
413 for k
in baseLumi.keys :
414 increment, integral = baseLumi.info[k]
415 newLumi.addInfo(k, increment, integral)
417 self.
fsr[path].clear()
419 self.
fsr[path].
add(newLumi)
| def GaudiMP.pTools.FileRecordsAgent.MergeLumiFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
keyedC |
|
) |
| |
Definition at line 393 of file pTools.py.
394 from ROOT
import string
396 keyedContainer = self.fsr.retrieveObject(path)
398 assert keyedContainer.numberOfObjects() == 1
399 l = keyedContainer.containedObject(0)
402 nCont = keyedC.numberOfObjects()
403 for i
in xrange(nCont) :
404 obj = keyedC.containedObject(i)
406 baseLumi.merge( nextLumi )
408 newLumi = gbl.LHCb.LumiFSR()
409 for r
in baseLumi.runs :
410 newLumi.addRunNumber( r )
411 for f
in baseLumi.files :
412 newLumi.addFileID( string(f) )
413 for k
in baseLumi.keys :
414 increment, integral = baseLumi.info[k]
415 newLumi.addInfo(k, increment, integral)
417 self.
fsr[path].clear()
419 self.
fsr[path].
add(newLumi)
| def GaudiMP.pTools.FileRecordsAgent.ProcessEventCountFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 389 of file pTools.py.
390 self.log.debug(
'Event Count Input Addition')
391 self.
fsr[path].setInput( self.
fsr[path].input()+ob.input() )
| def GaudiMP.pTools.FileRecordsAgent.ProcessEventCountFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 389 of file pTools.py.
390 self.log.debug(
'Event Count Input Addition')
391 self.
fsr[path].setInput( self.
fsr[path].input()+ob.input() )
| def GaudiMP.pTools.FileRecordsAgent.ProcessTimeSpanFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 367 of file pTools.py.
368 ob2 = self.fsr.retrieveObject( path )
369 if ob.containedObjects().size() :
370 sz = ob.containedObjects().size()
371 cob = ob2.containedObjects()[0]
374 for j
in xrange( sz ) :
375 cob = ob.containedObjects()[j]
376 self.log.debug(
'Adding TimeSpanFSR' )
377 if cob.earliest() < min:
379 if cob.latest() > max:
383 tsfsr = gbl.LHCb.TimeSpanFSR()
384 tsfsr.setEarliest( min )
385 tsfsr.setLatest( max )
386 self.
fsr[path].clear()
387 self.
fsr[path].
add( tsfsr )
| def GaudiMP.pTools.FileRecordsAgent.ProcessTimeSpanFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 367 of file pTools.py.
368 ob2 = self.fsr.retrieveObject( path )
369 if ob.containedObjects().size() :
370 sz = ob.containedObjects().size()
371 cob = ob2.containedObjects()[0]
374 for j
in xrange( sz ) :
375 cob = ob.containedObjects()[j]
376 self.log.debug(
'Adding TimeSpanFSR' )
377 if cob.earliest() < min:
379 if cob.latest() > max:
383 tsfsr = gbl.LHCb.TimeSpanFSR()
384 tsfsr.setEarliest( min )
385 tsfsr.setLatest( max )
386 self.
fsr[path].clear()
387 self.
fsr[path].
add( tsfsr )
| def GaudiMP.pTools.FileRecordsAgent.Rebuild |
( |
|
self | ) |
|
Definition at line 305 of file pTools.py.
307 for sourceNode, path, serialob
in self.
objectsIn :
308 self.log.debug(
'Working with %s'%(path))
309 ob = pickle.loads(serialob)
310 if hasattr( ob,
'update' ) :
312 if hasattr( ob,
'numberOfObjects' ) :
313 nCont = ob.numberOfObjects()
314 self.log.debug(
'\t %s has containedObjects : %i'%(
type(ob).__name__, nCont) )
316 self.log.debug(
'Registering Object to : %s'%(path))
317 self.fsr.registerObject( path, ob )
319 self.log.debug(
'Merging Object to : %s'%(path))
325 self.log.info(
'FSR Store Rebuilt. Correcting EventCountFSR')
326 if bool( self.fsr._idp ) :
327 ecount =
'/FileRecords/EventCountFSR'
328 if self.
fsr[ecount] :
329 self.
fsr[ecount].setOutput( self._gmpc.nIn )
330 self.log.info(
'Event Counter Output set : %s : %i'\
331 %(ecount, self.
fsr[ecount].output()) )
333 self.log.debug(
'FSR store reconstructed!')
334 lst = self.fsr.getHistoNames()
337 ob = self.fsr.retrieveObject(l)
338 if hasattr( ob,
'configureDirectAccess' ) :
339 ob.configureDirectAccess()
340 if hasattr( ob,
'containedObjects' ) :
342 self.log.debug(
'\t%s (cont. objects : %i)'\
343 %(l, ob.numberOfObjects()))
345 self.log.debug(
'\t%s'%(l))
346 self.log.info(
'FSR Store fully rebuilt.')
| def GaudiMP.pTools.FileRecordsAgent.Rebuild |
( |
|
self | ) |
|
Definition at line 305 of file pTools.py.
307 for sourceNode, path, serialob
in self.
objectsIn :
308 self.log.debug(
'Working with %s'%(path))
309 ob = pickle.loads(serialob)
310 if hasattr( ob,
'update' ) :
312 if hasattr( ob,
'numberOfObjects' ) :
313 nCont = ob.numberOfObjects()
314 self.log.debug(
'\t %s has containedObjects : %i'%(
type(ob).__name__, nCont) )
316 self.log.debug(
'Registering Object to : %s'%(path))
317 self.fsr.registerObject( path, ob )
319 self.log.debug(
'Merging Object to : %s'%(path))
325 self.log.info(
'FSR Store Rebuilt. Correcting EventCountFSR')
326 if bool( self.fsr._idp ) :
327 ecount =
'/FileRecords/EventCountFSR'
328 if self.
fsr[ecount] :
329 self.
fsr[ecount].setOutput( self._gmpc.nIn )
330 self.log.info(
'Event Counter Output set : %s : %i'\
331 %(ecount, self.
fsr[ecount].output()) )
333 self.log.debug(
'FSR store reconstructed!')
334 lst = self.fsr.getHistoNames()
337 ob = self.fsr.retrieveObject(l)
338 if hasattr( ob,
'configureDirectAccess' ) :
339 ob.configureDirectAccess()
340 if hasattr( ob,
'containedObjects' ) :
342 self.log.debug(
'\t%s (cont. objects : %i)'\
343 %(l, ob.numberOfObjects()))
345 self.log.debug(
'\t%s'%(l))
346 self.log.info(
'FSR Store fully rebuilt.')
| def GaudiMP.pTools.FileRecordsAgent.Receive |
( |
|
self | ) |
|
Definition at line 285 of file pTools.py.
287 self.log.info(
'Receiving FSR store data...')
288 nc = self._gmpc.nWorkers
290 objects = self.q.get( )
291 if objects ==
'END_FSR' :
298 self.objectsIn.append(o)
301 self.objectsIn.sort(cmp=self.
localCmp)
302 self.log.info(
'All FSR data received')
| def GaudiMP.pTools.FileRecordsAgent.Receive |
( |
|
self | ) |
|
Definition at line 285 of file pTools.py.
287 self.log.info(
'Receiving FSR store data...')
288 nc = self._gmpc.nWorkers
290 objects = self.q.get( )
291 if objects ==
'END_FSR' :
298 self.objectsIn.append(o)
301 self.objectsIn.sort(cmp=self.
localCmp)
302 self.log.info(
'All FSR data received')
| def GaudiMP.pTools.FileRecordsAgent.SendFileRecords |
( |
|
self | ) |
|
Definition at line 226 of file pTools.py.
238 self.log.info(
'Sending FileRecords...')
239 lst = self.fsr.getHistoNames()
243 self.log.info(
'No FileRecords Data to send to Writer.')
244 self.q.put(
'END_FSR' )
248 if '/FileRecords' in lst : lst.remove(
'/FileRecords')
251 o = self.fsr.retrieveObject( l )
252 if hasattr(o,
"configureDirectAccess") :
253 o.configureDirectAccess()
255 if self._gmpc.nodeID == 0 :
256 self.objectsOut.append( (0, l, pickle.dumps(o)) )
260 if l ==
'/FileRecords/EventCountFSR' :
261 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
262 self.objectsOut.append( tup )
265 assert "KeyedContainer" in o.__class__.__name__
266 nObjects = o.numberOfObjects()
268 self.log.debug(
"Keyed Container %s with %i objects"\
270 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
271 self.objectsOut.append( tup )
272 self.log.debug(
'Done with FSR store, just to send to Writer.')
275 self.log.debug(
'%i FSR objects to Writer'%(len(self.
objectsOut)))
277 self.log.debug(
'\t%s'%(ob[0]))
280 self.log.info(
'Valid FSR Store, but no data to send to Writer')
281 self.log.info(
'SendFSR complete')
282 self.q.put(
'END_FSR' )
| def GaudiMP.pTools.FileRecordsAgent.SendFileRecords |
( |
|
self | ) |
|
Definition at line 226 of file pTools.py.
238 self.log.info(
'Sending FileRecords...')
239 lst = self.fsr.getHistoNames()
243 self.log.info(
'No FileRecords Data to send to Writer.')
244 self.q.put(
'END_FSR' )
248 if '/FileRecords' in lst : lst.remove(
'/FileRecords')
251 o = self.fsr.retrieveObject( l )
252 if hasattr(o,
"configureDirectAccess") :
253 o.configureDirectAccess()
255 if self._gmpc.nodeID == 0 :
256 self.objectsOut.append( (0, l, pickle.dumps(o)) )
260 if l ==
'/FileRecords/EventCountFSR' :
261 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
262 self.objectsOut.append( tup )
265 assert "KeyedContainer" in o.__class__.__name__
266 nObjects = o.numberOfObjects()
268 self.log.debug(
"Keyed Container %s with %i objects"\
270 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
271 self.objectsOut.append( tup )
272 self.log.debug(
'Done with FSR store, just to send to Writer.')
275 self.log.debug(
'%i FSR objects to Writer'%(len(self.
objectsOut)))
277 self.log.debug(
'\t%s'%(ob[0]))
280 self.log.info(
'Valid FSR Store, but no data to send to Writer')
281 self.log.info(
'SendFSR complete')
282 self.q.put(
'END_FSR' )
| GaudiMP.pTools.FileRecordsAgent._gmpc |
|
private |
| GaudiMP.pTools.FileRecordsAgent.fsr |
| GaudiMP.pTools.FileRecordsAgent.log |
| GaudiMP.pTools.FileRecordsAgent.objectsIn |
| GaudiMP.pTools.FileRecordsAgent.objectsOut |
| GaudiMP.pTools.FileRecordsAgent.q |
The documentation for this class was generated from the following file:
- InstallArea/x86_64-slc6-gcc48-opt/python/GaudiMP/pTools.py