(git:1a29073)
|
Go to the source code of this file.
Data Structures | |
struct | dbm_matrix_t |
Internal struct for storing a matrix. More... | |
struct | dbm_iterator_t |
Internal struct for storing a block iterator. More... | |
Functions | |
void | dbm_create (dbm_matrix_t **matrix_out, dbm_distribution_t *dist, const char name[], const int nrows, const int ncols, const int row_sizes[nrows], const int col_sizes[ncols]) |
Creates a new matrix. More... | |
void | dbm_release (dbm_matrix_t *matrix) |
Releases a matrix and all its ressources. More... | |
void | dbm_copy (dbm_matrix_t *matrix_a, const dbm_matrix_t *matrix_b) |
Copies content of matrix_b into matrix_a. Matrices must have the same row/col block sizes and distribution. More... | |
void | dbm_redistribute (const dbm_matrix_t *matrix, dbm_matrix_t *redist) |
Copies content of matrix_b into matrix_a. Matrices may have different distributions. More... | |
void | dbm_get_block_p (dbm_matrix_t *matrix, const int row, const int col, double **block, int *row_size, int *col_size) |
Looks up a block from given matrics. This routine is thread-safe. If the block is not found then a null pointer is returned. More... | |
void | dbm_put_block (dbm_matrix_t *matrix, const int row, const int col, const bool summation, const double *block) |
Adds a block to given matrix. This routine is thread-safe. If block already exist then it gets overwritten (or summed). More... | |
void | dbm_clear (dbm_matrix_t *matrix) |
Remove all blocks from matrix, but does not release underlying memory. More... | |
void | dbm_filter (dbm_matrix_t *matrix, const double eps) |
Removes all blocks from the matrix whose norm is below the threshold. Blocks of size zero are always kept. More... | |
void | dbm_reserve_blocks (dbm_matrix_t *matrix, const int nblocks, const int rows[], const int cols[]) |
Adds list of blocks efficiently. The blocks will be filled with zeros. This routine must always be called within an OpenMP parallel region. More... | |
void | dbm_scale (dbm_matrix_t *matrix, const double alpha) |
Multiplies all entries in the given matrix by the given factor alpha. More... | |
void | dbm_zero (dbm_matrix_t *matrix) |
Sets all blocks in the given matrix to zero. More... | |
void | dbm_add (dbm_matrix_t *matrix_a, const dbm_matrix_t *matrix_b) |
Adds matrix_b to matrix_a. More... | |
void | dbm_iterator_start (dbm_iterator_t **iter_out, const dbm_matrix_t *matrix) |
Creates an iterator for the blocks of the given matrix. The iteration order is not stable. This routine must always be called within an OpenMP parallel region. More... | |
int | dbm_iterator_num_blocks (const dbm_iterator_t *iter) |
Returns number of blocks the iterator will provide to calling thread. More... | |
bool | dbm_iterator_blocks_left (const dbm_iterator_t *iter) |
Tests whether the given iterator has any block left. More... | |
void | dbm_iterator_next_block (dbm_iterator_t *iter, int *row, int *col, double **block, int *row_size, int *col_size) |
Returns the next block from the given iterator. More... | |
void | dbm_iterator_stop (dbm_iterator_t *iter) |
Releases the given iterator. More... | |
double | dbm_checksum (const dbm_matrix_t *matrix) |
Computes a checksum of the given matrix. More... | |
double | dbm_maxabs (const dbm_matrix_t *matrix) |
Returns the absolute value of the larges element of the entire matrix. More... | |
const char * | dbm_get_name (const dbm_matrix_t *matrix) |
Returns the name of the matrix of the given matrix. More... | |
int | dbm_get_nze (const dbm_matrix_t *matrix) |
Returns the number of local Non-Zero Elements of the given matrix. More... | |
int | dbm_get_num_blocks (const dbm_matrix_t *matrix) |
Returns the number of local blocks of the given matrix. More... | |
void | dbm_get_row_sizes (const dbm_matrix_t *matrix, int *nrows, const int **row_sizes) |
Returns the row block sizes of the given matrix. More... | |
void | dbm_get_col_sizes (const dbm_matrix_t *matrix, int *ncols, const int **col_sizes) |
Returns the column block sizes of the given matrix. More... | |
void | dbm_get_local_rows (const dbm_matrix_t *matrix, int *nlocal_rows, const int **local_rows) |
Returns the local row block sizes of the given matrix. More... | |
void | dbm_get_local_cols (const dbm_matrix_t *matrix, int *nlocal_cols, const int **local_cols) |
Returns the local column block sizes of the given matrix. More... | |
int | dbm_get_stored_coordinates (const dbm_matrix_t *matrix, const int row, const int col) |
Returns the MPI rank on which the given block should be stored. More... | |
const dbm_distribution_t * | dbm_get_distribution (const dbm_matrix_t *matrix) |
Returns the distribution of the given matrix. More... | |
static int | dbm_get_num_shards (const dbm_matrix_t *matrix) |
Internal routine that returns the number of shards for given matrix. More... | |
static int | dbm_get_shard_index (const dbm_matrix_t *matrix, const int row, const int col) |
Internal routine for getting a block's shard index. More... | |
void dbm_create | ( | dbm_matrix_t ** | matrix_out, |
dbm_distribution_t * | dist, | ||
const char | name[], | ||
const int | nrows, | ||
const int | ncols, | ||
const int | row_sizes[nrows], | ||
const int | col_sizes[ncols] | ||
) |
Creates a new matrix.
Definition at line 24 of file dbm_matrix.c.
void dbm_release | ( | dbm_matrix_t * | matrix | ) |
Releases a matrix and all its ressources.
Definition at line 65 of file dbm_matrix.c.
void dbm_copy | ( | dbm_matrix_t * | matrix_a, |
const dbm_matrix_t * | matrix_b | ||
) |
Copies content of matrix_b into matrix_a. Matrices must have the same row/col block sizes and distribution.
Definition at line 83 of file dbm_matrix.c.
void dbm_redistribute | ( | const dbm_matrix_t * | matrix, |
dbm_matrix_t * | redist | ||
) |
Copies content of matrix_b into matrix_a. Matrices may have different distributions.
Definition at line 108 of file dbm_matrix.c.
void dbm_get_block_p | ( | dbm_matrix_t * | matrix, |
const int | row, | ||
const int | col, | ||
double ** | block, | ||
int * | row_size, | ||
int * | col_size | ||
) |
Looks up a block from given matrics. This routine is thread-safe. If the block is not found then a null pointer is returned.
Definition at line 206 of file dbm_matrix.c.
void dbm_put_block | ( | dbm_matrix_t * | matrix, |
const int | row, | ||
const int | col, | ||
const bool | summation, | ||
const double * | block | ||
) |
Adds a block to given matrix. This routine is thread-safe. If block already exist then it gets overwritten (or summed).
Definition at line 228 of file dbm_matrix.c.
void dbm_clear | ( | dbm_matrix_t * | matrix | ) |
Remove all blocks from matrix, but does not release underlying memory.
Definition at line 257 of file dbm_matrix.c.
void dbm_filter | ( | dbm_matrix_t * | matrix, |
const double | eps | ||
) |
Removes all blocks from the matrix whose norm is below the threshold. Blocks of size zero are always kept.
Definition at line 276 of file dbm_matrix.c.
void dbm_reserve_blocks | ( | dbm_matrix_t * | matrix, |
const int | nblocks, | ||
const int | rows[], | ||
const int | cols[] | ||
) |
Adds list of blocks efficiently. The blocks will be filled with zeros. This routine must always be called within an OpenMP parallel region.
Definition at line 325 of file dbm_matrix.c.
void dbm_scale | ( | dbm_matrix_t * | matrix, |
const double | alpha | ||
) |
Multiplies all entries in the given matrix by the given factor alpha.
Definition at line 356 of file dbm_matrix.c.
void dbm_zero | ( | dbm_matrix_t * | matrix | ) |
Sets all blocks in the given matrix to zero.
Definition at line 379 of file dbm_matrix.c.
void dbm_add | ( | dbm_matrix_t * | matrix_a, |
const dbm_matrix_t * | matrix_b | ||
) |
Adds matrix_b to matrix_a.
Definition at line 393 of file dbm_matrix.c.
void dbm_iterator_start | ( | dbm_iterator_t ** | iter_out, |
const dbm_matrix_t * | matrix | ||
) |
Creates an iterator for the blocks of the given matrix. The iteration order is not stable. This routine must always be called within an OpenMP parallel region.
Definition at line 426 of file dbm_matrix.c.
int dbm_iterator_num_blocks | ( | const dbm_iterator_t * | iter | ) |
Returns number of blocks the iterator will provide to calling thread.
Definition at line 445 of file dbm_matrix.c.
bool dbm_iterator_blocks_left | ( | const dbm_iterator_t * | iter | ) |
Tests whether the given iterator has any block left.
Definition at line 459 of file dbm_matrix.c.
void dbm_iterator_next_block | ( | dbm_iterator_t * | iter, |
int * | row, | ||
int * | col, | ||
double ** | block, | ||
int * | row_size, | ||
int * | col_size | ||
) |
Returns the next block from the given iterator.
Definition at line 467 of file dbm_matrix.c.
void dbm_iterator_stop | ( | dbm_iterator_t * | iter | ) |
Releases the given iterator.
Definition at line 497 of file dbm_matrix.c.
double dbm_checksum | ( | const dbm_matrix_t * | matrix | ) |
Computes a checksum of the given matrix.
Definition at line 503 of file dbm_matrix.c.
double dbm_maxabs | ( | const dbm_matrix_t * | matrix | ) |
Returns the absolute value of the larges element of the entire matrix.
Definition at line 519 of file dbm_matrix.c.
const char* dbm_get_name | ( | const dbm_matrix_t * | matrix | ) |
Returns the name of the matrix of the given matrix.
Definition at line 535 of file dbm_matrix.c.
int dbm_get_nze | ( | const dbm_matrix_t * | matrix | ) |
Returns the number of local Non-Zero Elements of the given matrix.
Definition at line 541 of file dbm_matrix.c.
int dbm_get_num_blocks | ( | const dbm_matrix_t * | matrix | ) |
Returns the number of local blocks of the given matrix.
Definition at line 553 of file dbm_matrix.c.
void dbm_get_row_sizes | ( | const dbm_matrix_t * | matrix, |
int * | nrows, | ||
const int ** | row_sizes | ||
) |
Returns the row block sizes of the given matrix.
Definition at line 565 of file dbm_matrix.c.
void dbm_get_col_sizes | ( | const dbm_matrix_t * | matrix, |
int * | ncols, | ||
const int ** | col_sizes | ||
) |
Returns the column block sizes of the given matrix.
Definition at line 575 of file dbm_matrix.c.
void dbm_get_local_rows | ( | const dbm_matrix_t * | matrix, |
int * | nlocal_rows, | ||
const int ** | local_rows | ||
) |
Returns the local row block sizes of the given matrix.
Definition at line 585 of file dbm_matrix.c.
void dbm_get_local_cols | ( | const dbm_matrix_t * | matrix, |
int * | nlocal_cols, | ||
const int ** | local_cols | ||
) |
Returns the local column block sizes of the given matrix.
Definition at line 595 of file dbm_matrix.c.
int dbm_get_stored_coordinates | ( | const dbm_matrix_t * | matrix, |
const int | row, | ||
const int | col | ||
) |
Returns the MPI rank on which the given block should be stored.
Definition at line 605 of file dbm_matrix.c.
const dbm_distribution_t* dbm_get_distribution | ( | const dbm_matrix_t * | matrix | ) |
Returns the distribution of the given matrix.
Definition at line 614 of file dbm_matrix.c.
|
inlinestatic |
Internal routine that returns the number of shards for given matrix.
Definition at line 232 of file dbm_matrix.h.
|
inlinestatic |
Internal routine for getting a block's shard index.
Definition at line 240 of file dbm_matrix.h.