KmlDssAnalyze
Analyzes the input matrix, including reordering and symbolic decomposition.
Interface Definition
C interface:
int KmlDssAnalyze(KmlDssSolver *solver, const KmlSolverMatrix *matrix, const KmlDssAnalyzeOption *option);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
solver |
KmlDssSolver * |
Solver handle created by KmlDssInit. |
Input |
matrix |
KmlSolverMatrix * |
Matrix handle, which is created by KmlSolverMatrixCreate and cannot be a null pointer. |
Input |
option |
KmlDssAnalyzeOption * |
Configuration in the analysis phase, which cannot be a null pointer. For details, see Table 1. |
Input |
Field |
Type |
Description |
|---|---|---|
fieldMask |
uint64_t |
Mask that determines to which fields the configuration is applied. If a bit is set to 1, its corresponding field uses a specified value. If a bit is set to 0, its corresponding field uses the default value. See the individual field description for configurable mask bits. |
nThreadsAnalyze |
int32_t |
Number of threads in the analysis phase. By default, this value is the same as the initial number of solver threads set in the KmlDssInit phase. Mask bit: KMLDSS_ANALYZE_OPTION_NTHREADS_ANALYZE |
nThreadsFactorize |
int32_t |
Number of threads in the factorization phase. By default, this value is the same as the initial number of solver threads set in the KmlDssInit phase. Mask bit: KMLDSS_ANALYZE_OPTION_NTHREADS_FACTORIZE |
nThreadsSolve |
int32_t |
Number of threads in the back substitution phase. By default, this value is the same as the initial number of solver threads set in the KmlDssInit phase. Mask bit: KMLDSS_ANALYZE_OPTION_NTHREADS_SOLVE |
matchingType |
KmlDssMatchingType |
Matching algorithm type. The options are as follows:
Mask bit: KMLDSS_ANALYZE_OPTION_MATCHING_TYPE |
nThreadsMatching |
int32_t |
Number of threads in the matching phase. By default, this value is the same as the number of threads in the analysis phase. Mask bit: KMLDSS_ANALYZE_OPTION_NTHREADS_MATCHING |
rdrType |
KmlDssRdrType |
Fill-in reduction algorithm type. The options are as follows:
Mask bit: KMLDSS_ANALYZE_OPTION_RDR_TYPE |
nThreadsRdr |
int32_t |
Number of threads in the fill-in reduction phase. By default, this value is the same as the number of threads in the analysis phase. Mask bit: KMLDSS_ANALYZE_OPTION_NTHREADS_RDR |
customRdrAlgo |
KmlDssCustomRdrAlgo |
User-defined fill-in reduction function. The prototype of the function is "typedef int (*KmlDssCustomRdrAlgo) (const KmlSolverMatrixStore *store, void *perm, void *iperm, void* arg)".
Mask bit: KMLDSS_ANALYZE_OPTION_CUSTOM_RDR_ALGO |
customRdrArgs |
void * |
When the custom fill-in reduction function is called, this field is used as the last parameter. You can use this field to pass other parameters required by the custom fill-in reduction function. Mask bit: KMLDSS_ANALYZE_OPTION_CUSTOM_RDR_ARGS |
rdrPerm |
void * |
Pass the user-defined perm of fill-in reduction. The mapping relationship is that the i-th row/column of the reordered matrix is the rdrPerm[i]-th row/column of the original matrix.
Mask bit: KMLDSS_ANALYZE_OPTION_RDR_PERM |
pivotingType |
KmlDssPivotingType |
Pivoting algorithm type. The options are as follows:
Mask bit: KMLDSS_ANALYZE_OPTION_PIVOTING_TYPE |
pivotingThreshold |
double |
Pivoting threshold. Currently, this parameter cannot be set. Mask bit: KMLDSS_ANALYZE_OPTION_PIVOTING_THRESHOLD |
batchNRHS |
int64_t |
Maximum number of RHS vectors that can be solved in each batch in the back substitution phase. This parameter is used for performance optimization and is irrelevant to the actual number of RHS vectors to be solved. The default value is 1. Mask bit: KMLDSS_ANALYZE_OPTION_BATCH_NRHS |
schurSize |
int64_t |
Size of the Schur complement in partial factorization. The default value is 0. Mask bit: KMLDSS_ANALYZE_OPTION_SCHUR_SIZE |
sparseSupernodeSize |
int32_t |
Performance tuning parameter, indicating the maximum number of columns in a merged sparse supernode. Inside the solver, several small supernodes can be merged into a sparse supernode, which is represented and computed using a sparse matrix format. If the value is 0, sparse supernode is disabled. The default value is 0. Mask bit: KMLDSS_ANALYZE_OPTION_SPARSE_SUPERNODE_SIZE |
sparseSupernodeThreshold |
int32_t |
Performance tuning parameter, indicating the maximum number of columns in a supernode that can be merged into a sparse supernode. Supernodes that exceed this threshold will not be merged. If the value is 0, sparse supernode is disabled. The default value is 0. Mask bit: KMLDSS_ANALYZE_OPTION_SPARSE_SUPERNODE_THRESHOLD |
schurFormat |
KmlSolverMatrixStoreFormat |
Storage format of the Schur complement in partial factorization. For details about the available matrix storage formats, see the parameter description of KmlSolverMatrixCreate(). The default value is KMLSS_MATRIX_STORE_DENSE_ROW_MAJOR. Mask bit: KMLDSS_ANALYZE_OPTION_SCHUR_FORMAT |
matrixTransType |
KmlDssMatrixTransType |
Transposition type. The options are as follows:
Mask bit: KMLDSS_ANALYZE_OPTION_MATRIX_TRANS_TYPE |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
Normal execution. |
KMLSS_INTERNAL_ERROR |
int |
Internal error. |
KMLSS_NULL_ARGUMENT |
int |
A null argument exists in {solver, matrix, option}. |
Dependencies
#include "kml_dss.h"