#include <dist_matrix.h>
Collaboration diagram for dist_matrix< A >:

Public Member Functions | |
| dist_matrix () | |
| Default constructor. | |
| dist_matrix (int nn, int mm, const SKEL_MPI_INTRACOMM &com=SKEL_MPI_COMM_WORLD, int r=-1, int c=-1) | |
| constructor specifying its shape but elements. | |
| template<typename F> | |
| dist_matrix (int nn, int mm, const F &f, const SKEL_MPI_INTRACOMM &com=SKEL_MPI_COMM_WORLD, int r=-1, int c=-1) | |
| Constructor with generator function. | |
| dist_matrix (const matrix< A > *mat, const SKEL_MPI_INTRACOMM &com=SKEL_MPI_COMM_WORLD, int r=-1, int c=-1) | |
| Constructor with distributing root's local matrix. | |
| dist_matrix (const dist_matrix< A > &dmat) | |
| Copy Constructor. | |
| ~dist_matrix () | |
| A destructor. | |
| template<typename F> | |
| void | generate (const F &f) |
| Generate elements by generator function. | |
| void | distribute (const matrix< A > *mat) |
| Distribute a matrix at root process. | |
| void | gather (matrix< A > *mat) const |
| Gather block-matrices distributed to processors into a matrix. | |
| void | gatherB (matrix< A > *mat) const |
| Gather with broadcast. | |
| void | print (std::ostream &os) const |
| Print whole matrix to output-stream in root process. | |
| template<typename B> | |
| void | shapeCopy (const dist_matrix< B > *mat) |
| Shape copy. | |
| int | getRows () const |
| The number of rows of total matrix. | |
| int | getCols () const |
| The number of columns of total matrix. | |
| int | getLocalRows () const |
| The number of rows of local submatrix. | |
| int | getLocalCols () const |
| The number of columns of local submatrix. | |
| int | getBlocksInRow () const |
| The number of submatrices in rows. | |
| int | getBlocksInCol () const |
| the number of submatrices in columns. | |
| int | getIdxRow () const |
| Global row-index of upper-left element of this matrix. | |
| int | getIdxCol () const |
| Global column-index of upper-left element of this matrix. | |
| int | getPosX () const |
| Global x position of this submatrix. | |
| int | getPosY () const |
| Global y position of this submatrix. | |
| A & | get (int i, int j) const |
| Return reference of the element at (i, j) of local submatrix. | |
| A & | at (int i, int j) |
| Return reference of the element at (i, j) of local submatrix. | |
| const A & | at (int i, int j) const |
| Return const reference of the element at (i, j) of local submatrix. | |
| void | set (int i, int j, const A &v) |
| Put value v at (i, j) of local submatrix. | |
| int | getRank () const |
| Rank of this process. | |
| matrix< A > * | getMatrix () const |
| Return elements of this dist_matrix as an object of matrix. | |
| const MPI_Datatype & | getType () const |
| MPI datatype of elements. | |
| A * | globalGet (int i, int j) const |
| get an element at (i, j) of global index of the matrix. | |
| void | globalSet (int i, int j, const A &val) const |
| set an element at (i, j) of global index of the matrix. | |
Static Public Member Functions | |
| template<typename B> | |
| static void | bcast (B *res, const dist_matrix< A > *mat) |
| broadcast (from root to the other processes). | |
Friends | |
| class | matrix_skeletons |
The matrix is consists of three constructors 'abv'(above), 'bsd'(beside) and 'sing'(singleton). So, in haskell notation, datatype matrix is as follows:
data Matrix a = Sing a
| Abv (Matrix a) (Matrix a)
| Bsd (Matrix a) (Matrix a)
Definition at line 108 of file dist_matrix.h.
|
|||||||||
|
Default constructor. This constructor do nothing. |
|
||||||||||||||||||||||||||||
|
constructor specifying its shape but elements. The number of processors to be used is r * c. If r or c is less than 0 (default), then r and c are calcuated by distribution policy which can be specified by matrix_skeletons. r * c should not exceed the total number of processors.
|
|
||||||||||||||||||||||||||||||||||||
|
Constructor with generator function. The number of processors to be used is r * c. If r or c is less than 0 (default), then r and c are calcuated by distribution policy which can be specified by matrix_skeletons. r * c should not exceed the total number of processors.
|
|
||||||||||||||||||||||||
|
Constructor with distributing root's local matrix. The number of processors to be used is r * c. If r or c is less than 0 (default), then r and c are calcuated by distribution policy which can be specified by matrix_skeletons. r * c should not exceed the total number of processors.
|
|
||||||||||
|
Copy Constructor.
|
|
|||||||||
|
A destructor.
|
|
||||||||||||||||
|
Return const reference of the element at (i, j) of local submatrix.
Definition at line 465 of file dist_matrix.h. |
|
||||||||||||||||
|
Return reference of the element at (i, j) of local submatrix.
Definition at line 458 of file dist_matrix.h. |
|
||||||||||||||||||||
|
broadcast (from root to the other processes). This function usually used to broadcast results of recude skeletons. For example, to divide all elements by their summation, we use reduce-skeleton with addition-operators to get the summation 'S', broadcast it by this bcast, and apply map-skeleton with a function '( / S)' to the matrix.
|
|
||||||||||
|
Distribute a matrix at root process. Arguments of other process are ignored.
|
|
||||||||||
|
Gather block-matrices distributed to processors into a matrix. The whole matrix is stored in the root process. The arguments of other process are unknown.
|
|
||||||||||
|
Gather with broadcast. This function gather the block-matrices distributed to processors into a matrix. The resulting matrix is broadcasted among all processors.
|
|
||||||||||||||
|
Generate elements by generator function.
|
|
||||||||||||||||
|
Return reference of the element at (i, j) of local submatrix.
Definition at line 451 of file dist_matrix.h. |
|
|||||||||
|
the number of submatrices in columns.
Definition at line 428 of file dist_matrix.h. |
|
|||||||||
|
The number of submatrices in rows.
Definition at line 424 of file dist_matrix.h. |
|
|||||||||
|
The number of columns of total matrix.
Definition at line 412 of file dist_matrix.h. |
|
|||||||||
|
Global column-index of upper-left element of this matrix.
Definition at line 436 of file dist_matrix.h. |
|
|||||||||
|
Global row-index of upper-left element of this matrix.
Definition at line 432 of file dist_matrix.h. |
|
|||||||||
|
The number of columns of local submatrix.
Definition at line 420 of file dist_matrix.h. |
|
|||||||||
|
The number of rows of local submatrix.
Definition at line 416 of file dist_matrix.h. |
|
|||||||||
|
Return elements of this dist_matrix as an object of matrix.
Definition at line 481 of file dist_matrix.h. |
|
|||||||||
|
Global x position of this submatrix.
Definition at line 440 of file dist_matrix.h. |
|
|||||||||
|
Global y position of this submatrix.
Definition at line 444 of file dist_matrix.h. |
|
|||||||||
|
Rank of this process.
Definition at line 477 of file dist_matrix.h. |
|
|||||||||
|
The number of rows of total matrix.
Definition at line 408 of file dist_matrix.h. |
|
|||||||||
|
MPI datatype of elements. Users usually should not use this function. Definition at line 487 of file dist_matrix.h. |
|
||||||||||||||||
|
get an element at (i, j) of global index of the matrix. This function returns a value of the element at (i, j) wherever the element is stored. The result is broadcasted to all processes. User should free the resulting pointer.
|
|
||||||||||||||||||||
|
set an element at (i, j) of global index of the matrix. This function puts a value in root process into an element at (i, j) wherever the element is stored.
|
|
||||||||||
|
Print whole matrix to output-stream in root process. This function gathers distributed matrix and outputs it to the output stream of root process.
|
|
||||||||||||||||||||
|
Put value v at (i, j) of local submatrix.
Definition at line 473 of file dist_matrix.h. |
|
||||||||||||||
|
Shape copy. Shape (size of matrix and the distribution pattern) is copied from the argument matrix mat.
|
|
|||||
|
The skeletons. Definition at line 110 of file dist_matrix.h. |
1.4.4