TiledArray  0.7.0
TiledArray::Pmap Class Referenceabstract

Process map. More...

#include <pmap.h>

Inheritance diagram for TiledArray::Pmap:
Collaboration diagram for TiledArray::Pmap:

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_typelocal_
 A list of local tiles. More...
 

Detailed Description

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.

Definition at line 46 of file pmap.h.

Member Typedef Documentation

◆ const_iterator

Iterator type.

Definition at line 49 of file pmap.h.

◆ size_type

typedef std::size_t TiledArray::Pmap::size_type

Size type.

Definition at line 48 of file pmap.h.

Constructor & Destructor Documentation

◆ Pmap()

TiledArray::Pmap::Pmap ( World &  world,
const size_type  size 
)
inline

Process map constructor.

Parameters
worldThe world where the tiles will be mapped
sizeThe number of processes to be mapped

Definition at line 68 of file pmap.h.

◆ ~Pmap()

virtual TiledArray::Pmap::~Pmap ( )
inlinevirtual

Definition at line 74 of file pmap.h.

Member Function Documentation

◆ begin()

const_iterator TiledArray::Pmap::begin ( ) const
inline

Begin local element iterator.

Returns
An iterator that points to the beginning of the local element set

Definition at line 121 of file pmap.h.

◆ empty()

bool TiledArray::Pmap::empty ( ) const
inline

Check if there are any local elements.

Returns
true when there are no local tiles, otherwise false .

Definition at line 111 of file pmap.h.

◆ end()

const_iterator TiledArray::Pmap::end ( ) const
inline

End local element iterator.

Returns
An iterator that points to the beginning of the local element set

Definition at line 126 of file pmap.h.

◆ is_local()

virtual bool TiledArray::Pmap::is_local ( const size_type  tile) const
pure virtual

Check that the tile is owned by this process.

Parameters
tileThe tile to be checked
Returns
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.

◆ is_replicated()

virtual bool TiledArray::Pmap::is_replicated ( ) const
inlinevirtual

Replicated array status.

Returns
true if the array is replicated, and false otherwise

Reimplemented in TiledArray::detail::ReplicatedPmap.

Definition at line 116 of file pmap.h.

◆ local_size()

size_type TiledArray::Pmap::local_size ( ) const
inline

Local size accessor.

Returns
The number of local elements

Definition at line 106 of file pmap.h.

◆ owner()

virtual size_type TiledArray::Pmap::owner ( const size_type  tile) const
pure virtual

Maps tile to the processor that owns it.

Parameters
tileThe tile to be queried
Returns
Processor that logically owns tile

Implemented in TiledArray::detail::CyclicPmap, TiledArray::detail::BlockedPmap, TiledArray::detail::HashPmap, and TiledArray::detail::ReplicatedPmap.

◆ procs()

size_type TiledArray::Pmap::procs ( ) const
inline

Process count accessor.

Returns
The number of processes

Definition at line 101 of file pmap.h.

◆ rank()

size_type TiledArray::Pmap::rank ( ) const
inline

Process rank accessor.

Returns
The rank of this process

Definition at line 96 of file pmap.h.

◆ size()

size_type TiledArray::Pmap::size ( ) const
inline

Size accessor.

Returns
The number of elements

Definition at line 91 of file pmap.h.

Member Data Documentation

◆ local_

std::vector<size_type> TiledArray::Pmap::local_
protected

A list of local tiles.

Definition at line 55 of file pmap.h.

◆ procs_

const size_type TiledArray::Pmap::procs_
protected

The number of processes.

Definition at line 53 of file pmap.h.

◆ rank_

const size_type TiledArray::Pmap::rank_
protected

The rank of this process.

Definition at line 52 of file pmap.h.

◆ size_

const size_type TiledArray::Pmap::size_
protected

The number of tiles mapped among all processes.

Definition at line 54 of file pmap.h.


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