ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
Public Member Functions | Protected Attributes | Friends | List of all members
ryujin::SparsityPatternSIMD< simd_length > Class Template Reference

#include <source/sparse_matrix_simd.h>

Collaboration diagram for ryujin::SparsityPatternSIMD< simd_length >:
Collaboration graph
[legend]

Public Member Functions

 SparsityPatternSIMD ()
 
 SparsityPatternSIMD (const unsigned int n_internal_dofs, const dealii::DynamicSparsityPattern &sparsity, const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &partitioner)
 
void reinit (const unsigned int n_internal_dofs, const dealii::DynamicSparsityPattern &sparsity, const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &partitioner)
 
unsigned int stride_of_row (const unsigned int row) const
 
const unsigned int * columns (const unsigned int row) const
 
unsigned int row_length (const unsigned int row) const
 
unsigned int n_rows () const
 
std::size_t n_nonzero_elements () const
 

Protected Attributes

unsigned int n_internal_dofs
 
unsigned int n_locally_owned_dofs
 
std::shared_ptr< const dealii::Utilities::MPI::Partitioner > partitioner
 
dealii::AlignedVector< std::size_t > row_starts
 
dealii::AlignedVector< unsigned int > column_indices
 
dealii::AlignedVector< unsigned int > indices_transposed
 
std::vector< std::pair< unsigned int, unsigned int > > entries_to_be_sent
 
std::vector< std::pair< unsigned int, unsigned int > > send_targets
 
std::vector< std::pair< unsigned int, unsigned int > > receive_targets
 
MPI_Comm mpi_communicator
 

Friends

template<typename , int , int >
class SparseMatrixSIMD
 

Detailed Description

template<int simd_length>
class ryujin::SparsityPatternSIMD< simd_length >

A specialized sparsity pattern for efficient vectorized SIMD access.

In the vectorized row index region [0, n_internal_dofs) we store data as an array-of-struct-of-array type as follows:

For the non-vectorized row index region [n_internal_dofs, n_locally_relevant_dofs) we store the matrix in CSR format (equivalent to the static dealii::SparsityPattern).

Definition at line 63 of file sparse_matrix_simd.h.

Constructor & Destructor Documentation

◆ SparsityPatternSIMD() [1/2]

template<int simd_length>
ryujin::SparsityPatternSIMD< simd_length >::SparsityPatternSIMD

Default constructor.

Definition at line 17 of file sparse_matrix_simd.template.h.

◆ SparsityPatternSIMD() [2/2]

template<int simd_length>
ryujin::SparsityPatternSIMD< simd_length >::SparsityPatternSIMD ( const unsigned int  n_internal_dofs,
const dealii::DynamicSparsityPattern &  sparsity,
const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &  partitioner 
)

Constructor taking a sparsity pattern template, an MPI partitioner and the number of (regular) internal dofs as an argument. The constructor calls SparsityPatternSIMD::reinit() internally.

Definition at line 26 of file sparse_matrix_simd.template.h.

References ryujin::SparsityPatternSIMD< simd_length >::n_internal_dofs, ryujin::SparsityPatternSIMD< simd_length >::partitioner, and ryujin::SparsityPatternSIMD< simd_length >::reinit().

Member Function Documentation

◆ reinit()

template<int simd_length>
void ryujin::SparsityPatternSIMD< simd_length >::reinit ( const unsigned int  n_internal_dofs,
const dealii::DynamicSparsityPattern &  sparsity,
const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &  partitioner 
)

Reinit function that reinitializes the SIMD sparsity pattern for a given sparsity pattern template, an MPI partitioner and the number of (regular) internal dofs.

Definition at line 39 of file sparse_matrix_simd.template.h.

Referenced by ryujin::SparsityPatternSIMD< simd_length >::SparsityPatternSIMD().

◆ stride_of_row()

template<int simd_length>
DEAL_II_ALWAYS_INLINE unsigned int ryujin::SparsityPatternSIMD< simd_length >::stride_of_row ( const unsigned int  row) const
inline

Return the "stride size" of a given row index. The function returns simd_length for all indices in the range [0, n_internal_dofs) and 1 otherwise.

