Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches

Multi matrices representation container. More...

#include <core/alien/core/impl/MultiMatrixImpl.h>

Inheritance diagram for Alien::MultiMatrixImpl:
Collaboration diagram for Alien::MultiMatrixImpl:

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 ISpacerowSpace () const
 Get the row space associated to the matrix.
const ISpacecolSpace () const
 Get the col space associated to the matrix.
const MatrixDistributiondistribution () const
 Get the matrix distribution.
const Blockblock () const
 Get uniform block datas.
const VBlockvblock () const
 Get variable block datas.
const VBlockrowBlock () const
 Get variable row block datas.
const VBlockcolBlock () const
 Get variable col block datas.
template<typename tag>
const AlgebraTraits< tag >::matrix_typeget () const
 Get a specific matrix implementation.
template<typename tag>
AlgebraTraits< tag >::matrix_typeget (const bool update_stamp)
 Get a specific matrix implementation.
template<typename tag>
void release () const
 Release a matrix implementation.
MultiMatrixImplclone () 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< ISpacem_row_space
 The matrix row space.
std::shared_ptr< ISpacem_col_space
 The matrix column space.
std::shared_ptr< MatrixDistributionm_distribution
 The matrix distribution.
MultiMatrixImplMap m_impls2
 The matrices container.
std::shared_ptr< Blockm_block
 The uniform block datas.
std::shared_ptr< VBlockm_rows_block
 The variable row block datas.
std::shared_ptr< VBlockm_cols_block
 The variable col block datas.

Detailed Description

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.

Member Typedef Documentation

◆ MultiMatrixImplMap

typedef std::map<BackEndId, IMatrixImpl*> Alien::MultiMatrixImpl::MultiMatrixImplMap
private

The type of the matrix container.

Definition at line 247 of file MultiMatrixImpl.h.

Constructor & Destructor Documentation

◆ MultiMatrixImpl() [1/3]

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

Here is the caller graph for this function:

◆ MultiMatrixImpl() [2/3]

Alien::MultiMatrixImpl::MultiMatrixImpl ( std::shared_ptr< ISpace > row_space,
std::shared_ptr< ISpace > col_space,
std::shared_ptr< MatrixDistribution > dist )

Constructor.

Parameters
[in]row_spaceThe row space of the matrix
[in]col_spaceThe column space of the matrix
[in]distThe 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.

◆ ~MultiMatrixImpl()

Alien::MultiMatrixImpl::~MultiMatrixImpl ( )
virtual

Free resources.

Reimplemented in Alien::CompositeKernel::MultiMatrixImpl.

Definition at line 84 of file MultiMatrixImpl.cc.

References free().

Here is the call graph for this function:

◆ MultiMatrixImpl() [3/3]

Alien::MultiMatrixImpl::MultiMatrixImpl ( const MultiMatrixImpl & impl)
protected

Copy constructor.

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

Here is the call graph for this function:

Member Function Documentation

◆ block()

const Block * Alien::MultiMatrixImpl::block ( ) const

Get uniform block datas.

Returns
The matrix block data, or a nullptr if the matrix is scalar or has variable blocks

Definition at line 155 of file MultiMatrixImpl.cc.

References m_block.

◆ clear()

void Alien::MultiMatrixImpl::clear ( )

Clear resources.

Definition at line 144 of file MultiMatrixImpl.cc.

References m_impls2.

Referenced by setBlockInfos().

Here is the caller graph for this function:

◆ clone()

MultiMatrixImpl * Alien::MultiMatrixImpl::clone ( ) const

Clone this object.

Returns
A clone of this object

Definition at line 194 of file MultiMatrixImpl.cc.

References get(), MultiMatrixImpl(), Alien::Timestamp::timestamp(), and Alien::Timestamp::updateTimestamp().

Here is the call graph for this function:

◆ colBlock()

const VBlock * Alien::MultiMatrixImpl::colBlock ( ) const

Get variable col block datas.

Returns
The matrix col block data, or a nullptr if the matrix is scalar or has uniform blocks

Definition at line 173 of file MultiMatrixImpl.cc.

References m_cols_block, and rowBlock().

Here is the call graph for this function:

◆ colSpace()

const ISpace & Alien::MultiMatrixImpl::colSpace ( ) const
inline

Get the col space associated to the matrix.

Returns
The col space

Definition at line 139 of file MultiMatrixImpl.h.

References m_col_space.

◆ distribution()

const MatrixDistribution & Alien::MultiMatrixImpl::distribution ( ) const
inline

Get the matrix distribution.

Returns
The matrix distribution

Definition at line 145 of file MultiMatrixImpl.h.

References m_distribution.

Referenced by Alien::LinearSolver< Tag >::solve().

Here is the caller graph for this function:

◆ free()

void Alien::MultiMatrixImpl::free ( )

Free resources.

Definition at line 132 of file MultiMatrixImpl.cc.

References m_impls2.

Referenced by setBlockInfos(), and ~MultiMatrixImpl().

Here is the caller graph for this function:

◆ get() [1/2]

◆ get() [2/2]

template<typename tag>
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

Parameters
[in]update_stampWhether or not the timestamp should be increased or not
Returns
The up to date matrix in the requested implementation

Definition at line 281 of file MultiMatrixImpl.h.

References Alien::IMatrixImpl::backend(), getImpl(), updateImpl(), and Alien::Timestamp::updateTimestamp().

Here is the call graph for this function:

◆ getImpl()

template<typename matrix_type>
IMatrixImpl *& Alien::MultiMatrixImpl::getImpl ( BackEndId backend) const
private

Get a specific matrix implementation.

