MADNESS  version 0.9
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
madness::DistributedMatrixDistribution Class Reference

#include <distributed_matrix.h>

Inheritance diagram for madness::DistributedMatrixDistribution:
Inheritance graph
[legend]
Collaboration diagram for madness::DistributedMatrixDistribution:
Collaboration graph
[legend]

Public Member Functions

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

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) More...
 

Protected Attributes

Worldpworld
 
int64_t P
 
ProcessID rank
 
int64_t n
 
int64_t m
 
int64_t tilen
 
int64_t tilem
 
int64_t Pcoldim
 
int64_t Prowdim
 
int64_t Pcol
 
int64_t Prow
 
int64_t ilo
 
int64_t ihi
 
int64_t jlo
 
int64_t jhi
 
int64_t idim
 
int64_t jdim
 

Friends

template<typename T >
class DistributedMatrix
 
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) More...
 
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) More...
 

Constructor & Destructor Documentation

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
madness::DistributedMatrixDistribution::DistributedMatrixDistribution ( )
inline

Default constructor makes an invalid distribution.

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

Member Function Documentation

void madness::DistributedMatrixDistribution::clear ( )
inline

Resets state to same as default constructor.

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

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.

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

Returns the column tile size.

Returns
Column tile size

References tilen.

Referenced by owner().

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

Returns the distribution (aka *this)

Referenced by madness::SCF::kinetic_energy_matrix().

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().

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 mpfr::min(), pi, process_coldim(), process_rowdim(), Prowdim, tilem, and tilen.

Referenced by get_colrange(), and 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().

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

Returns the associated world.

Returns
The world

References pworld.

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().

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().

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.

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.

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

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

References ihi.

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

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

References ilo.

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

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

References jhi.

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

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

References jlo.

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.

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.

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 jdim.

bool madness::DistributedMatrixDistribution::operator== ( const DistributedMatrixDistribution d) const
inline
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().

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().

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().

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.

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

Returns the row tile size.

Returns
Row tile size

References tilem.

Referenced by owner().

Friends And Related Function Documentation

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
template<typename T >
friend class DistributedMatrix
friend
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

Member Data Documentation

int64_t madness::DistributedMatrixDistribution::idim
protected

Referenced by local_coldim(), and operator==().

int64_t madness::DistributedMatrixDistribution::ihi
protected
int64_t madness::DistributedMatrixDistribution::ilo
protected
int64_t madness::DistributedMatrixDistribution::jdim
protected
int64_t madness::DistributedMatrixDistribution::jhi
protected
int64_t madness::DistributedMatrixDistribution::jlo
protected
int64_t madness::DistributedMatrixDistribution::m
protected

Referenced by operator==(), and rowdim().

int64_t madness::DistributedMatrixDistribution::n
protected

Referenced by coldim(), and operator==().

int64_t madness::DistributedMatrixDistribution::P
protected

Referenced by operator==().

int64_t madness::DistributedMatrixDistribution::Pcol
protected

Referenced by operator==().

int64_t madness::DistributedMatrixDistribution::Pcoldim
protected

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

int64_t madness::DistributedMatrixDistribution::Prow
protected

Referenced by operator==().

int64_t madness::DistributedMatrixDistribution::Prowdim
protected
World* madness::DistributedMatrixDistribution::pworld
protected

Referenced by get_world(), and operator==().

ProcessID madness::DistributedMatrixDistribution::rank
protected

Referenced by operator==().

int64_t madness::DistributedMatrixDistribution::tilem
protected

Referenced by get_range(), operator==(), and rowtile().

int64_t madness::DistributedMatrixDistribution::tilen
protected

Referenced by coltile(), get_range(), and operator==().


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