MADNESS 0.10.1
madness::DistributedMatrixDistribution Class Reference

#include <distributed_matrix.h>

Inheritance diagram for madness::DistributedMatrixDistribution:
Collaboration diagram for madness::DistributedMatrixDistribution:

Public Member Functions

 DistributedMatrixDistribution ()
 Default constructor makes an invalid distribution.
virtual ~DistributedMatrixDistribution ()
void clear ()
 Resets state to same as default constructor.
int64_t coldim () const
 Returns the column dimension of the matrix ... i.e., n for A(n,m).
int64_t coltile () const
 Returns the column tile size.
const DistributedMatrixDistribution & distribution () const
 Returns the distribution (aka *this).
void get_colrange (int p, int64_t &ilow, int64_t &ihigh) const
 Returns the inclusive range of column indices on processor p.
void get_range (int p, int64_t &ilow, int64_t &ihigh, int64_t &jlow, int64_t &jhigh) const
 Returns the inclusive ranges of column and row indicies on processor p.
void get_rowrange (int p, int64_t &jlow, int64_t &jhigh) const
 Returns the inclusive range of row indices on processor p.
World & get_world () const
 Returns the associated world.
bool is_column_distributed () const
 Returns true if the matrix is column distributed (i.e., row dimension not distributed).
bool is_row_distributed () const
 Returns true if the matrix is row distributed (i.e., column dimension not distributed).
int64_t local_coldim () const
 Returns the no. of column elements stored on this processor.
void local_colrange (int64_t &ilow, int64_t &ihigh) const
 Returns the inclusive range of column indices on this processor.
int64_t local_ihigh () const
 Returns the last column index on this processor (-1 if no data present).
int64_t local_ilow () const
 Returns the first column index on this processor (0 if no data present).
int64_t local_jhigh () const
 Returns the last row index on this processor (0 if no data present).
int64_t local_jlow () const
 Returns the first row index on this processor (0 if no data present).
int64_t local_rowdim () const
 Returns the no. of row elements stored on this processor.
void local_rowrange (int64_t &jlow, int64_t &jhigh) const
 Returns the inclusive range of row indices on this processor.
int64_t local_size () const
 Returns the total no. of elements stored on this processor.
bool operator== (const DistributedMatrixDistribution &d) const
ProcessID owner (int64_t i, int64_t j) const
 Returns the number of the process that owns element (i,j).
int64_t process_coldim () const
 Returns the no. of processors in the column dimension.
int64_t process_rowdim () const
 Returns the no. of processors in the row dimension.
int64_t rowdim () const
 Returns the row dimension of the matrix ... i.e., m for A(n,m).
int64_t rowtile () const
 Returns the row tile size.

Protected Member Functions

 DistributedMatrixDistribution (World &world, int64_t n, int64_t m, int64_t coltile, int64_t rowtile)
 Constructs distribution and size info for a matrix (for use by factory functions only).

Protected Attributes

int64_t idim
int64_t ihi
 Range of column indices on this processor.
int64_t ilo
int64_t jdim
 Dimension of data on this processor.
int64_t jhi
 Range of row indices on this processor.
int64_t jlo
int64_t m
 Row dimension of A(n,m).
int64_t n
 Column dimension of A(n,m).
int64_t P
 No. of processors.
int64_t Pcol
 Column of processor grid for this processor.
int64_t Pcoldim
 Column dimension of processor grid.
int64_t Prow
 Row of processor grid for this processor.
int64_t Prowdim
 Row dimension of processor grid.
World * pworld
ProcessID rank
 My processor rank.
int64_t tilem
 Tile size for row.
int64_t tilen
 Tile size for column.

Friends

DistributedMatrixDistribution column_distributed_matrix_distribution (World &world, int64_t n, int64_t m, int64_t coltile)
 Generates distribution for an (n,m) matrix distributed by columns (row dimension is not distributed).
template<typename T>
class DistributedMatrix
DistributedMatrixDistribution row_distributed_matrix_distribution (World &world, int64_t n, int64_t m, int64_t rowtile)
 Generates an (n,m) matrix distribution distributed by rows (column dimension is not distributed).

Constructor & Destructor Documentation

◆ DistributedMatrixDistribution() [1/2]

madness::DistributedMatrixDistribution::DistributedMatrixDistribution ( World & world,
int64_t n,
int64_t m,
int64_t coltile,
int64_t rowtile )
inlineprotected

Constructs distribution and size info for a matrix (for use by factory functions only).

This routine is dumb and just copies the given arguments, hence it can easily make an invalid matrix. The smarts are in the factory functions, hence this constructor is not for general use.

The matrix is tiled over a grid of processes as specified by the tile sizes.

Parameters
[in]worldThe world
[in]nThe matrix column dimension
[in]mThe matrix row dimension
[in]coltileTile size for the columns
[in]rowtileTile size for the rows

References coltile(), idim, ihi, ilo, jdim, jhi, jlo, m, max, n, P, Pcol, Pcoldim, Prow, Prowdim, pworld, rank, rowtile(), tilem, and tilen.

Referenced by madness::DistributedMatrix< double >::DistributedMatrix(), madness::DistributedMatrix< double >::DistributedMatrix(), madness::DistributedMatrix< double >::DistributedMatrix(), madness::DistributedMatrix< double >::DistributedMatrix(), column_distributed_matrix_distribution, distribution(), operator==(), and row_distributed_matrix_distribution.

◆ DistributedMatrixDistribution() [2/2]

madness::DistributedMatrixDistribution::DistributedMatrixDistribution ( )
inline

Default constructor makes an invalid distribution.

References idim, ihi, ilo, jdim, jhi, jlo, m, n, P, Pcol, Pcoldim, Prow, Prowdim, pworld, rank, tilem, and tilen.

◆ ~DistributedMatrixDistribution()

virtual madness::DistributedMatrixDistribution::~DistributedMatrixDistribution ( )
inlinevirtual

Member Function Documentation

◆ clear()

void madness::DistributedMatrixDistribution::clear ( )
inline

Resets state to same as default constructor.

References idim, ihi, ilo, jdim, jhi, jlo, m, n, P, Pcol, Pcoldim, Prow, Prowdim, pworld, rank, tilem, and tilen.

Referenced by madness::DistributedMatrix< double >::clear().

◆ coldim()

int64_t madness::DistributedMatrixDistribution::coldim ( ) const
inline

Returns the column dimension of the matrix ... i.e., n for A(n,m).

Returns
Column dimension of the matrix ... i.e., n for A(n,m)

References n.

Referenced by madness::DistributedMatrix< double >::extract_columns().

◆ coltile()

int64_t madness::DistributedMatrixDistribution::coltile ( ) const
inline

◆ distribution()

const DistributedMatrixDistribution & madness::DistributedMatrixDistribution::distribution ( ) const
inline

◆ get_colrange()

void madness::DistributedMatrixDistribution::get_colrange ( int p,
int64_t & ilow,
int64_t & ihigh ) const
inline

Returns the inclusive range of column indices on processor p.

If is no data on processor p it returns ilow=0 and ihigh=-1

Parameters
[in]pThe processor p of interest
[out]ilowThe first column index on the processor
[out]ihighThe last column index on the processor (-1 if none)

References get_range(), and p().

◆ get_range()

void madness::DistributedMatrixDistribution::get_range ( int p,
int64_t & ilow,
int64_t & ihigh,
int64_t & jlow,
int64_t & jhigh ) const
inline

Returns the inclusive ranges of column and row indicies on processor p.

If is no data on processor p it returns ilow=jlow=0 and ihigh=jhigh=-1

Parameters
[in]pThe processor p of interest
[out]ilowThe first column index on the processor
[out]ihighThe last column index on the processor (-1 if none)
[out]jlowThe first row index on the processor
[out]jhighThe last row index on the processor (-1 if none)

