StarNEig Library  version v0.1-beta.6
A task-based library for solving 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 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 
89 starneig_distr_t starneig_distr_init();
90 
107 starneig_distr_t starneig_distr_init_mesh(
108  int rows, int cols, starneig_distr_order_t order);
109 
128 
154 starneig_distr_t starneig_distr_init_func(
155  int (*func)(int row, int col, void *arg), void *arg, size_t arg_size);
156 
165 starneig_distr_t starneig_distr_duplicate(starneig_distr_t distr);
166 
173 void starneig_distr_destroy(starneig_distr_t distr);
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 
248 starneig_distr_matrix_t starneig_distr_matrix_create(
249  int rows, int cols, int row_blksz, int col_blksz, starneig_datatype_t type,
250  starneig_distr_t distr);
251 
295 starneig_distr_matrix_t starneig_distr_matrix_create_local(
296  int rows, int cols, starneig_datatype_t type, int owner, double *A,
297  int ldA);
298 
305 void starneig_distr_matrix_destroy(starneig_distr_matrix_t matrix);
306 
318  starneig_distr_matrix_t source, starneig_distr_matrix_t dest);
319 
349  int sr, int sc, int dr, int dc, int rows, int cols,
350  starneig_distr_matrix_t source, starneig_distr_matrix_t dest);
351 
355 
360 
377  starneig_distr_matrix_t matrix, struct starneig_distr_block **blocks,
378  int *num_blocks);
379 
393 starneig_distr_t starneig_distr_matrix_get_distr(
394  starneig_distr_matrix_t matrix);
395 
404 starneig_datatype_t starneig_distr_matrix_get_datatype(
405  starneig_distr_matrix_t matrix);
406 
415 size_t starneig_distr_matrix_get_elemsize(starneig_distr_matrix_t matrix);
416 
425 int starneig_distr_matrix_get_rows(starneig_distr_matrix_t matrix);
426 
435 int starneig_distr_matrix_get_cols(starneig_distr_matrix_t matrix);
436 
445 int starneig_distr_matrix_get_row_blksz(starneig_distr_matrix_t matrix);
446 
455 int starneig_distr_matrix_get_col_blksz(starneig_distr_matrix_t matrix);
456 
460 
464 
465 // deprecated
466 void starneig_broadcast(int root, size_t size, void *buffer);
467 
468 #ifdef __cplusplus
469 }
470 #endif
471 
472 #endif // STARNEIG_DISTR_MATRIX_H
int starneig_distr_matrix_get_col_blksz(starneig_distr_matrix_t matrix)
Returns the number of columns in a distribution block.
Double precision real numbers.
Definition: distr_matrix.h:195
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_t starneig_distr_init()
Creates a default data distribution.
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.
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_t starneig_distr_init_mesh(int rows, int cols, starneig_distr_order_t order)
Creates a two-dimensional block cyclic data distribution.
void starneig_distr_matrix_destroy(starneig_distr_matrix_t matrix)
Destroys a distributed matrix.
void starneig_distr_destroy(starneig_distr_t distr)
Destroys a data distribution.
void * ptr
A pointer to the local array.
Definition: distr_matrix.h:207
starneig_datatype_t starneig_distr_matrix_get_datatype(starneig_distr_matrix_t matrix)
Returns the matrix element data type.
int glo_col
The leftmost global column that belong to the block.
Definition: distr_matrix.h:205
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.
int row_blksz
The number of rows in the block.
Definition: distr_matrix.h:202
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.
Default ordering.
Definition: distr_matrix.h:79
This file contains StarNEig library configuration.
starneig_distr_order_t
Process mapping order.
Definition: distr_matrix.h:78
int starneig_distr_matrix_get_cols(starneig_distr_matrix_t matrix)
Returns the number of (global) columns.
Row-major natural ordering.
Definition: distr_matrix.h:80
size_t starneig_distr_matrix_get_elemsize(starneig_distr_matrix_t matrix)
Returns the matrix element size.
int glo_row
The topmost global row that belong to the block.
Definition: distr_matrix.h:204
void starneig_broadcast(int root, size_t size, void *buffer)
Broadcast a buffer. Deprecated.
struct starneig_distr_matrix * starneig_distr_matrix_t
Distributed matrix.
Definition: distr_matrix.h:189
int ld
The leading dimension of the local array.
Definition: distr_matrix.h:206
Distributed block.
Definition: distr_matrix.h:201
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.
int col_blksz
The number of columns in the block.
Definition: distr_matrix.h:203
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_t starneig_distr_duplicate(starneig_distr_t distr)
Duplicates a data distribution.
starneig_datatype_t
Distributed matrix element data type.
Definition: distr_matrix.h:194
struct starneig_distr * starneig_distr_t
Data distribution.
Definition: distr_matrix.h:73
Column-major natural ordering.
Definition: distr_matrix.h:81
int starneig_distr_matrix_get_row_blksz(starneig_distr_matrix_t matrix)
Returns the number of rows in a distribution block.
int starneig_distr_matrix_get_rows(starneig_distr_matrix_t matrix)
Returns the number of (global) rows.