| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Public Attributes | Private Attributes

# GaudiMP::GMPBase::CollectHistograms Class Reference

List of all members.

## Public Member Functions
def | __init__
def | execute
def | finalize
## Public Attributes
| log
## Private Attributes
| _gmpc

## Detailed Description

    GaudiPython algorithm used to clean up histos on the Reader and Workers
    Only has a finalize method()
    This retrieves a dictionary of path:histo objects and sends it to the
    writer.  It then waits for a None flag : THIS IS IMPORTANT, as if
    the algorithm returns before ALL histos have been COMPLETELY RECEIVED
    at the writer end, there will be an error.

Definition at line 181 of file GMPBase.py.

## Constructor & Destructor Documentation

def GaudiMP::GMPBase::CollectHistograms::__init__ | ( |  | self,
|  |  | gmpcomponent
| ) |  |

Definition at line 190 of file GMPBase.py.

    00191                                        :
    00192         PyAlgorithm.__init__( self )
    00193         self._gmpc = gmpcomponent
    00194         self.log = self._gmpc.log
            return None

## Member Function Documentation

def GaudiMP::GMPBase::CollectHistograms::execute | ( |  | self ) |

Definition at line 195 of file GMPBase.py.

    00196                         :
            return SUCCESS

def GaudiMP::GMPBase::CollectHistograms::finalize | ( |  | self ) |

Definition at line 197 of file GMPBase.py.

    00198                          :
    00199         self.log.info('CollectHistograms Finalise (%s)'%(self._gmpc.nodeType))
    00200         self._gmpc.hDict = self._gmpc.dumpHistograms( )
    00201         ks = self._gmpc.hDict.keys()
    00202         self.log.info('%i Objects in Histogram Store'%(len(ks)))
    00203         # crashes occurred due to Memory Error during the sending of hundreds
    00204         # histos on slc5 machines, so instead, break into chunks
    00205         # send 100 at a time
    00206         chunk = 100
    00207         reps = len(ks)/chunk + 1
    00208         for i in xrange(reps) :
    00209             someKeys = ks[i*chunk : (i+1)*chunk]
    00210             smalld = dict( [(key, self._gmpc.hDict[key]) for key in someKeys] )
    00211             self._gmpc.hq.put( (self._gmpc.nodeID, smalld) )
    00212         # "finished" Notification
    00213         self.log.debug('Signalling end of histos to Writer')
    00214         self._gmpc.hq.put( 'HISTOS_SENT' )
    00215         self.log.debug( 'Waiting on Sync Event' )
    00216         self._gmpc.sEvent.wait()
    00217         self.log.debug( 'Histo Sync Event set, clearing and returning' )
    00218         self._gmpc.hvt.clearStore()
    00219         root = gbl.DataObject()
    00220         setOwnership(root, False)
    00221         self._gmpc.hvt.setRoot( '/stat', root )
    00222         return SUCCESS
    00223
    00224 # =============================================================================

## Member Data Documentation

GaudiMP::GMPBase::CollectHistograms::_gmpc`[private]`

Definition at line 190 of file GMPBase.py.

GaudiMP::GMPBase::CollectHistograms::log

Definition at line 190 of file GMPBase.py.

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

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiMP/python/GaudiMP/GMPBase.py

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines