strumpack::CSRMatrixMPI< scalar_t, integer_t > Class Template Reference

Block-row distributed compressed sparse row storage. More...

#include <CSRMatrixMPI.hpp>

Inheritance diagram for strumpack::CSRMatrixMPI< scalar_t, integer_t >:
Collaboration diagram for strumpack::CSRMatrixMPI< scalar_t, integer_t >:

Public Member Functions

 CSRMatrixMPI (integer_t local_rows, const integer_t *row_ptr, const integer_t *col_ind, const scalar_t *values, const integer_t *dist, MPIComm comm, bool symm_sparse)
 
 CSRMatrixMPI (integer_t rows, integer_t local_rows, integer_t local_nnz, const integer_t *dist, MPIComm comm, bool symm_sparse)
 
 CSRMatrixMPI (integer_t lrows, const integer_t *d_ptr, const integer_t *d_ind, const scalar_t *d_val, const integer_t *o_ptr, const integer_t *o_ind, const scalar_t *o_val, const integer_t *garray, MPIComm comm, bool symm_sparse=false)
 
 CSRMatrixMPI (const CSRMatrix< scalar_t, integer_t > *A, MPIComm c, bool only_at_root)
 
integer_t local_nnz () const
 
integer_t local_rows () const
 
integer_t begin_row () const
 
integer_t end_row () const
 
const MPICommComm () const
 
MPI_Comm comm () const
 
const std::vector< integer_t > & dist () const
 
const integer_t & dist (std::size_t p) const
 
real_t norm1 () const override
 
void spmv (const DenseM_t &x, DenseM_t &y) const override
 
void spmv (const scalar_t *x, scalar_t *y) const override
 
void permute (const integer_t *iorder, const integer_t *order) override
 
std::unique_ptr< CSRMatrix< scalar_t, integer_t > > gather () const
 
std::unique_ptr< CSRGraph< integer_t > > gather_graph () const
 
Match_t matching (MatchingJob job, bool apply=true) override
 
Equil_t equilibration () const override
 
void equilibrate (const Equil_t &) override
 
void permute_columns (const std::vector< integer_t > &perm) override
 
void symmetrize_sparsity () override
 
int read_matrix_market (const std::string &filename) override
 
real_t max_scaled_residual (const DenseM_t &x, const DenseM_t &b) const override
 
real_t max_scaled_residual (const scalar_t *x, const scalar_t *b) const override
 
std::unique_ptr< CSRMatrixMPI< scalar_t, integer_t > > add_missing_diagonal (const scalar_t &s) const
 
CSRGraph< integer_t > get_sub_graph (const std::vector< integer_t > &perm, const std::vector< std::pair< integer_t, integer_t > > &graph_ranges) const
 
CSRGraph< integer_t > extract_graph (int ordering_level, integer_t lo, integer_t hi) const override
 
void print () const override
 
void print_dense (const std::string &name) const override
 
void print_matrix_market (const std::string &filename) const override
 
void check () const
 
- Public Member Functions inherited from strumpack::CompressedSparseMatrix< scalar_t, integer_t >
virtual ~CompressedSparseMatrix ()
 
integer_t size () const
 
integer_t nnz () const
 
const integer_t * ptr () const
 
const integer_t * ind () const
 
const scalar_t * val () const
 
integer_t * ptr ()
 
integer_t * ind ()
 
scalar_t * val ()
 
const integer_t & ptr (integer_t i) const
 
const integer_t & ind (integer_t i) const
 
const scalar_t & val (integer_t i) const
 
integer_t & ptr (integer_t i)
 
integer_t & ind (integer_t i)
 
scalar_t & val (integer_t i)
 
virtual real_t norm1 () const =0
 
bool symm_sparse () const
 
void set_symm_sparse (bool symm_sparse=true)
 
virtual void spmv (const DenseM_t &x, DenseM_t &y) const =0
 
virtual void spmv (const scalar_t *x, scalar_t *y) const =0
 
virtual void permute (const integer_t *iorder, const integer_t *order)
 
virtual void permute (const std::vector< integer_t > &iorder, const std::vector< integer_t > &order)
 
virtual void permute_columns (const std::vector< integer_t > &perm)=0
 
virtual Equil_t equilibration () const
 
virtual void equilibrate (const Equil_t &)
 
virtual Match_t matching (MatchingJob, bool apply=true)
 
virtual void apply_matching (const Match_t &)
 
virtual void symmetrize_sparsity ()
 
virtual void print () const
 
virtual void print_dense (const std::string &name) const
 