References m, n, p(), pi, process_coldim(), process_rowdim(), Prowdim, tilem, and tilen.

Referenced by get_colrange(), and get_rowrange().

◆ get_rowrange()

void madness::DistributedMatrixDistribution::get_rowrange ( int p,
int64_t & jlow,
int64_t & jhigh ) const
inline

Returns the inclusive range of row indices on processor p.

If is no data on processor p it returns jlow=0 and jhigh=-1

Parameters
[in]pThe processor p of interest
[out]jlowThe first row index on the processor
[out]jhighThe last row index on the processor (-1 if none)

References get_range(), and p().

◆ get_world()

World & madness::DistributedMatrixDistribution::get_world ( ) const
inline

◆ is_column_distributed()

bool madness::DistributedMatrixDistribution::is_column_distributed ( ) const
inline

Returns true if the matrix is column distributed (i.e., row dimension not distributed).

Returns
True if the matrix is column distributed (i.e., row dimension not distributed)

References process_rowdim().

Referenced by madness::DistributedMatrix< double >::extract_columns().

◆ is_row_distributed()

bool madness::DistributedMatrixDistribution::is_row_distributed ( ) const
inline

Returns true if the matrix is row distributed (i.e., column dimension not distributed).

Returns
True if the matrix is row distributed (i.e., column dimension not distributed)

References process_coldim().

◆ local_coldim()

int64_t madness::DistributedMatrixDistribution::local_coldim ( ) const
inline

Returns the no. of column elements stored on this processor.

Returns
No. of column elements stored on this processor (may be zero)

References idim.

◆ local_colrange()

void madness::DistributedMatrixDistribution::local_colrange ( int64_t & ilow,
int64_t & ihigh ) const
inline

Returns the inclusive range of column indices on this processor.

If there is no data on this processor it returns ilow=0 and ihigh=-1

Parameters
[out]ilowFirst column index on this processor (0 if no data)
[out]ihighLast column index on this processor (-1 if no data)

References ihi, and ilo.

◆ local_ihigh()

int64_t madness::DistributedMatrixDistribution::local_ihigh ( ) const
inline

Returns the last column index on this processor (-1 if no data present).

References ihi.

◆ local_ilow()

int64_t madness::DistributedMatrixDistribution::local_ilow ( ) const
inline

Returns the first column index on this processor (0 if no data present).

References ilo.

◆ local_jhigh()

int64_t madness::DistributedMatrixDistribution::local_jhigh ( ) const
inline

Returns the last row index on this processor (0 if no data present).

References jhi.

◆ local_jlow()

int64_t madness::DistributedMatrixDistribution::local_jlow ( ) const
inline

Returns the first row index on this processor (0 if no data present).

References jlo.

◆ local_rowdim()

int64_t madness::DistributedMatrixDistribution::local_rowdim ( ) const
inline

Returns the no. of row elements stored on this processor.

Returns
No. of row elements stored on this processor

References jdim.

◆ local_rowrange()

void madness::DistributedMatrixDistribution::local_rowrange ( int64_t & jlow,
int64_t & jhigh ) const
inline

Returns the inclusive range of row indices on this processor.

If there is no data on this processor it returns jlow=0 and jhigh=-1

Parameters
[out]jlowFirst row index on this processor (0 if no data)
[out]jhighLast row index on this processor (-1 if no data)

References jhi, and jlo.

◆ local_size()

int64_t madness::DistributedMatrixDistribution::local_size ( ) const
inline

Returns the total no. of elements stored on this processor.

Returns
Total no. of elements stored on this processor

References idim, and jdim.

Referenced by madness::DistributedMatrix< double >::copy_from_replicated(), and madness::DistributedMatrix< double >::copy_to_replicated().

◆ operator==()

bool madness::DistributedMatrixDistribution::operator== ( const DistributedMatrixDistribution & d) const
inline

◆ owner()

