StarNEig User's Guide  master branch
A task-based library for solving dense nonsymmetric eigenvalue problems
distr_matrix.h
Go to the documentation of this file.
1 
40 #ifndef STARNEIG_DISTR_MATRIX_H
41 #define STARNEIG_DISTR_MATRIX_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 #include <starneig/configuration.h>
48 
49 #ifndef STARNEIG_ENABLE_MPI
50 #error "This header should be included only when STARNEIG_ENABLE_MPI is defined."
51 #endif
52 
53 #include <stddef.h>
54 
62 
67 
68 struct starneig_distr;
69 
73 typedef struct starneig_distr * starneig_distr_t;
74 
78 typedef enum {
83 
90 
108  int rows, int cols, starneig_distr_order_t order);
109 
128 
155  int (*func)(int row, int col, void *arg), void *arg, size_t arg_size);
156 
166 
174 
178 
183 
184 struct starneig_distr_matrix;
185 
189 typedef struct starneig_distr_matrix * starneig_distr_matrix_t;
190 
194 typedef enum {
197 
202  int row_blksz;
203  int col_blksz;
204  int glo_row;
205  int glo_col;
206  int ld;
207  void *ptr;
208 };
209 
249  int rows, int cols, int row_blksz, int col_blksz, starneig_datatype_t type,
250  starneig_distr_t distr);
251 
296  int rows, int cols, starneig_datatype_t type, int owner, double *A,
297  int ldA);
298 
306 
319 
349  int sr, int sc, int dr, int dc, int rows, int cols,
351 
355 
360 
377  starneig_distr_matrix_t matrix, struct starneig_distr_block **blocks,
378  int *num_blocks);
379 
394  starneig_distr_matrix_t matrix);
395 
405  starneig_distr_matrix_t matrix);
406 
416 
426 
436 
446 
456 
460 
464 
465 #ifdef __cplusplus
466 }
467 #endif
468 
469 #endif // STARNEIG_DISTR_MATRIX_H
STARNEIG_ORDER_ROW_MAJOR
@ STARNEIG_ORDER_ROW_MAJOR
Row-major natural ordering.
Definition: distr_matrix.h:80
starneig_distr_matrix_get_col_blksz
int starneig_distr_matrix_get_col_blksz(starneig_distr_matrix_t matrix)
Returns the number of columns in a distribution block.
starneig_distr_matrix_copy_region
void starneig_distr_matrix_copy_region(int sr, int sc, int dr, int dc, int rows, int cols, starneig_distr_matrix_t source, starneig_distr_matrix_t dest)
Copies region of a distributed matrix to a second distributed matrix.
starneig_distr_matrix_create_local
starneig_distr_matrix_t starneig_distr_matrix_create_local(int rows, int cols, starneig_datatype_t type, int owner, double *A, int ldA)
Creates a single-owner distributed matrix from a local matrix.
starneig_distr_init
starneig_distr_t starneig_distr_init()
Creates a default data distribution.
starneig_distr_block::glo_col
int glo_col
The leftmost global column that belong to the block.
Definition: distr_matrix.h:205
starneig_distr_init_mesh
starneig_distr_t starneig_distr_init_mesh(int rows, int cols, starneig_distr_order_t order)
Creates a two-dimensional block cyclic data distribution.
starneig_distr_matrix_get_blocks
void starneig_distr_matrix_get_blocks(starneig_distr_matrix_t matrix, struct starneig_distr_block **blocks, int *num_blocks)
Returns the locally owned distributed blocks.
starneig_distr_matrix_destroy
void starneig_distr_matrix_destroy(starneig_distr_matrix_t matrix)
Destroys a distributed matrix.
starneig_distr_destroy
void starneig_distr_destroy(starneig_distr_t distr)
Destroys a data distribution.
starneig_distr_block::ptr
void * ptr
A pointer to the local array.
Definition: distr_matrix.h:207
STARNEIG_ORDER_COL_MAJOR
@ STARNEIG_ORDER_COL_MAJOR
Column-major natural ordering.
Definition: distr_matrix.h:81
starneig_distr_block::row_blksz
int row_blksz
The number of rows in the block.
Definition: distr_matrix.h:202
starneig_distr_matrix_get_datatype
starneig_datatype_t starneig_distr_matrix_get_datatype(starneig_distr_matrix_t matrix)
Returns the matrix element data type.
starneig_distr_matrix_copy
void starneig_distr_matrix_copy(starneig_distr_matrix_t source, starneig_distr_matrix_t dest)
Copies the contents of a distributed matrix to a second distributed matrix.
starneig_distr_init_func
starneig_distr_t starneig_distr_init_func(int(*func)(int row, int col, void *arg), void *arg, size_t arg_size)
Creates a distribution using a data distribution function.
starneig_distr_order_t
starneig_distr_order_t
Process mapping order.
Definition: distr_matrix.h:78
starneig_distr_matrix_get_elemsize
size_t starneig_distr_matrix_get_elemsize(starneig_distr_matrix_t matrix)
Returns the matrix element size.
starneig_distr_matrix_get_cols
int starneig_distr_matrix_get_cols(starneig_distr_matrix_t matrix)
Returns the number of (global) columns.
starneig_distr_block::glo_row
int glo_row
The topmost global row that belong to the block.
Definition: distr_matrix.h:204
starneig_distr_block::ld
int ld
The leading dimension of the local array.
Definition: distr_matrix.h:206
starneig_distr_matrix_t
struct starneig_distr_matrix * starneig_distr_matrix_t
Distributed matrix.
Definition: distr_matrix.h:189
STARNEIG_REAL_DOUBLE
@ STARNEIG_REAL_DOUBLE
Double precision real numbers.
Definition: distr_matrix.h:195
starneig_distr_matrix_create
starneig_distr_matrix_t starneig_distr_matrix_create(int rows, int cols, int row_blksz, int col_blksz, starneig_datatype_t type, starneig_distr_t distr)
Creates a distributed matrix with uninitialized matrix elements.
configuration.h
This file contains StarNEig library configuration.
starneig_distr_block
Distributed block.
Definition: distr_matrix.h:201
STARNEIG_ORDER_DEFAULT
@ STARNEIG_ORDER_DEFAULT
Default ordering.
Definition: distr_matrix.h:79
starneig_datatype_t
starneig_datatype_t
Distributed matrix element data type.
Definition: distr_matrix.h:194
starneig_distr_matrix_get_distr
starneig_distr_t starneig_distr_matrix_get_distr(starneig_distr_matrix_t matrix)
Returns the distribution that is associated with a distributed matrix.
starneig_distr_duplicate
starneig_distr_t starneig_distr_duplicate(starneig_distr_t distr)
Duplicates a data distribution.
starneig_distr_matrix_get_row_blksz
int starneig_distr_matrix_get_row_blksz(starneig_distr_matrix_t matrix)
Returns the number of rows in a distribution block.
starneig_distr_t
struct starneig_distr * starneig_distr_t
Data distribution.
Definition: distr_matrix.h:73
starneig_distr_block::col_blksz
int col_blksz
The number of columns in the block.
Definition: distr_matrix.h:203
starneig_distr_matrix_get_rows
int starneig_distr_matrix_get_rows(starneig_distr_matrix_t matrix)
Returns the number of (global) rows.