Block-Structured AMR Software Framework
amrex::SpMatrix< T, Allocator > Class Template Reference

#include <AMReX_SpMatrix.H>

Classes

struct  CSR
 

Public Types

using value_type = T
 

Public Member Functions

 SpMatrix ()=default
 
 SpMatrix (AlgPartition partition, int nnz)
 
 SpMatrix (SpMatrix const &)=delete
 
SpMatrixoperator= (SpMatrix const &)=delete
 
 SpMatrix (SpMatrix &&)=default
 
SpMatrixoperator= (SpMatrix &&)=default
 
 ~SpMatrix ()=default
 
void define (AlgPartition partition, int nnz)
 
AlgPartition const & partition () const
 
Long numLocalRows () const
 
Long numGlobalRows () const
 
Long numLocalNonZero () const
 
Long globalRowBegin () const
 Inclusive global index begin. More...
 
Long globalRowEnd () const
 Exclusive global index end. More...
 
T const * data () const
 
T * data ()
 
Long const * columnIndex () const
 
Long * columnIndex ()
 
Long const * rowOffset () const
 
Long * rowOffset ()
 
void printToFile (std::string const &file) const
 
template<typename F >
void setVal (F const &f)
 
AlgVector< T > const & diagonalVector () const
 
void define_doit (int nnz)
 Private function, but public for cuda. More...
 
void prepare_comm ()
 Private function, but public for cuda. More...
 
void pack_buffer (AlgVector< T > const &v)
 
void unpack_buffer (AlgVector< T > &v)
 

Private Types

template<class U >
using DVec = PODVector< U, Allocator< U > >
 

Private Member Functions

void startComm (AlgVector< T > const &x)
 
void finishComm (AlgVector< T > &y)
 

Private Attributes

AlgPartition m_partition
 
Long m_row_begin = 0
 
Long m_row_end = 0
 
CSR< DVecm_data
 
AlgVector< T > m_diagonal
 
CSR< DVecm_data_remote
 
Gpu::PinnedVector< Long > m_remote_cols
 
DVec< Long > m_rtol
 
Vector< intm_send_to
 
Vector< intm_send_counts
 
Gpu::DeviceVector< Long > m_send_indices
 
Vector< intm_recv_from
 
Vector< intm_recv_counts
 
Vector< MPI_Requestm_send_reqs
 
T * m_send_buffer = nullptr
 
Long m_total_counts_send = 0
 
Vector< MPI_Requestm_recv_reqs
 
T * m_recv_buffer = nullptr
 
Long m_total_counts_recv = 0
 
bool m_comm_prepared = false
 
bool m_shifted = false
 

Friends

template<typename U >
void SpMV (AlgVector< U > &y, SpMatrix< U > const &A, AlgVector< U > const &x)
 

Member Typedef Documentation

◆ DVec

template<typename T , template< typename > class Allocator = DefaultAllocator>
template<class U >
using amrex::SpMatrix< T, Allocator >::DVec = PODVector<U,Allocator<U> >
private

◆ value_type

template<typename T , template< typename > class Allocator = DefaultAllocator>
using amrex::SpMatrix< T, Allocator >::value_type = T

Constructor & Destructor Documentation

◆ SpMatrix() [1/4]

template<typename T , template< typename > class Allocator = DefaultAllocator>
amrex::SpMatrix< T, Allocator >::SpMatrix ( )
default

◆ SpMatrix() [2/4]

template<typename T , template< typename > class Allocator>
amrex::SpMatrix< T, Allocator >::SpMatrix ( AlgPartition  partition,
int  nnz 
)

◆ SpMatrix() [3/4]

template<typename T , template< typename > class Allocator = DefaultAllocator>
amrex::SpMatrix< T, Allocator >::SpMatrix ( SpMatrix< T, Allocator > const &  )
delete

◆ SpMatrix() [4/4]

template<typename T , template< typename > class Allocator = DefaultAllocator>
amrex::SpMatrix< T, Allocator >::SpMatrix ( SpMatrix< T, Allocator > &&  )
default

◆ ~SpMatrix()

template<typename T , template< typename > class Allocator = DefaultAllocator>
amrex::SpMatrix< T, Allocator >::~SpMatrix ( )
default

Member Function Documentation

