LAMA
lama::StorageMethods< T > Class Template Reference

This class provides static utility methods for splitting matrix storage into a local and a halo part. More...

#include <StorageMethods.hpp>

Inheritance diagram for lama::StorageMethods< T >:

Public Types

typedef T ValueType
 This is the type of the matrix values.

Static Public Member Functions

static void localizeCSR (LAMAArray< IndexType > &localIA, LAMAArray< IndexType > &localJA, LAMAArray< ValueType > &locaValues, const LAMAArray< IndexType > &globalIA, const LAMAArray< IndexType > &globalJA, const LAMAArray< ValueType > &globalValues, const class Distribution &rowDist)
 Localize CSR storage for row distribution.
static void replicateCSR (LAMAArray< IndexType > &globalIA, LAMAArray< IndexType > &globalJA, LAMAArray< ValueType > &globalValues, const LAMAArray< IndexType > &localIA, const LAMAArray< IndexType > &localJA, const LAMAArray< ValueType > &localValues, const class Distribution &rowDist)
 Build global CSR storage for row distributed CSR storages.
static void redistributeCSR (LAMAArray< IndexType > &targetIA, LAMAArray< IndexType > &targetJA, LAMAArray< ValueType > &targetValues, const LAMAArray< IndexType > &sourceIA, const LAMAArray< IndexType > &sourceJA, const LAMAArray< ValueType > &sourceValues, const class Redistributor &redistributor)
 Build global CSR storage for row distributed CSR storages.
static void exchangeHaloCSR (LAMAArray< IndexType > &targetIA, LAMAArray< IndexType > &targetJA, LAMAArray< ValueType > &targetValues, const LAMAArray< IndexType > &sourceIA, const LAMAArray< IndexType > &sourceJA, const LAMAArray< ValueType > &sourceValues, const class Halo &halo, const class Communicator &comm)
 Exchange rows by halo.
static void splitCSR (LAMAArray< IndexType > &localIA, LAMAArray< IndexType > &localJA, LAMAArray< ValueType > &locaValues, LAMAArray< IndexType > &haloIA, LAMAArray< IndexType > &haloJA, LAMAArray< ValueType > &haloValues, const LAMAArray< IndexType > &csrIA, const LAMAArray< IndexType > &csrJA, const LAMAArray< ValueType > &csrValues, const class Distribution &colDist, const class Distribution *rowDist)
 Splitting CSR storage.
static void joinCSR (LAMAArray< IndexType > &csrIA, LAMAArray< IndexType > &csrJA, LAMAArray< ValueType > &csrValues, const LAMAArray< IndexType > &localIA, const LAMAArray< IndexType > &localJA, const LAMAArray< ValueType > &localValues, const LAMAArray< IndexType > &haloIA, const LAMAArray< IndexType > &haloJA, const LAMAArray< ValueType > &haloValues, const IndexType numKeepDiagonals)
 Static method that joins rows of two data sets of CSR data.
static void buildHalo (class Halo &halo, LAMAArray< IndexType > &haloJA, IndexType &haloSize, const class Distribution &colDist)

Protected Member Functions

 LAMA_LOG_DECL_STATIC_LOGGER (logger)
 logger for this matrix format

Detailed Description

template<typename T>
class lama::StorageMethods< T >

This class provides static utility methods for splitting matrix storage into a local and a halo part.

Due to a column distribution the storage is divided into a local part (having the local columns) and a halo part (for the non-local columns). Furthermore, it builds the halo for exchanging the non-local values between processors.


Member Typedef Documentation

template<typename T >
typedef T lama::StorageMethods< T >::ValueType

This is the type of the matrix values.


Member Function Documentation

void lama::_StorageMethods::buildHalo ( class Halo halo,
LAMAArray< IndexType > &  haloJA,
IndexType haloSize,
const class Distribution colDist 
) [static, inherited]
template<typename T >
void lama::StorageMethods< ValueType >::exchangeHaloCSR ( LAMAArray< IndexType > &  targetIA,
LAMAArray< IndexType > &  targetJA,
LAMAArray< ValueType > &  targetValues,
const LAMAArray< IndexType > &  sourceIA,
const LAMAArray< IndexType > &  sourceJA,
const LAMAArray< ValueType > &  sourceValues,
const class Halo halo,
const class Communicator comm 
) [static]
template<typename ValueType >
void lama::StorageMethods< ValueType >::joinCSR ( LAMAArray< IndexType > &  csrIA,
LAMAArray< IndexType > &  csrJA,
LAMAArray< ValueType > &  csrValues,
const LAMAArray< IndexType > &  localIA,
const LAMAArray< IndexType > &  localJA,
const LAMAArray< ValueType > &  localValues,
const LAMAArray< IndexType > &  haloIA,
const LAMAArray< IndexType > &  haloJA,
const LAMAArray< ValueType > &  haloValues,
const IndexType  numKeepDiagonals 
) [static]

Static method that joins rows of two data sets of CSR data.

Parameters:
[in]numKeepDiagonalsnumber of rows where diagonal element of local should be taken at first

The data of one row is sorted according to the column indexes.

