Multi matrices representation container. More...
#include <core/alien/core/impl/MultiMatrixImpl.h>
Public Member Functions | |
| MultiMatrixImpl () | |
| Default constructor. | |
| MultiMatrixImpl (std::shared_ptr< ISpace > row_space, std::shared_ptr< ISpace > col_space, std::shared_ptr< MatrixDistribution > dist) | |
| Constructor. | |
| virtual | ~MultiMatrixImpl () |
| Free resources. | |
| void | setBlockInfos (Arccore::Integer block_size) |
| Set uniform block information. | |
| void | setBlockInfos (const Block *blocks) |
| Set uniform block information. | |
| void | setBlockInfos (const VBlock *blocks) |
| Set variable block information. | |
| void | setRowBlockInfos (const VBlock *blocks) |
| Set variable row block information. | |
| void | setColBlockInfos (const VBlock *blocks) |
| Set variable col block information. | |
| void | free () |
| Free resources. | |
| void | clear () |
| Clear resources. | |
| const ISpace & | rowSpace () const |
| Get the row space associated to the matrix. | |
| const ISpace & | colSpace () const |
| Get the col space associated to the matrix. | |
| const MatrixDistribution & | distribution () const |
| Get the matrix distribution. | |
| const Block * | block () const |
| Get uniform block datas. | |
| const VBlock * | vblock () const |
| Get variable block datas. | |
| const VBlock * | rowBlock () const |
| Get variable row block datas. | |
| const VBlock * | colBlock () const |
| Get variable col block datas. | |
| template<typename tag> | |
| const AlgebraTraits< tag >::matrix_type & | get () const |
| Get a specific matrix implementation. | |
| template<typename tag> | |
| AlgebraTraits< tag >::matrix_type & | get (const bool update_stamp) |
| Get a specific matrix implementation. | |
| template<typename tag> | |
| void | release () const |
| Release a matrix implementation. | |
| MultiMatrixImpl * | clone () const |
| Clone this object. | |
| Public Member Functions inherited from Alien::TimestampMng | |
| TimestampMng (const TimestampMng &tm) | |
| Int64 | timestamp () const |
| Valeur du timestamp de référence. | |
| void | updateTimestamp (Timestamp *ts) const |
| Requête de mise à jour d'un Timestamp. | |
| void | addObserver (std::shared_ptr< ITimestampObserver > observer) |
| void | clearObservers () |
| Public Member Functions inherited from Alien::UserFeatureMng | |
| bool | hasFeature (const String &feature) const |
| void | setFeature (const String &feature) |
| Public Member Functions inherited from Alien::ObjectWithTrace | |
| template<typename T> | |
| void | alien_info (T &&t) const |
| template<typename T> | |
| void | alien_debug (T &&t) const |
| template<typename T> | |
| void | alien_warning (T &&t) const |
| template<typename T> | |
| void | alien_fatal (T &&t) const |
| ITraceMng * | traceMng () const |
| Public Member Functions inherited from Alien::ObjectWithLock | |
| void | lock () |
| Verrouille l'objet. | |
| void | unlock () |
| Dévérouille l'objet. | |
| bool | isLocked () const |
| Retourne si l'objet est vérouillé | |
Protected Member Functions | |
| MultiMatrixImpl (const MultiMatrixImpl &impl) | |
| Copy constructor. | |
| template<typename matrix_type> | |
| void | insert (BackEndId backend, matrix_type *m) |
| Insert a matrix implementation in the multi matrix container. | |
| Protected Member Functions inherited from Alien::ObjectWithTrace | |
| TraceMessage | cout () const |
Private Types | |
| typedef std::map< BackEndId, IMatrixImpl * > | MultiMatrixImplMap |
| The type of the matrix container. | |
Private Member Functions | |
| template<typename matrix_type> | |
| IMatrixImpl *& | getImpl (BackEndId backend) const |
| Get a specific matrix implementation. | |
| void | updateImpl (IMatrixImpl *target) const |
| Update a matrix implementation. | |
Private Attributes | |
| std::shared_ptr< ISpace > | m_row_space |
| The matrix row space. | |
| std::shared_ptr< ISpace > | m_col_space |
| The matrix column space. | |
| std::shared_ptr< MatrixDistribution > | m_distribution |
| The matrix distribution. | |
| MultiMatrixImplMap | m_impls2 |
| The matrices container. | |
| std::shared_ptr< Block > | m_block |
| The uniform block datas. | |
| std::shared_ptr< VBlock > | m_rows_block |
| The variable row block datas. | |
| std::shared_ptr< VBlock > | m_cols_block |
| The variable col block datas. | |
Multi matrices representation container.
This class allows to store and access several implementations of the same matrix. It also stores all shared information between those implementations such as distribution, or block information. It provides two accessors, one to access the matrix in read-only mode, that does not increase the timestamp and one in read-write mode, that can increase the timestamp. The former implementation might therefore become the up to date matrix.
While requesting a matrix in a specific format, if the up to date matrix is not in that specific format, the up-to-date matrix will be converted, provided a converter exists.
Definition at line 65 of file MultiMatrixImpl.h.
|
private |
The type of the matrix container.
Definition at line 247 of file MultiMatrixImpl.h.
| Alien::MultiMatrixImpl::MultiMatrixImpl | ( | ) |
Default constructor.
Definition at line 42 of file MultiMatrixImpl.cc.
References m_block, m_cols_block, and m_rows_block.
Referenced by clone(), and MultiMatrixImpl().
| Alien::MultiMatrixImpl::MultiMatrixImpl | ( | std::shared_ptr< ISpace > | row_space, |
| std::shared_ptr< ISpace > | col_space, | ||
| std::shared_ptr< MatrixDistribution > | dist ) |
Constructor.
| [in] | row_space | The row space of the matrix |
| [in] | col_space | The column space of the matrix |
| [in] | dist | The distribution of the matrix |
Definition at line 51 of file MultiMatrixImpl.cc.
References m_block, m_col_space, m_cols_block, m_distribution, m_row_space, and m_rows_block.
|
virtual |
Free resources.
Reimplemented in Alien::CompositeKernel::MultiMatrixImpl.
Definition at line 84 of file MultiMatrixImpl.cc.
References free().
|
protected |
Copy constructor.
| [in] | Internal data structure access. | The MultiMatrixImpl to copy |
Definition at line 64 of file MultiMatrixImpl.cc.
References m_block, m_col_space, m_cols_block, m_distribution, m_row_space, m_rows_block, and MultiMatrixImpl().
| const Block * Alien::MultiMatrixImpl::block | ( | ) | const |
Get uniform block datas.
Definition at line 155 of file MultiMatrixImpl.cc.
References m_block.
| void Alien::MultiMatrixImpl::clear | ( | ) |
Clear resources.
Definition at line 144 of file MultiMatrixImpl.cc.
References m_impls2.
Referenced by setBlockInfos().
| MultiMatrixImpl * Alien::MultiMatrixImpl::clone | ( | ) | const |
Clone this object.
Definition at line 194 of file MultiMatrixImpl.cc.
References get(), MultiMatrixImpl(), Alien::Timestamp::timestamp(), and Alien::Timestamp::updateTimestamp().
| const VBlock * Alien::MultiMatrixImpl::colBlock | ( | ) | const |
Get variable col block datas.
Definition at line 173 of file MultiMatrixImpl.cc.
References m_cols_block, and rowBlock().
|
inline |
Get the col space associated to the matrix.
Definition at line 139 of file MultiMatrixImpl.h.
References m_col_space.
|
inline |
Get the matrix distribution.
Definition at line 145 of file MultiMatrixImpl.h.
References m_distribution.
Referenced by Alien::LinearSolver< Tag >::solve().
| void Alien::MultiMatrixImpl::free | ( | ) |
Free resources.
Definition at line 132 of file MultiMatrixImpl.cc.
References m_impls2.
Referenced by setBlockInfos(), and ~MultiMatrixImpl().
| const AlgebraTraits< tag >::matrix_type & Alien::MultiMatrixImpl::get | ( | ) | const |
Get a specific matrix implementation.
Might induce a conversion, depending on the up to date and requested matrix implementation
Definition at line 263 of file MultiMatrixImpl.h.
References Alien::IMatrixImpl::backend(), getImpl(), and updateImpl().
Referenced by Alien::LinearAlgebraExpr< Tag, TagV >::add(), clone(), Alien::SchurOp::computePrimarySystem(), Alien::LinearAlgebraExpr< Tag, TagV >::copy(), Alien::LinearAlgebra< Tag, TagV >::diagonal(), Alien::LinearAlgebraExpr< Tag, TagV >::diagonal(), Alien::LinearAlgebra< Tag, TagV >::dump(), Alien::LinearAlgebraExpr< Tag, TagV >::dump(), Alien::Move::MatrixData::impl(), Alien::Move::MatrixData::impl(), Alien::LinearAlgebra< Tag, TagV >::mult(), Alien::LinearAlgebraExpr< Tag, TagV >::mult(), Alien::LinearAlgebraExpr< Tag, TagV >::mult(), Alien::LinearAlgebraExpr< Tag, TagV >::norm2(), Alien::NormalizeOpt::normalize(), Alien::NormalizeOpt::normalize(), Alien::Redistributor::redistribute(), Alien::LinearAlgebraExpr< Tag, TagV >::scal(), and Alien::LinearSolver< Tag >::solve().
| AlgebraTraits< tag >::matrix_type & Alien::MultiMatrixImpl::get | ( | const bool | update_stamp | ) |
Get a specific matrix implementation.
Might induce a conversion, depending on the up to date and requested matrix implementation
| [in] | update_stamp | Whether or not the timestamp should be increased or not |
Definition at line 281 of file MultiMatrixImpl.h.
References Alien::IMatrixImpl::backend(), getImpl(), updateImpl(), and Alien::Timestamp::updateTimestamp().
|
private |
Get a specific matrix implementation.
| [in] | backend | The id of the specific implementation |
Definition at line 313 of file MultiMatrixImpl.h.
References m_impls2.
Referenced by get(), get(), and updateImpl().
|
protected |
Insert a matrix implementation in the multi matrix container.
| [in] | backend | The implementation backend id |
| [in] | m | The matrix to insert |
Definition at line 331 of file MultiMatrixImpl.h.
References m_impls2.
| void Alien::MultiMatrixImpl::release | ( | ) | const |
Release a matrix implementation.
Definition at line 300 of file MultiMatrixImpl.h.
References m_impls2.
| const VBlock * Alien::MultiMatrixImpl::rowBlock | ( | ) | const |
Get variable row block datas.
Definition at line 164 of file MultiMatrixImpl.cc.
References m_rows_block.
Referenced by colBlock().
|
inline |
Get the row space associated to the matrix.
Definition at line 133 of file MultiMatrixImpl.h.
References m_row_space.
| void Alien::MultiMatrixImpl::setBlockInfos | ( | Arccore::Integer | block_size | ) |
Set uniform block information.
| [in] | block_size | The size of the blocks |
References clear(), free(), setBlockInfos(), setColBlockInfos(), and setRowBlockInfos().
Referenced by setBlockInfos().
| void Alien::MultiMatrixImpl::setBlockInfos | ( | const Block * | blocks | ) |
Set uniform block information.
| [in] | blocks | The block data |
Definition at line 100 of file MultiMatrixImpl.cc.
References Alien::Block::clone(), and m_block.
| void Alien::MultiMatrixImpl::setBlockInfos | ( | const VBlock * | blocks | ) |
Set variable block information.
| [in] | blocks | The block data |
Definition at line 108 of file MultiMatrixImpl.cc.
References Alien::VBlock::clone(), and m_rows_block.
| void Alien::MultiMatrixImpl::setColBlockInfos | ( | const VBlock * | blocks | ) |
Set variable col block information.
| [in] | blocks | The col block data |
Definition at line 124 of file MultiMatrixImpl.cc.
References Alien::VBlock::clone(), and m_cols_block.
Referenced by setBlockInfos().
| void Alien::MultiMatrixImpl::setRowBlockInfos | ( | const VBlock * | blocks | ) |
Set variable row block information.
| [in] | blocks | The row block data |
Definition at line 116 of file MultiMatrixImpl.cc.
References Alien::VBlock::clone(), and m_rows_block.
Referenced by setBlockInfos().
|
private |
Update a matrix implementation.
| [in] | target | The targeted implementation |
Definition at line 226 of file MultiMatrixImpl.cc.
References Alien::IMatrixImpl::backend(), Alien::Timestamp::copyTimestamp(), Alien::MatrixConverterRegisterer::getConverter(), getImpl(), m_impls2, Alien::Timestamp::timestamp(), and Alien::TimestampMng::timestamp().
Referenced by get(), and get().
| const VBlock * Alien::MultiMatrixImpl::vblock | ( | ) | const |
Get variable block datas.
Definition at line 185 of file MultiMatrixImpl.cc.
References m_rows_block.
|
private |
The uniform block datas.
Definition at line 251 of file MultiMatrixImpl.h.
Referenced by block(), MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), and setBlockInfos().
|
private |
The matrix column space.
Definition at line 243 of file MultiMatrixImpl.h.
Referenced by colSpace(), MultiMatrixImpl(), and MultiMatrixImpl().
|
private |
The variable col block datas.
Definition at line 255 of file MultiMatrixImpl.h.
Referenced by colBlock(), MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), and setColBlockInfos().
|
private |
The matrix distribution.
Definition at line 245 of file MultiMatrixImpl.h.
Referenced by distribution(), MultiMatrixImpl(), and MultiMatrixImpl().
|
mutableprivate |
The matrices container.
Definition at line 249 of file MultiMatrixImpl.h.
Referenced by clear(), free(), getImpl(), insert(), release(), and updateImpl().
|
private |
The matrix row space.
Definition at line 241 of file MultiMatrixImpl.h.
Referenced by MultiMatrixImpl(), MultiMatrixImpl(), and rowSpace().
|
private |
The variable row block datas.
Definition at line 253 of file MultiMatrixImpl.h.
Referenced by MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), rowBlock(), setBlockInfos(), setRowBlockInfos(), and vblock().