|
| RowColDistMat () |
| no memory allocation More...
|
|
| RowColDistMat (const LocalMatrixInner &inside, const LocalMatrixOuter &outside, const Collective &c) |
| Constructor. More...
|
|
template<class OtherMatrixInner , class OtherMatrixOuter , class OtherCollective > |
| RowColDistMat (const RowColDistMat< OtherMatrixInner, OtherMatrixOuter, OtherCollective > &src) |
| Copy constructor. More...
|
|
const LocalMatrixInner & | inner_matrix () const |
| Read access to the inner matrix. More...
|
|
LocalMatrixInner & | inner_matrix () |
| Write access to the inner matrix. More...
|
|
const LocalMatrixOuter & | outer_matrix () const |
| Read access to the outer matrix. More...
|
|
LocalMatrixOuter & | outer_matrix () |
| Write access to the outer matrix. More...
|
|
const Collective & | collective () const |
| Read access to the communication object. More...
|
|
template<class ContainerType1 , class ContainerType2 > |
void | symv (value_type alpha, const ContainerType1 &x, value_type beta, ContainerType2 &y) const |
| Matrix Vector product. More...
|
|
template<class ContainerType1 , class ContainerType2 > |
void | symv (const ContainerType1 &x, ContainerType2 &y) const |
| Matrix Vector product. More...
|
|
template<class LocalMatrixInner, class LocalMatrixOuter, class Collective>
struct dg::RowColDistMat< LocalMatrixInner, LocalMatrixOuter, Collective >
Distributed memory matrix class, asynchronous communication.
The idea of this mpi matrix is to separate communication and computation in order to reuse existing optimized matrix formats for the computation. It can be expected that this works particularly well for cases in which the communication to computation ratio is low. This class assumes that the matrix and vector elements are distributed rowwise among mpi processes. The matrix elements are then further separated into columns that are inside the domain and the ones that are outside, i.e.
\[ M=M_i+M_o \]
where \( M_i\) is the inner matrix which requires no communication, while \( M_o\) is the outer matrix containing all elements which require communication from the Collective object.
- Template Parameters
-
LocalMatrixInner | The class of the matrix for local computations of the inner points. symv(m,x,y) needs to be callable on the container class of the MPI_Vector |
LocalMatrixOuter | The class of the matrix for local computations of the outer points. symv(1,m,x,1,y) needs to be callable on the container class of the MPI_Vector |
Collective | must be a NearestNeighborComm The Communication class needs to gather values across processes. The global_gather_init() , global_gather_wait() , allocate_buffer() and isCommunicating() member functions are called. Gather points from other processes that are necessary for the outer computations. If !isCommunicating () the global_gather() function won't be called and only the inner matrix is applied. |
- Note
- This class overlaps communication with computation of the inner matrix
template<class LocalMatrixInner , class LocalMatrixOuter , class Collective >
template<class OtherMatrixInner , class OtherMatrixOuter , class OtherCollective >
dg::RowColDistMat< LocalMatrixInner, LocalMatrixOuter, Collective >::RowColDistMat |
( |
const RowColDistMat< OtherMatrixInner, OtherMatrixOuter, OtherCollective > & |
src | ) |
|
|
inline |
Copy constructor.
The idea is that a device matrix can be constructed by copying a host matrix.
- Template Parameters
-
OtherMatrixInner | LocalMatrixInner must be copy-constructible from OtherMatrixInner |
OtherMatrixOuter | LocalMatrixOuter must be copy-constructible from OtherMatrixOuter |
OtherCollective | Collective must be copy-constructible from OtherCollective |
- Parameters
-
template<class LocalMatrixInner , class LocalMatrixOuter , class Collective >
template<class ContainerType1 , class ContainerType2 >
void dg::RowColDistMat< LocalMatrixInner, LocalMatrixOuter, Collective >::symv |
( |
const ContainerType1 & |
x, |
|
|
ContainerType2 & |
y |
|
) |
| const |
|
inline |
Matrix Vector product.
First the inner elements are computed with a call to doSymv then the collect function of the communication object is called. Finally the outer elements are added with a call to doSymv for the outer matrix
- Template Parameters
-
ContainerType | container class of the vector elements |
- Parameters
-
template<class LocalMatrixInner , class LocalMatrixOuter , class Collective >
template<class ContainerType1 , class ContainerType2 >
Matrix Vector product.
First the inner elements are computed with a call to doSymv then the global_gather function of the communication object is called. Finally the outer elements are added with a call to doSymv for the outer matrix
- Template Parameters
-
ContainerType | container class of the vector elements |
- Parameters
-
alpha | scalar |
x | input |
beta | scalar |
y | output |