Definition at line 313 of file sparse_matrix_simd.h.

◆ columns()

template<int simd_length>
DEAL_II_ALWAYS_INLINE const unsigned int * ryujin::SparsityPatternSIMD< simd_length >::columns ( const unsigned int  row) const
inline

Definition at line 326 of file sparse_matrix_simd.h.

◆ row_length()

template<int simd_length>
DEAL_II_ALWAYS_INLINE unsigned int ryujin::SparsityPatternSIMD< simd_length >::row_length ( const unsigned int  row) const
inline

Definition at line 340 of file sparse_matrix_simd.h.

◆ n_rows()

template<int simd_length>
DEAL_II_ALWAYS_INLINE unsigned int ryujin::SparsityPatternSIMD< simd_length >::n_rows
inline

Definition at line 355 of file sparse_matrix_simd.h.

◆ n_nonzero_elements()

template<int simd_length>
DEAL_II_ALWAYS_INLINE std::size_t ryujin::SparsityPatternSIMD< simd_length >::n_nonzero_elements
inline

Friends And Related Function Documentation

◆ SparseMatrixSIMD

template<int simd_length>
template<typename , int , int >
friend class SparseMatrixSIMD
friend

Definition at line 147 of file sparse_matrix_simd.h.

Member Data Documentation

◆ n_internal_dofs

template<int simd_length>
unsigned int ryujin::SparsityPatternSIMD< simd_length >::n_internal_dofs
protected

◆ n_locally_owned_dofs

template<int simd_length>
unsigned int ryujin::SparsityPatternSIMD< simd_length >::n_locally_owned_dofs
protected

Definition at line 110 of file sparse_matrix_simd.h.

◆ partitioner

template<int simd_length>
std::shared_ptr<const dealii::Utilities::MPI::Partitioner> ryujin::SparsityPatternSIMD< simd_length >::partitioner
protected

◆ row_starts

template<int simd_length>
dealii::AlignedVector<std::size_t> ryujin::SparsityPatternSIMD< simd_length >::row_starts
protected

Definition at line 113 of file sparse_matrix_simd.h.

◆ column_indices

template<int simd_length>
dealii::AlignedVector<unsigned int> ryujin::SparsityPatternSIMD< simd_length >::column_indices
protected

Definition at line 114 of file sparse_matrix_simd.h.

◆ indices_transposed

template<int simd_length>
dealii::AlignedVector<unsigned int> ryujin::SparsityPatternSIMD< simd_length >::indices_transposed
protected

Definition at line 115 of file sparse_matrix_simd.h.

◆ entries_to_be_sent

template<int simd_length>
std::vector<std::pair<unsigned int, unsigned int> > ryujin::SparsityPatternSIMD< simd_length >::entries_to_be_sent
protected

Array listing all (locally owned) entries as a pair {row, position_within_column}, potentially duplicated, and arranged consecutively by send targets.

Definition at line 122 of file sparse_matrix_simd.h.

◆ send_targets

template<int simd_length>
std::vector<std::pair<unsigned int, unsigned int> > ryujin::SparsityPatternSIMD< simd_length >::send_targets
protected

All send targets stored as a pair consisting of an MPI rank (first entry) and a corresponding index range into entries_to_be_sent given by the half open range [send_targets[p-1].second, send_targets[p])

Definition at line 129 of file sparse_matrix_simd.h.

◆ receive_targets

template<int simd_length>
std::vector<std::pair<unsigned int, unsigned int> > ryujin::SparsityPatternSIMD< simd_length >::receive_targets
protected

All receive targets are stored as a pair consisting of an MPI rank (first entry) and a corresponding index range into the (serial) data array given by the half open range [receive_targets[p-1].second, receive_targets[p].second).

Note, that indices into the data array start with the "locally relevant", or "ghost range" offset by n_locally_owned_dofs and multiplied by the number of components stored by the (vector valued) matrix.

Definition at line 142 of file sparse_matrix_simd.h.

◆ mpi_communicator

template<int simd_length>
MPI_Comm ryujin::SparsityPatternSIMD< simd_length >::mpi_communicator
protected

Definition at line 144 of file sparse_matrix_simd.h.


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