References LAMA_ASSERT_EQUAL_DEBUG, LAMA_ASSERT_EQUAL_ERROR, LAMA_ASSERT_ERROR, LAMA_THROWEXCEPTION, lama::_LAMAArray::size(), and lama::OpenMPCSRUtils::sizes2offsets().

lama::_StorageMethods::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [protected, inherited]

logger for this matrix format

template<typename T >
void lama::StorageMethods< ValueType >::localizeCSR ( LAMAArray< IndexType > &  localIA,
LAMAArray< IndexType > &  localJA,
LAMAArray< ValueType > &  locaValues,
const LAMAArray< IndexType > &  globalIA,
const LAMAArray< IndexType > &  globalJA,
const LAMAArray< ValueType > &  globalValues,
const class Distribution rowDist 
) [static]

Localize CSR storage for row distribution.

Parameters:
[out]localIA,localJA,localValueswill contain the local CSR storage
[in]globalIA,globalJA,globalValuescontain the global CSR storage
[in]rowdistribution so only local rows of CSR storage are taken

References lama::WriteAccess< T >::get(), lama::Distribution::getGlobalSize(), lama::Distribution::getLocalSize(), LAMA_ASSERT_DEBUG, LAMA_ASSERT_EQUAL_ERROR, lama::Distribution::local2global(), lama::_LAMAArray::size(), and lama::OpenMPCSRUtils::sizes2offsets().

template<typename T >
void lama::StorageMethods< ValueType >::redistributeCSR ( LAMAArray< IndexType > &  targetIA,
LAMAArray< IndexType > &  targetJA,
LAMAArray< ValueType > &  targetValues,
const LAMAArray< IndexType > &  sourceIA,
const LAMAArray< IndexType > &  sourceJA,
const LAMAArray< ValueType > &  sourceValues,
const class Redistributor redistributor 
) [static]

Build global CSR storage for row distributed CSR storages.

Parameters:
[out]globalIA,globalJA,globalValuescontain the global CSR storage
[in]localIA,localJA,localValuescontains the local CSR storage on this proc
[in]rowdistribution specifies the row distribution of the local CSR stroage

References lama::Redistributor::buildRowPlans(), lama::ReadAccess< T >::get(), lama::WriteAccess< T >::get(), lama::Redistributor::getSourceLocalSize(), lama::Redistributor::getTargetLocalSize(), LAMA_ASSERT_EQUAL_ERROR, lama::OpenMPCSRUtils::offsets2sizes(), lama::Redistributor::redistribute(), lama::Redistributor::redistributeV(), lama::WriteAccess< T >::resize(), lama::_LAMAArray::size(), and lama::OpenMPCSRUtils::sizes2offsets().

template<typename T >
void lama::StorageMethods< ValueType >::replicateCSR ( LAMAArray< IndexType > &  globalIA,
LAMAArray< IndexType > &  globalJA,
LAMAArray< ValueType > &  globalValues,
const LAMAArray< IndexType > &  localIA,
const LAMAArray< IndexType > &  localJA,
const LAMAArray< ValueType > &  localValues,
const class Distribution rowDist 
) [static]

Build global CSR storage for row distributed CSR storages.

Parameters:
[out]globalIA,globalJA,globalValuescontain the global CSR storage
[in]localIA,localJA,localValuescontains the local CSR storage on this proc
[in]rowdistribution specifies the row distribution of the local CSR stroage

References lama::ReadAccess< T >::get(), lama::WriteAccess< T >::get(), lama::Distribution::getCommunicator(), lama::Distribution::getGlobalSize(), lama::Distribution::getLocalSize(), LAMA_ASSERT_EQUAL_ERROR, lama::OpenMPCSRUtils::offsets2sizes(), lama::Distribution::replicate(), lama::_LAMAArray::size(), and lama::OpenMPCSRUtils::sizes2offsets().

template<typename T >
void lama::StorageMethods< ValueType >::splitCSR ( LAMAArray< IndexType > &  localIA,
LAMAArray< IndexType > &  localJA,
LAMAArray< ValueType > &  locaValues,
LAMAArray< IndexType > &  haloIA,
LAMAArray< IndexType > &  haloJA,
LAMAArray< ValueType > &  haloValues,
const LAMAArray< IndexType > &  csrIA,
const LAMAArray< IndexType > &  csrJA,
const LAMAArray< ValueType > &  csrValues,
const class Distribution colDist,
const class Distribution rowDist 
) [static]

Splitting CSR storage.

Parameters:
localIA,localJA,localValueswill contain the local CSR storage
haloIA,haloJA,haloValueswill contain the halo CSR storage
[in]csrIA,csrJA,csrValuesis the storage to split
[in]columndistribution used for splitting
[in]optionalrow distribution so only local rows of CSR storage are taken

The halo CSR storage will still contain the global indexes.

References lama::WriteAccess< T >::get(), lama::Distribution::getLocalSize(), lama::Distribution::global2local(), lama::Distribution::isLocal(), LAMA_ASSERT_DEBUG, lama::Distribution::local2global(), lama::nIndex, lama::_LAMAArray::size(), and lama::OpenMPCSRUtils::sizes2offsets().


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