◆ columnIndex() [1/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long* amrex::SpMatrix< T, Allocator >::columnIndex ( )
inline

◆ columnIndex() [2/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long const* amrex::SpMatrix< T, Allocator >::columnIndex ( ) const
inline

◆ data() [1/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
T* amrex::SpMatrix< T, Allocator >::data ( )
inline

◆ data() [2/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
T const* amrex::SpMatrix< T, Allocator >::data ( ) const
inline

◆ define()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::define ( AlgPartition  partition,
int  nnz 
)

◆ define_doit()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::define_doit ( int  nnz)

Private function, but public for cuda.

◆ diagonalVector()

template<typename T , template< typename > class Allocator>
AlgVector< T > const & amrex::SpMatrix< T, Allocator >::diagonalVector

◆ finishComm()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::finishComm ( AlgVector< T > &  y)
private

◆ globalRowBegin()

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::globalRowBegin ( ) const
inline

Inclusive global index begin.

◆ globalRowEnd()

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::globalRowEnd ( ) const
inline

Exclusive global index end.

◆ numGlobalRows()

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::numGlobalRows ( ) const
inline

◆ numLocalNonZero()

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::numLocalNonZero ( ) const
inline

◆ numLocalRows()

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::numLocalRows ( ) const
inline

◆ operator=() [1/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
SpMatrix& amrex::SpMatrix< T, Allocator >::operator= ( SpMatrix< T, Allocator > &&  )
default

◆ operator=() [2/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
SpMatrix& amrex::SpMatrix< T, Allocator >::operator= ( SpMatrix< T, Allocator > const &  )
delete

◆ pack_buffer()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::pack_buffer ( AlgVector< T > const &  v)

◆ partition()

template<typename T , template< typename > class Allocator = DefaultAllocator>
AlgPartition const& amrex::SpMatrix< T, Allocator >::partition ( ) const
inline

◆ prepare_comm()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::prepare_comm

Private function, but public for cuda.

◆ printToFile()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::printToFile ( std::string const &  file) const

◆ rowOffset() [1/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long* amrex::SpMatrix< T, Allocator >::rowOffset ( )
inline

◆ rowOffset() [2/2]

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long const* amrex::SpMatrix< T, Allocator >::rowOffset ( ) const
inline

◆ setVal()

template<typename T , template< typename > class Allocator>
template<typename F >
void amrex::SpMatrix< T, Allocator >::setVal ( F const &  f)

◆ startComm()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::startComm ( AlgVector< T > const &  x)
private

◆ unpack_buffer()

template<typename T , template< typename > class Allocator>
void amrex::SpMatrix< T, Allocator >::unpack_buffer ( AlgVector< T > &  v)

Friends And Related Function Documentation

◆ SpMV

template<typename T , template< typename > class Allocator = DefaultAllocator>
template<typename U >
void SpMV ( AlgVector< U > &  y,
SpMatrix< U > const &  A,
AlgVector< U > const &  x 
)
friend

Member Data Documentation

◆ m_comm_prepared

template<typename T , template< typename > class Allocator = DefaultAllocator>
bool amrex::SpMatrix< T, Allocator >::m_comm_prepared = false
private

◆ m_data

template<typename T , template< typename > class Allocator = DefaultAllocator>
CSR<DVec> amrex::SpMatrix< T, Allocator >::m_data
private

◆ m_data_remote

template<typename T , template< typename > class Allocator = DefaultAllocator>
CSR<DVec> amrex::SpMatrix< T, Allocator >::m_data_remote
private

◆ m_diagonal

template<typename T , template< typename > class Allocator = DefaultAllocator>
AlgVector<T> amrex::SpMatrix< T, Allocator >::m_diagonal
mutableprivate

◆ m_partition

template<typename T , template< typename > class Allocator = DefaultAllocator>
AlgPartition amrex::SpMatrix< T, Allocator >::m_partition
private

◆ m_recv_buffer

template<typename T , template< typename > class Allocator = DefaultAllocator>
T* amrex::SpMatrix< T, Allocator >::m_recv_buffer = nullptr
private

◆ m_recv_counts

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<int> amrex::SpMatrix< T, Allocator >::m_recv_counts
private

◆ m_recv_from

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<int> amrex::SpMatrix< T, Allocator >::m_recv_from
private

◆ m_recv_reqs

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<MPI_Request> amrex::SpMatrix< T, Allocator >::m_recv_reqs
private

◆ m_remote_cols

template<typename T , template< typename > class Allocator = DefaultAllocator>
Gpu::PinnedVector<Long> amrex::SpMatrix< T, Allocator >::m_remote_cols
private

◆ m_row_begin

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::m_row_begin = 0
private

◆ m_row_end

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::m_row_end = 0
private

◆ m_rtol

template<typename T , template< typename > class Allocator = DefaultAllocator>
DVec<Long> amrex::SpMatrix< T, Allocator >::m_rtol
private

◆ m_send_buffer

template<typename T , template< typename > class Allocator = DefaultAllocator>
T* amrex::SpMatrix< T, Allocator >::m_send_buffer = nullptr
private

◆ m_send_counts

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<int> amrex::SpMatrix< T, Allocator >::m_send_counts
private

◆ m_send_indices

template<typename T , template< typename > class Allocator = DefaultAllocator>
Gpu::DeviceVector<Long> amrex::SpMatrix< T, Allocator >::m_send_indices
private

◆ m_send_reqs

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<MPI_Request> amrex::SpMatrix< T, Allocator >::m_send_reqs
private

◆ m_send_to

template<typename T , template< typename > class Allocator = DefaultAllocator>
Vector<int> amrex::SpMatrix< T, Allocator >::m_send_to
private

◆ m_shifted

template<typename T , template< typename > class Allocator = DefaultAllocator>
bool amrex::SpMatrix< T, Allocator >::m_shifted = false
private

◆ m_total_counts_recv

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::m_total_counts_recv = 0
private

◆ m_total_counts_send

template<typename T , template< typename > class Allocator = DefaultAllocator>
Long amrex::SpMatrix< T, Allocator >::m_total_counts_send = 0
private

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