Parameters
[in]backendThe id of the specific implementation
Returns
The matrix in the requested format

Definition at line 313 of file MultiMatrixImpl.h.

References m_impls2.

Referenced by get(), get(), and updateImpl().

Here is the caller graph for this function:

◆ insert()

template<typename matrix_type>
void Alien::MultiMatrixImpl::insert ( BackEndId backend,
matrix_type * m )
protected

Insert a matrix implementation in the multi matrix container.

Parameters
[in]backendThe implementation backend id
[in]mThe matrix to insert

Definition at line 331 of file MultiMatrixImpl.h.

References m_impls2.

◆ release()

template<typename tag>
void Alien::MultiMatrixImpl::release ( ) const

Release a matrix implementation.

Definition at line 300 of file MultiMatrixImpl.h.

References m_impls2.

◆ rowBlock()

const VBlock * Alien::MultiMatrixImpl::rowBlock ( ) const

Get variable row block datas.

Returns
The matrix row block data, or a nullptr if the matrix is scalar or has uniform blocks

Definition at line 164 of file MultiMatrixImpl.cc.

References m_rows_block.

Referenced by colBlock().

Here is the caller graph for this function:

◆ rowSpace()

const ISpace & Alien::MultiMatrixImpl::rowSpace ( ) const
inline

Get the row space associated to the matrix.

Returns
The row space

Definition at line 133 of file MultiMatrixImpl.h.

References m_row_space.

◆ setBlockInfos() [1/3]

void Alien::MultiMatrixImpl::setBlockInfos ( Arccore::Integer block_size)

Set uniform block information.

Parameters
[in]block_sizeThe size of the blocks

References clear(), free(), setBlockInfos(), setColBlockInfos(), and setRowBlockInfos().

Referenced by setBlockInfos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBlockInfos() [2/3]

void Alien::MultiMatrixImpl::setBlockInfos ( const Block * blocks)

Set uniform block information.

Parameters
[in]blocksThe block data

Definition at line 100 of file MultiMatrixImpl.cc.

References Alien::Block::clone(), and m_block.

Here is the call graph for this function:

◆ setBlockInfos() [3/3]

void Alien::MultiMatrixImpl::setBlockInfos ( const VBlock * blocks)

Set variable block information.

Parameters
[in]blocksThe block data

Definition at line 108 of file MultiMatrixImpl.cc.

References Alien::VBlock::clone(), and m_rows_block.

Here is the call graph for this function:

◆ setColBlockInfos()

void Alien::MultiMatrixImpl::setColBlockInfos ( const VBlock * blocks)

Set variable col block information.

Parameters
[in]blocksThe col block data

Definition at line 124 of file MultiMatrixImpl.cc.

References Alien::VBlock::clone(), and m_cols_block.

Referenced by setBlockInfos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRowBlockInfos()

void Alien::MultiMatrixImpl::setRowBlockInfos ( const VBlock * blocks)

Set variable row block information.

Parameters
[in]blocksThe row block data

Definition at line 116 of file MultiMatrixImpl.cc.

References Alien::VBlock::clone(), and m_rows_block.

Referenced by setBlockInfos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateImpl()

void Alien::MultiMatrixImpl::updateImpl ( IMatrixImpl * target) const
private

Update a matrix implementation.

Parameters
[in]targetThe 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vblock()

const VBlock * Alien::MultiMatrixImpl::vblock ( ) const

Get variable block datas.

Returns
The matrix block data, or a nullptr if the matrix is scalar or has uniform blocks

Definition at line 185 of file MultiMatrixImpl.cc.

References m_rows_block.

Member Data Documentation

◆ m_block

std::shared_ptr<Block> Alien::MultiMatrixImpl::m_block
private

The uniform block datas.

Definition at line 251 of file MultiMatrixImpl.h.

Referenced by block(), MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), and setBlockInfos().

◆ m_col_space

std::shared_ptr<ISpace> Alien::MultiMatrixImpl::m_col_space
private

The matrix column space.

Definition at line 243 of file MultiMatrixImpl.h.

Referenced by colSpace(), MultiMatrixImpl(), and MultiMatrixImpl().

◆ m_cols_block

std::shared_ptr<VBlock> Alien::MultiMatrixImpl::m_cols_block
private

The variable col block datas.

Definition at line 255 of file MultiMatrixImpl.h.

Referenced by colBlock(), MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), and setColBlockInfos().

◆ m_distribution

std::shared_ptr<MatrixDistribution> Alien::MultiMatrixImpl::m_distribution
private

The matrix distribution.

Definition at line 245 of file MultiMatrixImpl.h.

Referenced by distribution(), MultiMatrixImpl(), and MultiMatrixImpl().

◆ m_impls2

MultiMatrixImplMap Alien::MultiMatrixImpl::m_impls2
mutableprivate

The matrices container.

Definition at line 249 of file MultiMatrixImpl.h.

Referenced by clear(), free(), getImpl(), insert(), release(), and updateImpl().

◆ m_row_space

std::shared_ptr<ISpace> Alien::MultiMatrixImpl::m_row_space
private

The matrix row space.

Definition at line 241 of file MultiMatrixImpl.h.

Referenced by MultiMatrixImpl(), MultiMatrixImpl(), and rowSpace().

◆ m_rows_block

std::shared_ptr<VBlock> Alien::MultiMatrixImpl::m_rows_block
private

The variable row block datas.

Definition at line 253 of file MultiMatrixImpl.h.

Referenced by MultiMatrixImpl(), MultiMatrixImpl(), MultiMatrixImpl(), rowBlock(), setBlockInfos(), setRowBlockInfos(), and vblock().


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