LAMA
|
This class provides static utility methods for splitting matrix storage into a local and a halo part. More...
#include <StorageMethods.hpp>
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 |
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.
typedef T lama::StorageMethods< T >::ValueType |
This is the type of the matrix values.
void lama::_StorageMethods::buildHalo | ( | class Halo & | halo, |
LAMAArray< IndexType > & | haloJA, | ||
IndexType & | haloSize, | ||
const class Distribution & | colDist | ||
) | [static, inherited] |
References lama::HaloBuilder::build(), lama::Halo::getMap(), LAMA_ASSERT_DEBUG, and lama::_LAMAArray::size().
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] |
Exchange rows by halo.
Build CSR storage with all rows given by the required indexes; implies sending the rows given by the provides indexes of halo.
References lama::Communicator::exchangeByPlan(), lama::Redistributor::gatherV(), lama::ReadAccess< T >::get(), lama::WriteAccess< T >::get(), lama::Halo::getProvidesIndexes(), lama::Halo::getProvidesPlan(), lama::Halo::getRequiredPlan(), lama::OpenMPCSRUtils::offsets2sizesGather(), lama::ReadAccess< T >::release(), lama::WriteAccess< T >::resize(), lama::_LAMAArray::size(), lama::OpenMPCSRUtils::sizes2offsets(), and lama::CommunicationPlan::totalQuantity().
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.
[in] | numKeepDiagonals | number 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
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.
[out] | localIA,localJA,localValues | will contain the local CSR storage |
[in] | globalIA,globalJA,globalValues | contain the global CSR storage |
[in] | row | distribution 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().
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.
[out] | globalIA,globalJA,globalValues | contain the global CSR storage |
[in] | localIA,localJA,localValues | contains the local CSR storage on this proc |
[in] | row | distribution 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().
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.
[out] | globalIA,globalJA,globalValues | contain the global CSR storage |
[in] | localIA,localJA,localValues | contains the local CSR storage on this proc |
[in] | row | distribution 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().
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.
localIA,localJA,localValues | will contain the local CSR storage | |
haloIA,haloJA,haloValues | will contain the halo CSR storage | |
[in] | csrIA,csrJA,csrValues | is the storage to split |
[in] | column | distribution used for splitting |
[in] | optional | row 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().