Package Scientific :: Package BSP :: Class ParAccumulator
[frames] | no frames]

Class ParAccumulator

object --+    
         |    
  ParValue --+
             |
            ParAccumulator

Global accumulator

ParAccumulator objects are used to perform iterative reduction operations in loops. The initial local value is zero (i.e. the passed-in zero object, not the number 0), which is modified by subsequent calls to the method addValue.

Instance Methods
 
__init__(self, operator, zero)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
addValue(self, value)
Replace the internal value of the accumulator by internal_value = operator(internal_value, value).
ParValue
calculateTotal(self)
Returns: a reduction over the local values on all processors

Inherited from ParValue: __add__, __call__, __div__, __divmod__, __eq__, __ge__, __getattr__, __getitem__, __gt__, __le__, __len__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __pow__, __repr__, __str__, __sub__, accumulate, alltrue, anytrue, broadcast, fullExchange, get, getattr, map, put, reduce

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Variables

Inherited from ParValue: is_parvalue

Properties

Inherited from object: __class__

Method Details

__init__(self, operator, zero)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • operator (function of two variables) - a local function taking two arguments and returning one argument of the same type
  • zero - the initial value for reduction
Overrides: object.__init__

calculateTotal(self)

 
Returns: ParValue
a reduction over the local values on all processors