virtual void print_matrix_market (const std::string &filename) const
 
virtual int read_matrix_market (const std::string &filename)=0
 
virtual real_t max_scaled_residual (const scalar_t *x, const scalar_t *b) const =0
 
virtual real_t max_scaled_residual (const DenseM_t &x, const DenseM_t &b) const =0
 

Detailed Description

template<typename scalar_t, typename integer_t>
class strumpack::CSRMatrixMPI< scalar_t, integer_t >

Block-row distributed compressed sparse row storage.

TODO: cleanup this class

Template Parameters
scalar_t...
integer_tTODO set a default for this?

Member Function Documentation

◆ equilibrate()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::equilibrate ( const Equil_t )
overridevirtual

◆ equilibration()

template<typename scalar_t , typename integer_t >
Equil_t strumpack::CSRMatrixMPI< scalar_t, integer_t >::equilibration ( ) const
overridevirtual

◆ matching()

template<typename scalar_t , typename integer_t >
Match_t strumpack::CSRMatrixMPI< scalar_t, integer_t >::matching ( MatchingJob  job,
bool  apply = true 
)
overridevirtual

This gathers the matrix to 1 process, then applies MC64 sequentially. lDr and gDc are only set when job == MatchingJob::MAX_DIAGONAL_PRODUCT_SCALING.

Parameters
jobThe job type.
permOutput, column permutation vector containing the GLOBAL column permutation, such that the column perm[j] of the original matrix is column j in the permuted matrix.
lDrRow scaling factors, this is local, ie, Dr.size() == this->local_rows().
gDcCol scaling factors, this is global, ie, Dc.size() == this->size()

Reimplemented from strumpack::CompressedSparseMatrix< scalar_t, integer_t >.

◆ max_scaled_residual() [1/2]

template<typename scalar_t , typename integer_t >
real_t strumpack::CSRMatrixMPI< scalar_t, integer_t >::max_scaled_residual ( const DenseM_t x,
const DenseM_t b 
) const
overridevirtual

◆ max_scaled_residual() [2/2]

template<typename scalar_t , typename integer_t >
real_t strumpack::CSRMatrixMPI< scalar_t, integer_t >::max_scaled_residual ( const scalar_t *  x,
const scalar_t *  b 
) const
overridevirtual

◆ norm1()

template<typename scalar_t , typename integer_t >
real_t strumpack::CSRMatrixMPI< scalar_t, integer_t >::norm1 ( ) const
overridevirtual

◆ permute()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::permute ( const integer_t *  iorder,
const integer_t *  order 
)
overridevirtual

TODO Obtain reordering Anew = A(iorder,iorder). In addition, entries of IND, VAL are sorted in increasing order

Reimplemented from strumpack::CompressedSparseMatrix< scalar_t, integer_t >.

◆ permute_columns()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::permute_columns ( const std::vector< integer_t > &  perm)
overridevirtual

◆ print()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::print ( ) const
overridevirtual

◆ print_dense()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::print_dense ( const std::string &  name) const
overridevirtual

◆ print_matrix_market()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::print_matrix_market ( const std::string &  filename) const
overridevirtual

◆ read_matrix_market()

template<typename scalar_t , typename integer_t >
int strumpack::CSRMatrixMPI< scalar_t, integer_t >::read_matrix_market ( const std::string &  filename)
overridevirtual

◆ spmv() [1/2]

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::spmv ( const DenseM_t x,
DenseM_t y 
) const
overridevirtual

Sparse matrix times dense vector/matrix product y = this * x x and y can have multiple columns. y should be pre-allocated!

TODO make the public interface non-virtual

Parameters
xinput right hand-side vector/matrix, should satisfy x.size() == this->size()
youtput, result of y = this * x, should satisfy y.size() == this->size()

Implements strumpack::CompressedSparseMatrix< scalar_t, integer_t >.

◆ spmv() [2/2]

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::spmv ( const scalar_t *  x,
scalar_t *  y 
) const
overridevirtual

Sparse matrix times dense vector product y = this * x x and y can have multiple columns. y should be pre-allocated.

TODO make the public interface non-virtual

Parameters
xinput right hand-side vector/matrix, should be a pointer to an array of size size()
youtput, result of y = this * x, should be a pointer to an array of size size(), already allocated

Implements strumpack::CompressedSparseMatrix< scalar_t, integer_t >.

◆ symmetrize_sparsity()

template<typename scalar_t , typename integer_t >
void strumpack::CSRMatrixMPI< scalar_t, integer_t >::symmetrize_sparsity ( )
overridevirtual

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