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

Class ParSequence

object --+    
         |    
  ParValue --+
             |
            ParSequence
Known Subclasses:

Global distributed sequence

The local value of a ParSequence object is a slice of the input sequence, which is constructed such that the concatenation of the local values of all processors equals the input sequence while making the number of elements on each processor as equal as possible.

Instance Methods
any
__getitem__(self, item)
Returns: the element referred to by the index, if it is in the local subset
 
__init__(self, full_sequence)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
int
totalLength(self)
Returns: the sum of the lengths of the local values

Inherited from ParValue: __add__, __call__, __div__, __divmod__, __eq__, __ge__, __getattr__, __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

__getitem__(self, item)
(Indexing operator)

 
Parameters:
  • item (int or ParIndex) - an index into the total sequence
Returns: any
the element referred to by the index, if it is in the local subset
Raises:
  • IndexError - if the index refers to an item on another processor
Overrides: ParValue.__getitem__

__init__(self, full_sequence)
(Constructor)

 

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

Parameters:
  • full_sequence (arbitrary sequence object) - the full sequence, equal to the concatenation of the local values of all processors
Overrides: object.__init__

totalLength(self)

 
Returns: int
the sum of the lengths of the local values