PSTL Parallel Iterators

Parallel iterators extend the functionality of global pointers. In the case of random access parallel iterators, the operators ++, --, +n, -n, and [i] allow random access to the entire contents of a distributed container, while the weaker bidirectional parallel iterators only provide access via the ++ and - - operators. In general, each distributed container class C has a subclass for the strongest form of parallel iterator that it supports (e.g. random access, forward, or bidirectional).

Each container class provides methods of the form:

template <class T>
class C {
     .... 
     class iterator { ... };
     class pariterator { ... };
     pariterator parbegin();
     pariterator parend();
     iterator begin();
     iterator end();
};
    

The parbegin() and parend() methods return parallel iterators which point to the beginning and one element past the end, respectively, of the container elements. The begin() and end() methods return local iterators which point to the beginning and one element past the end, respectively, of the local portion of the container elements.

In order to facilitate effective use of the parallel algorithms, each container has several functions which modify parallel iterators. These include functions to return iterators to the beginning and end of the local section (if any) of an iteration space defined by two parallel iterators.


hpc++@extreme.indiana.edu

Last modified: Thu Feb 4 17:05:50 EST 1999