TiledArray
0.7.0
|
Process map. More...
#include <pmap.h>
Public Types | |
typedef std::size_t | size_type |
Size type. More... | |
typedef std::vector< size_type >::const_iterator | const_iterator |
Iterator type. More... | |
Public Member Functions | |
Pmap (World &world, const size_type size) | |
Process map constructor. More... | |
virtual | ~Pmap () |
virtual size_type | owner (const size_type tile) const =0 |
Maps tile to the processor that owns it. More... | |
virtual bool | is_local (const size_type tile) const =0 |
Check that the tile is owned by this process. More... | |
size_type | size () const |
Size accessor. More... | |
size_type | rank () const |
Process rank accessor. More... | |
size_type | procs () const |
Process count accessor. More... | |
size_type | local_size () const |
Local size accessor. More... | |
bool | empty () const |
Check if there are any local elements. More... | |
virtual bool | is_replicated () const |
Replicated array status. More... | |
const_iterator | begin () const |
Begin local element iterator. More... | |
const_iterator | end () const |
End local element iterator. More... | |
Protected Attributes | |
const size_type | rank_ |
The rank of this process. More... | |
const size_type | procs_ |
The number of processes. More... | |
const size_type | size_ |
The number of tiles mapped among all processes. More... | |
std::vector< size_type > | local_ |
A list of local tiles. More... | |
Process map.
This is the base and interface class for other process maps. It provides access to the local tile iterator and basic process map information. Derived classes are responsible for distribution of tiles. The general idea of process map objects is to compute process owners with an O(1) algorithm to provide fast access to tile owner information and avoid storage of process map. A cache a list of local tiles is stored so that algorithms that need to iterate over local tiles can do so without computing the owner of all tiles. The algorithm to generate the cached list of local tiles and the memory requirement should scale as O(tiles/processes), if possible.
typedef std::vector<size_type>::const_iterator TiledArray::Pmap::const_iterator |
typedef std::size_t TiledArray::Pmap::size_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
Check that the tile is owned by this process.
tile | The tile to be checked |
true
if tile
is owned by this process, otherwise false
. Implemented in TiledArray::detail::CyclicPmap, TiledArray::detail::BlockedPmap, TiledArray::detail::HashPmap, and TiledArray::detail::ReplicatedPmap.
|
inlinevirtual |
Replicated array status.
true
if the array is replicated, and false otherwise Reimplemented in TiledArray::detail::ReplicatedPmap.
|
inline |
Maps tile
to the processor that owns it.
tile | The tile to be queried |
tile
Implemented in TiledArray::detail::CyclicPmap, TiledArray::detail::BlockedPmap, TiledArray::detail::HashPmap, and TiledArray::detail::ReplicatedPmap.
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |