librsb
1.2.0.8
|
This file declares the user interface functions and data structures for the librsb
library.
More...
Data Structures | |
struct | rsb_initopts |
A structure specifying library (initialization) options, to be used with the rsb_lib_reinit() function. . More... | |
Typedefs | |
typedef rsb_flags_t | rsb_marf_t |
typedef rsb_flags_t | rsb_precf_t |
Type definitions | |
typedef signed int | rsb_blk_idx_t |
typedef signed int | rsb_coo_idx_t |
typedef signed int | rsb_nnz_idx_t |
typedef signed int | rsb_flags_t |
typedef char | rsb_type_t |
typedef signed int | rsb_err_t |
typedef signed int | rsb_int_t |
typedef rsb_flags_t | rsb_bool_t |
typedef rsb_flags_t | rsb_trans_t |
typedef double | rsb_real_t |
typedef char | rsb_char_t |
typedef rsb_real_t | rsb_time_t |
Functions | |
rsb_err_t | rsb_strerror_r (rsb_err_t errval, rsb_char_t *buf, size_t buflen) |
rsb_err_t | rsb_perror (void *stream, rsb_err_t errval) |
rsb_err_t | rsb_lib_init (struct rsb_initopts *iop) |
rsb_err_t | rsb_lib_reinit (struct rsb_initopts *iop) |
rsb_err_t | rsb_lib_set_opt_str (const rsb_char_t *opnp, const rsb_char_t *opvp) |
rsb_err_t | rsb_lib_set_opt (enum rsb_opt_t iof, const void *iop) |
rsb_err_t | rsb_lib_get_opt (enum rsb_opt_t iof, void *iop) |
rsb_err_t | rsb_lib_exit (struct rsb_initopts *iop) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_coo_begin (rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
rsb_err_t | rsb_mtx_alloc_from_coo_end (struct rsb_mtx_t **mtxApp) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_csr_const (const void *VA, const rsb_coo_idx_t *RP, const rsb_coo_idx_t *JA, rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_blk_idx_t brA, rsb_blk_idx_t bcA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_csc_const (const void *VA, const rsb_coo_idx_t *IA, const rsb_coo_idx_t *CP, rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_blk_idx_t brA, rsb_blk_idx_t bcA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_csr_inplace (void *VA, rsb_nnz_idx_t *RP, rsb_coo_idx_t *JA, rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_blk_idx_t brA, rsb_blk_idx_t bcA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_coo_const (const void *VA, const rsb_coo_idx_t *IA, const rsb_coo_idx_t *JA, rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_blk_idx_t brA, rsb_blk_idx_t bcA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
struct rsb_mtx_t * | rsb_mtx_alloc_from_coo_inplace (void *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_nnz_idx_t nnzA, rsb_type_t typecode, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_blk_idx_t brA, rsb_blk_idx_t bcA, rsb_flags_t flagsA, rsb_err_t *errvalp) |
rsb_err_t | rsb_mtx_clone (struct rsb_mtx_t **mtxBpp, rsb_type_t typecode, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_flags_t flags) |
struct rsb_mtx_t * | rsb_mtx_free (struct rsb_mtx_t *mtxAp) |
rsb_err_t | rsb_mtx_get_nrm (const struct rsb_mtx_t *mtxAp, void *Np, enum rsb_extff_t flags) |
rsb_err_t | rsb_mtx_get_vec (const struct rsb_mtx_t *mtxAp, void *Dp, enum rsb_extff_t flags) |
rsb_err_t | rsb_mtx_rndr (const rsb_char_t *filename, const struct rsb_mtx_t *mtxAp, rsb_coo_idx_t pmWidth, rsb_coo_idx_t pmHeight, rsb_marf_t rflags) |
rsb_err_t | rsb_file_mtx_rndr (void *pmp, const rsb_char_t *filename, rsb_coo_idx_t pmlWidth, rsb_coo_idx_t pmWidth, rsb_coo_idx_t pmHeight, rsb_marf_t rflags) |
rsb_err_t | rsb_spmv (rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, const void *Xp, rsb_coo_idx_t incX, const void *betap, void *Yp, rsb_coo_idx_t incY) |
rsb_err_t | rsb_spmm (rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_coo_idx_t nrhs, rsb_flags_t order, const void *Bp, rsb_nnz_idx_t ldB, const void *betap, void *Cp, rsb_nnz_idx_t ldC) |
rsb_err_t | rsb_spsv (rsb_trans_t transT, const void *alphap, const struct rsb_mtx_t *mtxTp, const void *Xp, rsb_coo_idx_t incX, void *Yp, rsb_coo_idx_t incY) |
rsb_err_t | rsb_spsm (rsb_trans_t transT, const void *alphap, const struct rsb_mtx_t *mtxTp, rsb_coo_idx_t nrhs, rsb_flags_t order, const void *betap, const void *Bp, rsb_nnz_idx_t ldB, void *Cp, rsb_nnz_idx_t ldC) |
rsb_err_t | rsb_mtx_add_to_dense (const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_nnz_idx_t ldB, rsb_nnz_idx_t nrB, rsb_nnz_idx_t ncB, rsb_bool_t rowmajorB, void *Bp) |
struct rsb_mtx_t * | rsb_sppsp (rsb_type_t typecode, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_trans_t transB, const void *betap, const struct rsb_mtx_t *mtxBp, rsb_err_t *errvalp) |
struct rsb_mtx_t * | rsb_spmsp (rsb_type_t typecode, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_trans_t transB, const void *betap, const struct rsb_mtx_t *mtxBp, rsb_err_t *errvalp) |
rsb_err_t | rsb_spmsp_to_dense (rsb_type_t typecode, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_trans_t transB, const void *betap, const struct rsb_mtx_t *mtxBp, rsb_nnz_idx_t ldC, rsb_nnz_idx_t nrC, rsb_nnz_idx_t ncC, rsb_bool_t rowmajorC, void *Cp) |
rsb_err_t | rsb_mtx_switch_to_coo (struct rsb_mtx_t *mtxAp, void **VAp, rsb_coo_idx_t **IAp, rsb_coo_idx_t **JAp, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_switch_to_csr (struct rsb_mtx_t *mtxAp, void **VAp, rsb_coo_idx_t **IAp, rsb_coo_idx_t **JAp, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_coo (const struct rsb_mtx_t *mtxAp, void *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_csr (rsb_type_t typecode, const struct rsb_mtx_t *mtxAp, void *VA, rsb_nnz_idx_t *RP, rsb_coo_idx_t *JA, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_rows_sparse (rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, void *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_coo_idx_t frA, rsb_coo_idx_t lrA, rsb_nnz_idx_t *rnzp, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_coo_block (const struct rsb_mtx_t *mtxAp, void *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_coo_idx_t frA, rsb_coo_idx_t lrA, rsb_coo_idx_t fcA, rsb_coo_idx_t lcA, rsb_coo_idx_t *IREN, rsb_coo_idx_t *JREN, rsb_nnz_idx_t *rnzp, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_info (const struct rsb_mtx_t *mtxAp, enum rsb_mif_t miflags, void *minfop) |
rsb_err_t | rsb_mtx_get_info_str (const struct rsb_mtx_t *mtxAp, const rsb_char_t *mis, void *minfop, size_t buflen) |
rsb_err_t | rsb_mtx_upd_vals (struct rsb_mtx_t *mtxAp, enum rsb_elopf_t elop_flags, const void *omegap) |
rsb_err_t | rsb_mtx_get_prec (void *opdp, const struct rsb_mtx_t *mtxAp, rsb_precf_t prec_flags, const void *ipdp) |
rsb_err_t | rsb_mtx_set_vals (struct rsb_mtx_t *mtxAp, const void *VA, const rsb_coo_idx_t *IA, const rsb_coo_idx_t *JA, rsb_nnz_idx_t nnz, rsb_flags_t flags) |
rsb_err_t | rsb_mtx_get_vals (const struct rsb_mtx_t *mtxAp, void *VA, const rsb_coo_idx_t *IA, const rsb_coo_idx_t *JA, rsb_nnz_idx_t nnz, rsb_flags_t flags) |
rsb_err_t | rsb_tune_spmm (struct rsb_mtx_t **mtxOpp, rsb_real_t *sfp, rsb_int_t *tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_coo_idx_t nrhs, rsb_flags_t order, const void *Bp, rsb_nnz_idx_t ldB, const void *betap, void *Cp, rsb_nnz_idx_t ldC) |
rsb_err_t | rsb_tune_spsm (struct rsb_mtx_t **mtxOpp, rsb_real_t *sfp, rsb_int_t *tnp, rsb_int_t maxr, rsb_time_t maxt, rsb_trans_t transA, const void *alphap, const struct rsb_mtx_t *mtxAp, rsb_coo_idx_t nrhs, rsb_flags_t order, const void *Bp, rsb_nnz_idx_t ldB, const void *betap, void *Cp, rsb_nnz_idx_t ldC) |
rsb_trans_t | rsb_psblas_trans_to_rsb_trans (const char psbtrans) |
rsb_err_t | rsb_file_mtx_save (const struct rsb_mtx_t *mtxAp, const rsb_char_t *filename) |
struct rsb_mtx_t * | rsb_file_mtx_load (const rsb_char_t *filename, rsb_flags_t flagsA, rsb_type_t typecode, rsb_err_t *errvalp) |
rsb_err_t | rsb_file_vec_load (const rsb_char_t *filename, rsb_type_t typecode, void *Yp, rsb_coo_idx_t *yvlp) |
rsb_err_t | rsb_file_vec_save (const rsb_char_t *filename, rsb_type_t typecode, const void *Yp, rsb_coo_idx_t yvl) |
rsb_err_t | rsb_file_mtx_get_dims (const rsb_char_t *filename, rsb_coo_idx_t *nrp, rsb_coo_idx_t *ncp, rsb_coo_idx_t *nzp, rsb_flags_t *flagsp) |
rsb_err_t | rsb_coo_sort (void *VA, rsb_coo_idx_t *IA, rsb_coo_idx_t *JA, rsb_nnz_idx_t nnzA, rsb_coo_idx_t nrA, rsb_coo_idx_t ncA, rsb_type_t typecode, rsb_flags_t flagsA) |
rsb_time_t | rsb_time (void) |
This file declares the user interface functions and data structures for the librsb
library.
#define RSB_BOOL_FALSE 0 |
A "false" value for rsb_bool_t.
#define RSB_BOOL_TRUE 1 |
A "true" value for rsb_bool_t.
#define RSB_CHAR_BIT 8 /* bits per byte; if not 8, librsb compilation should fail */ |
#define RSB_DEFAULT_BLOCKING 1 |
A safe value for column blocking (reserved for future use).
#define RSB_DEFAULT_COL_BLOCKING 1 |
Reserved for future use.
#define RSB_DEFAULT_ROW_BLOCKING 1 |
Reserved for future use.
#define RSB_DO_FLAG_ADD | ( | V, | |
F | |||
) | (V) |= (F) |
The flag variable V
gets the logical OR value with flag F
.
#define RSB_DO_FLAG_DEL | ( | V, | |
F | |||
) | (V) &= ~(F) |
The flag variable V
gets the logical NAND value with flag F
.
#define RSB_DO_FLAG_FILTERONLY | ( | V, | |
F | |||
) | ((V) & (F)) |
The flag variable V
after logical AND value with flag F
.
#define RSB_DO_FLAG_FILTEROUT | ( | V, | |
F | |||
) | ((V) & ~(F)) |
The flag variable V
after logical NAND value with flag F
.
#define RSB_DO_FLAG_HAS | ( | V, | |
F | |||
) | ((((V)&(F))==(F))?RSB_BOOL_TRUE:RSB_BOOL_FALSE) |
Presence check for flag F
.
#define RSB_DO_FLAG_HAS_INTERSECTION | ( | V, | |
F | |||
) | (((V)&(F))?RSB_BOOL_TRUE:RSB_BOOL_FALSE) |
Presence check for flag F
.
#define RSB_ERR_BADARGS RSB_ERR_CAST(0x020) |
The user supplied some corrupt data as argument.
#define RSB_ERR_CAST | ( | E | ) | (-(E)) |
A macro for the error code value.
#define RSB_ERR_CORRUPT_INPUT_DATA RSB_ERR_CAST(0x1000) |
User supplied data (e.g.: from file) was corrupt.
#define RSB_ERR_COULD_NOT_HONOUR_EXTERNALLY_ALLOCATION_FLAGS RSB_ERR_CAST(0x4000) |
User gave flags for an in place assembly in a copy-based function.
#define RSB_ERR_ENOMEM RSB_ERR_CAST(0x040) |
There is not enough dynamical memory to perform the requested operation.
#define RSB_ERR_FAILED_MEMHIER_DETECTION RSB_ERR_CAST(0x2000) |
Memory hierarchy info failed to be detected. You can bypass this by setting a meaningful RSB_USER_SET_MEM_HIERARCHY_INFO
environment variable.
#define RSB_ERR_FORTRAN_ERROR RSB_ERR_GENERIC_ERROR |
A Fortran specific error occurred.
#define RSB_ERR_GENERIC_ERROR RSB_ERR_CAST(0x001) |
An unspecified, generic error occurred.
#define RSB_ERR_INTERNAL_ERROR RSB_ERR_CAST(0x010) |
An error occurred which is not apparently caused by a user's fault (internal error).
#define RSB_ERR_INVALID_NUMERICAL_DATA RSB_ERR_CAST(0x10000) |
User gave some input with invalid numerical data.
#define RSB_ERR_LIMITS RSB_ERR_CAST(0x200) |
The requested operation could not be executed, or index overflow will happen.
#define RSB_ERR_MEMORY_LEAK RSB_ERR_CAST(0x20000) |
Probable memory leak (user did not deallocate librsb structures before calling rsb_lib_exit()).
#define RSB_ERR_NO_ERROR RSB_ERR_CAST(0x000) |
No error occurred (success). The return value that means function operation success, in most cases.
#define RSB_ERR_NO_STREAM_OUTPUT_CONFIGURED_OUT RSB_ERR_CAST(0x8000) |
User requested writing to a file stream, while this feature is configured out.
#define RSB_ERR_NO_USER_CONFIGURATION RSB_ERR_CAST(0x800) |
A file containing user set configuration was not present.
#define RSB_ERR_TO_PROGRAM_ERROR | ( | E | ) | ((E)==(RSB_ERR_NO_ERROR)?RSB_PROGRAM_SUCCESS:RSB_PROGRAM_ERROR) |
Program error code (int).
#define RSB_ERR_UNIMPLEMENTED_YET RSB_ERR_CAST(0x100) |
The requested operation was not implemented yet in this code revision (but probably will be, someday).
#define RSB_ERR_UNSUPPORTED_FEATURE RSB_ERR_CAST(0x400) |
The requested feature (e.g.:blocking) is not available because it was opted out or not configured at build time.
#define RSB_ERR_UNSUPPORTED_FORMAT RSB_ERR_CAST(0x008) |
The user requested to use a matrix storage format which is not supported (e.g.: was opted out at build time).
#define RSB_ERR_UNSUPPORTED_OPERATION RSB_ERR_CAST(0x002) |
The user requested an operation which is not supported (e.g.: was opted out at build time).
#define RSB_ERR_UNSUPPORTED_TYPE RSB_ERR_CAST(0x004) |
The user requested to use a type which is not supported (e.g.: was opted out at build time).
#define RSB_ERRS_UNSUPPORTED_FEATURES (RSB_ERR_UNSUPPORTED_FEATURE|RSB_ERR_NO_STREAM_OUTPUT_CONFIGURED_OUT) |
Collation of "unsupported" type errors.
#define rsb_file_mtx_get_dimensions rsb_file_mtx_get_dims |
#define rsb_file_mtx_render rsb_file_mtx_rndr |
#define RSB_FLAG_ASSEMBLED_IN_COO_ARRAYS 0x040000 |
If set, matrices will be fit in the three input coo arrays, after conversion.
#define RSB_FLAG_C_INDICES_INTERFACE 0x000000 |
If set, the input/output coordinate indices will be assumed to be 0 based (default).
#define RSB_FLAG_DEFAULT_COO_MATRIX_FLAGS RSB_FLAG_WANT_COO_STORAGE |
A flag combination specifying a pure COO matrix.
#define RSB_FLAG_DEFAULT_CSR_MATRIX_FLAGS RSB_FLAG_WANT_BCSS_STORAGE |
A flag combination specifying a pure CSR matrix.
#define RSB_FLAG_DEFAULT_MATRIX_FLAGS RSB_FLAG_DEFAULT_RSB_MATRIX_FLAGS |
A flag combination specifying a matrix in a default, supported format.
#define RSB_FLAG_DEFAULT_RSB_MATRIX_FLAGS (RSB_FLAG_QUAD_PARTITIONING|RSB_FLAG_USE_HALFWORD_INDICES|RSB_FLAG_WANT_COO_STORAGE|RSB_FLAG_WANT_BCSS_STORAGE) |
A flag combination specifying a pure RSB matrix.
#define RSB_FLAG_DEFAULT_STORAGE_FLAGS (RSB_FLAG_WANT_BCSS_STORAGE|RSB_FLAG_WANT_COO_STORAGE) |
Default storage flags.
#define RSB_FLAG_DIAGONAL (RSB_FLAG_UPPER | RSB_FLAG_LOWER) |
Combined flags for a diagonal matrix.
#define RSB_FLAG_DISCARD_ZEROS 0x000400 |
If set, explicit zeros will not be inserted
#define RSB_FLAG_DUPLICATES_DEFAULT_HANDLE 0x000000 |
The default nonzeroes duplicates handling.
#define RSB_FLAG_DUPLICATES_KEEP_LAST 0x000000 |
Keep the last nonzero duplicate, at matrix assembly time.
#define RSB_FLAG_DUPLICATES_SUM 0x000200 |
Compute and keep the sum of nonzero duplicates, at matrix assembly time.
#define RSB_FLAG_EXPERIMENTAL_IN_PLACE_PERMUTATION_SORT 0x080000 |
#define RSB_FLAG_EXTERNALLY_ALLOCATED_ARRAYS 0x40000000 |
If set, the input COO arrays to the assembly functions will not be freed at matrix destruction time.
#define RSB_FLAG_FORTRAN_INDICES_INTERFACE 0x000001 |
If set, the input/output coordinate indices will be assumed to be 1 based.
#define RSB_FLAG_HERMITIAN 0x800000 |
If set, the input matrix will be treated as symmetric hermitian (stored as a lower triangular one).
#define RSB_FLAG_IDENTICAL_FLAGS RSB_FLAG_NOFLAGS |
The identical flag (used in cloning function rsb_mtx_clone).
#define RSB_FLAG_LOWER 0x000010 |
If set, the matrix will be stored in as lower (triangular or symmetric).
#define RSB_FLAG_LOWER_HERMITIAN (RSB_FLAG_HERMITIAN | RSB_FLAG_LOWER) |
Combined flags for a lower hermitian matrix.
#define RSB_FLAG_LOWER_SYMMETRIC (RSB_FLAG_SYMMETRIC | RSB_FLAG_LOWER) |
Combined flags for a symmetric, lower-stored matrix.
#define RSB_FLAG_LOWER_TRIANGULAR (RSB_FLAG_TRIANGULAR | RSB_FLAG_LOWER) |
Combined flags for a lower triangular matrix.
#define RSB_FLAG_MUTUALLY_EXCLUSIVE_SWITCHES (RSB_FLAG_USE_HALFWORD_INDICES_COO|RSB_FLAG_USE_HALFWORD_INDICES_CSR) |
A combination of flags which is forbidden (so don't use it).
#define RSB_FLAG_NOFLAGS 0x000000 |
The null (empty) flag.
#define RSB_FLAG_QUAD_PARTITIONING 0x002000 |
If set, matrix will be organized as a quad tree of submatrices.
#define RSB_FLAG_RECURSIVE_MORE_LEAVES_THAN_THREADS 0x1000000 |
If set, recursion on small matrices will last at least the number of active threads.
#define RSB_FLAG_RECURSIVE_SUBDIVIDE_MORE_ON_DIAG 0x8000000 |
If set, the matrix will be subdivided at a finer grain on diagonal blocks.
#define RSB_FLAG_SORTED_INPUT 0x000004 |
If set, the code will assume the input nonzeroes as sorted.
#define RSB_FLAG_SYMMETRIC 0x400000 |
If set, the input matrix will be treated as symmetric (stored as a lower triangular one by default).
#define RSB_FLAG_TRIANGULAR 0x000008 |
If set, the matrix is considered as triangular.
#define RSB_FLAG_UNIT_DIAG_IMPLICIT 0x000040 |
If set, the (whole super-)matrix will not store the diagonal, which will be assumed to be unitary.
#define RSB_FLAG_UPPER 0x000020 |
If set, the matrix will be stored in as upper (triangular or symmetric).
#define RSB_FLAG_UPPER_HERMITIAN (RSB_FLAG_HERMITIAN | RSB_FLAG_UPPER) |
Combined flags for an upper hermitian matrix.
#define RSB_FLAG_UPPER_SYMMETRIC (RSB_FLAG_SYMMETRIC | RSB_FLAG_UPPER) |
Combined flags for a symmetric, upper-stored matrix.
#define RSB_FLAG_UPPER_TRIANGULAR (RSB_FLAG_TRIANGULAR | RSB_FLAG_UPPER) |
Combined flags for an upper triangular matrix.
#define RSB_FLAG_USE_CSR_RESERVED 0x200000 |
#define RSB_FLAG_USE_HALFWORD_INDICES 0x000002 |
If set, the matrix will internally use a half word (16 bit) type for indices.
#define RSB_FLAG_USE_HALFWORD_INDICES_COO (RSB_FLAG_USE_HALFWORD_INDICES|RSB_FLAG_WANT_COO_STORAGE) |
Combined flags for half word COO.
#define RSB_FLAG_USE_HALFWORD_INDICES_CSR (RSB_FLAG_USE_HALFWORD_INDICES|RSB_FLAG_USE_CSR_RESERVED) |
#define RSB_FLAG_WANT_BCSS_STORAGE 0x004000 |
If set, the block partitioning will be fixed (BCSS: BCSR or BCSC, but no VBR).
#define RSB_FLAG_WANT_COLUMN_MAJOR_ORDER 0x4000000 |
Used to specify multi-vector (dense matrix) operations.
#define RSB_FLAG_WANT_COO_STORAGE 0x000100 |
If set, the matrix will use COO storage, where necessary.
#define RSB_FLAG_WANT_ROW_MAJOR_ORDER 0x000000 |
Used to specify multi-vector (dense matrix) operations.
#define RSB_HALF_MAX_SIGNED | ( | T | ) | ((T)1 << (sizeof(T)*RSB_CHAR_BIT-2)) |
#define RSB_INVALID_COO_IDX_VAL ((RSB_MARKER_COO_VALUE)+1) /*< A value which is illegal for any #rsb_coo_idx_t variable. */ |
#define RSB_INVALID_NNZ_IDX_VAL ((RSB_MARKER_NNZ_VALUE)+1) /*< A value which is illegal for any #rsb_nnz_idx_t variable. */ |
#define RSB_IO_SPECIFIER_GET 1 |
Specifies to RSB_REINIT_SINGLE_VALUE that a given rsb_initopts is going to be get by the user.
#define RSB_IO_SPECIFIER_SET 0 |
Specifies to RSB_REINIT_SINGLE_VALUE that a given rsb_initopts is going to be set by the user.
#define RSB_IS_SIGNED | ( | T | ) | (((T)0) > (((T)-1))) |
#define RSB_MARF_EPS 0x00000030 |
rsb_marf_t Flag value for requesting an Encapsulated Postscript rendering of a matrix (spy plot + blocks).
#define RSB_MARF_EPS_B 0x00000020 |
rsb_marf_t Flag value for requesting an Encapsulated Postscript rendering of a matrix (blocks plot).
#define RSB_MARF_EPS_L 0x00000070 |
rsb_marf_t Flag value for requesting an Encapsulated Postscript rendering of a matrix (spy plot + blocks + labels).
#define RSB_MARF_EPS_S 0x00000010 |
rsb_marf_t Flag value for requesting an Encapsulated Postscript rendering of a matrix (spy plot).
#define RSB_MARF_RGB 0x00000001 |
rsb_marf_t Flag value for requesting an RGB rendering of a matrix.
#define RSB_MARKER_COO_VALUE (RSB_MAX_MATRIX_DIM+1) /* */ |
#define RSB_MARKER_NNZ_VALUE (RSB_MAX_MATRIX_NNZ+1) /* */ |
#define RSB_MAX_MATRIX_DIM (RSB_MAX_VALUE_FOR_TYPE(rsb_coo_idx_t)-RSB_NNZ_BLK_MAX-255) /*!> Maximum allowed matrix dimension. */ |
#define RSB_MAX_MATRIX_NNZ (RSB_MAX_VALUE_FOR_TYPE(rsb_nnz_idx_t)-RSB_NNZ_BLK_MAX) /*!> Maximum allowed matrix nonzeroes count. */ |
#define RSB_MAX_SIGNED | ( | T | ) | (RSB_HALF_MAX_SIGNED(T) - 1 + RSB_HALF_MAX_SIGNED(T)) |
#define RSB_MAX_UNSIGNED | ( | T | ) | ((T)-1) |
#define RSB_MAX_VALUE_FOR_TYPE | ( | T | ) | (RSB_IS_SIGNED(T)?RSB_MAX_SIGNED(T):RSB_MAX_UNSIGNED(T)) |
#define RSB_MIN_MATRIX_DIM 0 /*!> Minimum allowed matrix dimension. */ |
#define RSB_MIN_MATRIX_NNZ 0 /*!> Minimum allowed matrix nonzeroes count. */ |
#define rsb_mtx_get_norm rsb_mtx_get_nrm |
#define rsb_mtx_get_preconditioner rsb_mtx_get_prec |
#define rsb_mtx_get_values rsb_mtx_get_vals |
#define rsb_mtx_set_values rsb_mtx_set_vals |
#define rsb_mtx_upd_values rsb_mtx_upd_vals |
#define RSB_NNZ_BLK_MAX 255 /* Dense block maximal allowed size (still unused, for now internal) */ |
#define RSB_NULL_EXIT_OPTIONS NULL |
A valid value for specifying default (null) options to rsb_lib_exit().
#define RSB_NULL_INIT_OPTIONS NULL |
A valid value for specifying default (null) options to rsb_lib_init().
#define RSB_PRECF_ILU0 0x00000001 |
ILU-0 preconditioner request to rsb_mtx_get_prec().
#define RSB_PROGRAM_ERROR (-1) |
Program error code (int).
#define RSB_PROGRAM_SUCCESS (0) |
Program success error code (int).
#define RSB_REINIT_SINGLE_VALUE | ( | IOF, | |
IOP, | |||
IOS, | |||
ERRVAL | |||
) | { enum rsb_opt_t keys[]={IOF}; void*values[]={(IOP)}; struct rsb_initopts io; io.action=(IOS); io.keys=keys; io.values=values; io.n_pairs=1; ERRVAL=rsb_lib_reinit(&io); } |
A handy macro for invoking rsb_lib_reinit() with a single get/set specifier. An appropriate I/O flag is supplied as first parameter; a valid pointer (according to the flag) should be passed as second parameter; either RSB_IO_SPECIFIER_SET or RSB_IO_SPECIFIER_GET is passed as third parameter; a rsb_err_t variable as fourth one, in order to detect any error.
#define RSB_REINIT_SINGLE_VALUE_C_IOP | ( | IOF, | |
IOP, | |||
IOS, | |||
ERRVAL | |||
) | { enum rsb_opt_t keys[]={IOF}; const void*values[]={(IOP)}; struct rsb_initopts io; io.action=(IOS); io.keys=keys; (io.values)=(void**)values; io.n_pairs=1; ERRVAL=rsb_lib_reinit(&io); } |
Like RSB_REINIT_SINGLE_VALUE, but considering IOP
const
.
#define RSB_REINIT_SINGLE_VALUE_GET | ( | IOF, | |
IOP, | |||
ERRVAL | |||
) | RSB_REINIT_SINGLE_VALUE(IOF,IOP,RSB_IO_SPECIFIER_GET,ERRVAL) |
A handy macro for invoking RSB_REINIT_SINGLE_VALUE with a single get specifier. An appropriate I/O flag is supplied as first parameter; a valid pointer (according to the flag) should be passed as second parameter; a rsb_err_t variable as third one, in order to detect any error.
#define RSB_REINIT_SINGLE_VALUE_SET | ( | IOF, | |
IOP, | |||
ERRVAL | |||
) | RSB_REINIT_SINGLE_VALUE(IOF,IOP,RSB_IO_SPECIFIER_SET,ERRVAL) |
A handy macro for invoking RSB_REINIT_SINGLE_VALUE with a single set specifier. An appropriate I/O flag is supplied as first parameter; a valid pointer (according to the flag) should be passed as second parameter; a rsb_err_t variable as third one, in order to detect any error.
typedef signed int rsb_blk_idx_t |
The block arrays index type.
Could be an unsigned type. Should not overflow when indexing matrix blocks by block coordinates.
typedef rsb_flags_t rsb_bool_t |
A boolean type.
typedef char rsb_char_t |
A type for character strings.
typedef signed int rsb_coo_idx_t |
The coordinate arrays index type.
Should not overflow when indexing matrix elements by coordinates. Legal values when specifying a matrix size should be within RSB_MIN_MATRIX_DIM and RSB_MAX_MATRIX_DIM
typedef signed int rsb_err_t |
A type specific for error flags. Should be >= 4 bytes.
A textual description of an error value may be obtained via rsb_strerror_r() or rsb_perror().
typedef signed int rsb_flags_t |
A type for specifying matrix assembly or coordinate conversions option flags. Should be >= 4 bytes. See flags_section for possible values.
typedef signed int rsb_int_t |
An integer type declaration for interface functions. Should always be 'int'. A signed integer type
typedef rsb_flags_t rsb_marf_t |
Matrix rendering flags (see marf_section for possible values).
typedef signed int rsb_nnz_idx_t |
The nnz counter index type.
Should not overflow when indexing matrix elements. On most common archs sizeof(long)>=sizeof(int). Legal values when specifying a matrix size should be within RSB_MIN_MATRIX_NNZ and RSB_MAX_MATRIX_NNZ
typedef rsb_flags_t rsb_precf_t |
Basic preconditioner flags to be used with rsb_mtx_get_prec().
typedef double rsb_real_t |
A floating point numerical type.
typedef rsb_real_t rsb_time_t |
A floating point numerical type for time measurements with rsb_time().
typedef rsb_flags_t rsb_trans_t |
The type for specifying transposition (See matrix_transposition_flags_section)
typedef char rsb_type_t |
A type for specifying numerical type codes (See matrix_type_symbols_section for a list of valid values).
Gets value of a library option. A value specified by the request flag iof
will be fetched from the library internal state and *iop
will be updated accordingly.
iof | library options flags. See rsb_opt_t for a list of valid options. |
iop | library options value output pointer (pointed location will be updated). |
Sets value of a library option. A value specified by the request flag iof
will be fetched from *iop
and will be used to update the selected option in the library internal state.
iof | library options flags. See rsb_opt_t for a list of valid options. |
iop | library options value output pointer (pointed location will be updated). |
struct rsb_mtx_t* rsb_mtx_alloc_from_coo_begin | ( | rsb_nnz_idx_t | nnzA, |
rsb_type_t | typecode, | ||
rsb_coo_idx_t | nrA, | ||
rsb_coo_idx_t | ncA, | ||
rsb_flags_t | flagsA, | ||
rsb_err_t * | errvalp | ||
) |
rsb_err_t rsb_mtx_alloc_from_coo_end | ( | struct rsb_mtx_t ** | mtxApp | ) |
rsb_err_t rsb_mtx_clone | ( | struct rsb_mtx_t ** | mtxBpp, |
rsb_type_t | typecode, | ||
rsb_trans_t | transA, | ||
const void * | alphap, | ||
const struct rsb_mtx_t * | mtxAp, | ||
rsb_flags_t | flags | ||
) |
\ingroup rsb_doc_matrix_assembly rsb_doc_rsb This function clones a given matrix, allocating a fresh data structure or overwriting an existing one. \n Target type (specified by \c typecode) can be different from that in the matrix. \c If \c alphap=NULL, the cloned matrix will not be scaled. \n This new structure will be completely separated and independent from the original one. \n Examples: \code
// will clone the matrix exactly errval = rsb_mtx_clone(&mtxBp,RSB_NUMERICAL_TYPE_SAME_TYPE,RSB_TRANSPOSITION_N,NULL,mtxAp,RSB_FLAG_IDENTICAL_FLAGS); // will clone the transpose of the matrix errval = rsb_mtx_clone(&mtxBp,RSB_NUMERICAL_TYPE_SAME_TYPE,RSB_TRANSPOSITION_T,NULL,mtxAp,RSB_FLAG_IDENTICAL_FLAGS); // will clone the lower triangle of the matrix errval = rsb_mtx_clone(&mtxBp,RSB_NUMERICAL_TYPE_SAME_TYPE,RSB_TRANSPOSITION_N,NULL,mtxAp,RSB_FLAG_TRIANGULAR|RSB_FLAG_LOWER);
mtxBpp | Valid rsb_mtx_t pointer to an address for matrix ![]() *mtxBpp==NULL , a fresh clone will be assigned there; if not, the existing matrix structure will be freed and allocated to host the new one. The case *mtxBpp==mtxAp is supported. |
typecode | A valid type code for the desired output matrix (see matrix_type_symbols_section). |
transA | Transposition parameter for ![]() |
alphap | Optional pointer (if NULL , will default to 1) to a numerical value for scaling the output. Of the type code of mtxAp . |
mtxAp | Valid rsb_mtx_t pointer to matrix ![]() |
flags | Either RSB_FLAG_IDENTICAL_FLAGS or a combination of other flags, e.g.: RSB_FLAG_C_INDICES_INTERFACE, RSB_FLAG_SYMMETRIC, RSB_FLAG_HERMITIAN, RSB_FLAG_TRIANGULAR, RSB_FLAG_UPPER, RSB_FLAG_LOWER, RSB_FLAG_UNIT_DIAG_IMPLICIT, RSB_FLAG_DISCARD_ZEROS. Flag RSB_FLAG_EXTERNALLY_ALLOCATED_ARRAYS is forbidden. Flag RSB_FLAG_FORTRAN_INDICES_INTERFACE is ignored. |
rsb_err_t rsb_mtx_get_coo_block | ( | const struct rsb_mtx_t * | mtxAp, |
void * | VA, | ||
rsb_coo_idx_t * | IA, | ||
rsb_coo_idx_t * | JA, | ||
rsb_coo_idx_t | frA, | ||
rsb_coo_idx_t | lrA, | ||
rsb_coo_idx_t | fcA, | ||
rsb_coo_idx_t | lcA, | ||
rsb_coo_idx_t * | IREN, | ||
rsb_coo_idx_t * | JREN, | ||
rsb_nnz_idx_t * | rnzp, | ||
rsb_flags_t | flags | ||
) |
\ingroup rsb_doc_matrix_conversion rsb_doc_rsb Writes in COO format the specified submatrix. Works in two stages: first the user invokes it with \c VA,IA,JA set to \c NULL to get \c *rnzp. Then the the \c VA,IA,JA arrays can be allocated, and the function called again, this time with \c rnzp=NULL but the \c VA,IA,JA arrays pointers non \c NULL (or at least, one of them). \param mtxAp Valid \c rsb_mtx_t pointer to matrix \f$A\f$ representation. \param VA,IA,JA Output numerical values (\c VA) array; output row (\c IA) and column (\c JA) indices arrays. \param frA,lrA First and last row indices. \param fcA,lcA First and last column indices. \param IREN,JREN Renumbering arrays for \c IA and \c JA (respectively rows count and columns count sized). If \c NULL, no renumbering will be used. \param rnzp A pointer where the number of relevant nonzero elements will be written to. \param flags Either #RSB_FLAG_FORTRAN_INDICES_INTERFACE or #RSB_FLAG_C_INDICES_INTERFACE (see \ref flags_section flags section). \return #RSB_ERR_NO_ERROR on correct operation, an error code otherwise. You can use #rsb_strerror_r() or #rsb_perror() to get more information about the error. Examples: \code
// get nnz count first errval=rsb_mtx_get_coo_block(mtxAp,NULL,NULL,NULL,frA,lrA,fcA,lcA,NULL,NULL,&rnz,flags ) // allocate VA, IA, JA to rnz elements ... // get the rnz values then errval=rsb_mtx_get_coo_block(mtxAp, VA, IA, JA,frA,lrA,fcA,lcA,NULL,NULL,NULL,flags )
rsb_err_t rsb_tune_spmm | ( | struct rsb_mtx_t ** | mtxOpp, |
rsb_real_t * | sfp, | ||
rsb_int_t * | tnp, | ||
rsb_int_t | maxr, | ||
rsb_time_t | maxt, | ||
rsb_trans_t | transA, | ||
const void * | alphap, | ||
const struct rsb_mtx_t * | mtxAp, | ||
rsb_coo_idx_t | nrhs, | ||
rsb_flags_t | order, | ||
const void * | Bp, | ||
rsb_nnz_idx_t | ldB, | ||
const void * | betap, | ||
void * | Cp, | ||
rsb_nnz_idx_t | ldC | ||
) |
\ingroup rsb_doc_matrix_assembly rsb_doc_rsb An auto-tuner: optimizes either the matrix instance, the thread count or both for the #rsb_spmm operation. The tuner works by evaluating different instances and working threads variants. The instance leading to faster operation time will be retained and given back to the user in \c *mtxOpp. If \c nrhs==1 and \c order==#RSB_FLAG_WANT_COLUMN_MAJOR_ORDER, unitary stride vectors are assumed. In case of error, the original input matrix shall be unaffected. It is possible to specify the leading dimensions of \c Bp,Cp implicitly, with \c ldB=0 and \c ldC=0: in this case, their values will be computed internally and if \c Bp!=NULL,Cp!=NULL, they will be assumed of being sufficiently sized. Values of \c nrhs<1 will be treated as 1. \c Bp, \c Cp can be \c NULL: temporary vectors will be allocated, used, and deallocated within the tuner. If \c mtxOpp=NULL and \c *tnp!=NULL the best thread count will be probed for the matrix given in \c mtxAp. Please note that if threads only tuning is requested and matrix has too few leaves (see #RSB_MIF_LEAVES_COUNT__TO__RSB_BLK_INDEX_T), tuning will not work. If \c mtxAp==NULL, then the \c *mtxOpp instance will be used; however in this case, if a better instance is found, the original will be destroyed as with #rsb_mtx_free(). The case \c mtxAp!=NULL&&*mtxOpp!=NULL is illegal and will cause an error. \param mtxOpp Optimal matrix structure pointer will be assigned to \c *mtxOpp (it may occur that *mtxOpp==mtxAp on output). If \c mtxOpp is \c NULL then no data structure optimization will be attempted; rather, only optimal threads search will occur (\c tnp must be not \c NULL then). \param sfp Achieved speedup factor will be written to \c *sfp (unless \c sfp==NULL). \param tnp If \c tnp==NULL on input, the current thread count will be utilized. Otherwise, if \c *tnp>0, then *tnp will be used as first suggestion in optimal thread count searching. If \c tnp!=NULL ,on output \c *tnp will be set to contain the optimal number of threads. Then, the user is expected to set this number of threads using e.g.: \c RSB_REINIT_SINGLE_VALUE_SET(RSB_IO_WANT_EXECUTING_THREADS,tnp,errval). Please note that this will affect the whole library operation, not only this matrix. \param maxr Optimizer rounds max count. If \c <1, will be treated as 1; if 0 will be decided automatically. Max is #RSB_CONST_MAX_TUNING_ROUNDS. \param maxt Maximum time (in seconds) per optimization round (does not take in account conversion time). If \c maxt<0.0 is provided, \c -ceil(maxt) will be interpreted as number of iterations to check for each operation time sample. If \c maxt==0.0 is provided, a default choice will be made instead. \param transA Transposition parameter for \f$A\f$ (see \ref matrix_transposition_flags_section). \param alphap Optional pointer (if \c NULL, will default to 1) to a numerical value (of the same type as matrix). \param mtxAp Valid \c rsb_mtx_t pointer to matrix \f$A\f$ representation. \param nrhs The number of right hand side vectors (cannot be \c <1). \param order A flag among #RSB_FLAG_WANT_COLUMN_MAJOR_ORDER and #RSB_FLAG_WANT_ROW_MAJOR_ORDER. For contiguous vector arrays, you probably want #RSB_FLAG_WANT_COLUMN_MAJOR_ORDER. \param Bp The input vector array. If \c NULL, a temporary, internally allocated copy will be used. \param ldB Leading dimension of \c Bp array. \param betap Optional pointer (if \c NULL, will default to 1) to a numerical value. \param Cp The output vector array. If \c NULL, a temporary, internally allocated copy will be used. \param ldC Leading dimension of \c Cp array. \return #RSB_ERR_NO_ERROR on correct operation, an error code otherwise. You can use #rsb_strerror_r() or #rsb_perror() to get more information about the error. Examples: \code
// obtain best thread count for mtxAp: errval = rsb_tune_spmm(NULL ,&sf,&tn ,maxr,maxt,transA,&alpha,mtxAp,nrhs,order,Bp,ldB,&beta,Cp,ldC);
// obtain best thread count for mtxAp; Bp and Cp will be allocated by the tuner: errval = rsb_tune_spmm(NULL ,&sf,&tn ,maxr,maxt,transA,&alpha,mtxAp,nrhs,order,NULL,0,&beta,NULL,0);
// obtain best clone of mtxAp (for current thread count): assert(mtxOp == NULL && mtxAp != NULL); errval = rsb_tune_spmm(&mtxOp,&sf,NULL,maxr,maxt,transA,&alpha,mtxAp,nrhs,order,Bp,ldB,&beta,Cp,ldC);
// obtain best clone of mtxAp and best thread count: assert(mtxOp == NULL && mtxAp != NULL); errval = rsb_tune_spmm(&mtxOp,&sf,&tn ,maxr,maxt,transA,&alpha,mtxAp,nrhs,order,Bp,ldB,&beta,Cp,ldC);
// replace mtxAp with best clone (if any): errval = rsb_tune_spmm(&mtxAp,&sf,NULL,maxr,maxt,transA,&alpha,NULL ,nrhs,order,Bp,ldB,&beta,Cp,ldC);
// replace mtxAp with best clone (if any) and obtain best thread count: errval = rsb_tune_spmm(&mtxAp,&sf,&tn ,maxr,maxt,transA,&alpha,NULL ,nrhs,order,Bp,ldB,&beta,Cp,ldC);
// illegal call: assert(mtxOp != NULL && mtxAp != NULL); errval = rsb_tune_spmm(&mtxOp,&sf,&tn ,maxr,maxt,transA,&alpha,mtxAp,nrhs,order,Bp,ldB,&beta,Cp,ldC);