TiledArray  0.7.0
TiledArray::detail::CyclicPmap Class Reference

Maps cyclically a sequence of indices onto a 2-d matrix of processes. More...

#include <cyclic_pmap.h>

Inheritance diagram for TiledArray::detail::CyclicPmap:
Collaboration diagram for TiledArray::detail::CyclicPmap:

Public Types

typedef Pmap::size_type size_type
 Size type. More...
 
- Public Types inherited from TiledArray::Pmap
typedef std::size_t size_type
 Size type. More...
 
typedef std::vector< size_type >::const_iterator const_iterator
 Iterator type. More...
 

Public Member Functions

 CyclicPmap (World &world, size_type rows, size_type cols, size_type proc_rows, size_type proc_cols)
 Construct process map. More...
 
virtual ~CyclicPmap ()
 
size_type nrows () const
 Access number of rows in the tile index matrix. More...
 
size_type ncols () const
 Access number of columns in the tile index matrix. More...
 
size_type nrows_proc () const
 Access number of rows in the process matrix. More...
 
size_type ncols_proc () const
 Access number of columns in the process matrix. More...
 
virtual size_type owner (const size_type tile) const
 Maps tile to the processor that owns it. More...
 
virtual bool is_local (const size_type tile) const
 Check that the tile is owned by this process. More...
 
- Public Member Functions inherited from TiledArray::Pmap
 Pmap (World &world, const size_type size)
 Process map constructor. More...
 
virtual ~Pmap ()
 
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 rank of this process More...
 
const size_type size_
 < The number of processes More...
 
std::vector< size_typelocal_
 < The number of tiles mapped among all processes More...
 
- Protected Attributes inherited from TiledArray::Pmap
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

Maps cyclically a sequence of indices onto a 2-d matrix of processes.

Consider a sequence of indices $ \{ k | k \in [0,N) \} $, organized into a matrix, $ \{ \{i,j\} | i \in [0,N_{\rm row}),j\in[0,N_{\rm col})\} $, in row-major form, i.e. index $ k $ corresponds to $ \{ k_{\rm row}, k_{\rm col} \} \equiv \{ k / N_{\rm col}, k \% N_{\rm col} \} $. Similarly, a sequence of processes is organized into a matrix with $ P_{\rm row} $ rows and $ P_{\rm cols} $ columns, i.e process $ p \equiv \{ p_{\rm row}, p_{\rm col} \} $. Then index $ \{ k_{\rm row}, k_{\rm col} \} $ maps to process $ \{ p_{\rm row}, p_{\rm col} \} = \{ k_{\rm row} \% N_{\rm row}, k_{\rm col} \% N_{\rm col} \} $

Note
This class is used to map tile indices to processes.

Definition at line 46 of file cyclic_pmap.h.

Member Typedef Documentation

◆ size_type

Size type.

Definition at line 63 of file cyclic_pmap.h.

Constructor & Destructor Documentation

◆ CyclicPmap()

TiledArray::detail::CyclicPmap::CyclicPmap ( World &  world,
size_type  rows,
size_type  cols,
size_type  proc_rows,
size_type  proc_cols 
)
inline

Construct process map.

Parameters
worldThe world where the tiles will be mapped
rowsThe number of tile rows to be mapped
colsThe number of tile columns to be mapped
proc_rowsThe number of process rows in the map
proc_colsThe number of process columns in the map
Exceptions
TiledArray::ExceptionWhen proc_rows > rows
TiledArray::ExceptionWhen proc_cols > cols
TiledArray::ExceptionWhen proc_rows * proc_cols > world.size()

Definition at line 75 of file cyclic_pmap.h.

Here is the call graph for this function:

◆ ~CyclicPmap()

virtual TiledArray::detail::CyclicPmap::~CyclicPmap ( )
inlinevirtual

Definition at line 114 of file cyclic_pmap.h.

Member Function Documentation

◆ is_local()

virtual bool TiledArray::detail::CyclicPmap::is_local ( const size_type  tile) const
inlinevirtual

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 .

Implements TiledArray::Pmap.

Definition at line 150 of file cyclic_pmap.h.

Here is the call graph for this function:

◆ ncols()

size_type TiledArray::detail::CyclicPmap::ncols ( ) const
inline

Access number of columns in the tile index matrix.

Definition at line 119 of file cyclic_pmap.h.

◆ ncols_proc()

size_type TiledArray::detail::CyclicPmap::ncols_proc ( ) const
inline

Access number of columns in the process matrix.

Definition at line 123 of file cyclic_pmap.h.

◆ nrows()

size_type TiledArray::detail::CyclicPmap::nrows ( ) const
inline

Access number of rows in the tile index matrix.

Definition at line 117 of file cyclic_pmap.h.

◆ nrows_proc()

size_type TiledArray::detail::CyclicPmap::nrows_proc ( ) const
inline

Access number of rows in the process matrix.

Definition at line 121 of file cyclic_pmap.h.

◆ owner()

virtual size_type TiledArray::detail::CyclicPmap::owner ( const size_type  tile) const
inlinevirtual

Maps tile to the processor that owns it.

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

Implements TiledArray::Pmap.

Definition at line 129 of file cyclic_pmap.h.

Here is the caller graph for this function:

Member Data Documentation

◆ local_

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

< The number of tiles mapped among all processes

Definition at line 55 of file pmap.h.

◆ procs_

const size_type TiledArray::Pmap::procs_
protected

< The rank of this process

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 processes

Definition at line 54 of file pmap.h.


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