ProcessID madness::DistributedMatrixDistribution::owner ( int64_t i,
int64_t j ) const
inline

Returns the number of the process that owns element (i,j).

References coltile(), process_rowdim(), and rowtile().

◆ process_coldim()

int64_t madness::DistributedMatrixDistribution::process_coldim ( ) const
inline

Returns the no. of processors in the column dimension.

Returns
No. of processors in the column dimension

References Pcoldim.

Referenced by get_range(), and is_row_distributed().

◆ process_rowdim()

int64_t madness::DistributedMatrixDistribution::process_rowdim ( ) const
inline

Returns the no. of processors in the row dimension.

Returns
No. of processors in the rown dimension

References Prowdim.

Referenced by get_range(), is_column_distributed(), and owner().

◆ rowdim()

int64_t madness::DistributedMatrixDistribution::rowdim ( ) const
inline

Returns the row dimension of the matrix ... i.e., m for A(n,m).

Returns
Row dimension of the matrix ... i.e., m for A(n,m)

References m.

Referenced by madness::DistributedMatrix< double >::extract_columns().

◆ rowtile()

int64_t madness::DistributedMatrixDistribution::rowtile ( ) const
inline

◆ column_distributed_matrix_distribution

DistributedMatrixDistribution column_distributed_matrix_distribution ( World & world,
int64_t n,
int64_t m,
int64_t coltile )
friend

Generates distribution for an (n,m) matrix distributed by columns (row dimension is not distributed).

Quietly forces an even column tile size for ease of use in the systolic matrix algorithms

Parameters
[in]worldThe world
[in]nThe column (first) dimension
[in]mThe row (second) dimension
[in]coltileTile size for columns forced to be even (default is to use all processes)
Returns
An object encoding the dimension and distribution information

References DistributedMatrixDistribution(), coltile(), m, n, and madness::World::size().

◆ DistributedMatrix

template<typename T>
friend class DistributedMatrix
friend

References DistributedMatrix.

Referenced by DistributedMatrix.

◆ row_distributed_matrix_distribution

DistributedMatrixDistribution row_distributed_matrix_distribution ( World & world,
int64_t n,
int64_t m,
int64_t rowtile )
friend

Generates an (n,m) matrix distribution distributed by rows (column dimension is not distributed).

Parameters
[in]worldThe world
[in]nThe column (first) dimension
[in]mThe row (second) dimension
[in]rowtileTile size for row (default is to use all processes)
Returns
An object encoding the dimension and distribution information

References DistributedMatrixDistribution(), m, n, rowtile(), and madness::World::size().

Member Data Documentation

◆ idim

◆ ihi

◆ ilo

◆ jdim

◆ jhi

◆ jlo

◆ m

◆ n

◆ P

int64_t madness::DistributedMatrixDistribution::P
protected

◆ Pcol

int64_t madness::DistributedMatrixDistribution::Pcol
protected

Column of processor grid for this processor.

Referenced by DistributedMatrixDistribution(), DistributedMatrixDistribution(), clear(), and operator==().

◆ Pcoldim

int64_t madness::DistributedMatrixDistribution::Pcoldim
protected

Column dimension of processor grid.

Referenced by DistributedMatrixDistribution(), DistributedMatrixDistribution(), clear(), operator==(), and process_coldim().

◆ Prow

int64_t madness::DistributedMatrixDistribution::Prow
protected

Row of processor grid for this processor.

Referenced by DistributedMatrixDistribution(), DistributedMatrixDistribution(), clear(), and operator==().

◆ Prowdim

int64_t madness::DistributedMatrixDistribution::Prowdim
protected

◆ pworld

World* madness::DistributedMatrixDistribution::pworld
protected

◆ rank

ProcessID madness::DistributedMatrixDistribution::rank
protected

◆ tilem

int64_t madness::DistributedMatrixDistribution::tilem
protected

◆ tilen

int64_t madness::DistributedMatrixDistribution::tilen
protected

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