Rate This Document
Findability
Accuracy
Completeness
Readability

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

Table 1 KmlDssAnalyzeOption structure

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:

  • KMLDSS_MATCHING_OFF indicates that the matching algorithm is disabled. This is the default option.
  • KMLDSS_MATCHING_MC64 indicates the Maximum Weighted Matching Algorithm, which can maximize the pivot magnitude during numerical factorization. It is generally used for asymmetric matrices.
  • KMLDSS_MATCHING_SMC64 indicates the Symmetric Maximum Weighted Matching Algorithm, which maximize the pivot magnitude during numerical factorization. It is generally used for symmetric or structurally symmetric matrices.

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:

  • KMLDSS_RDR_KRDR indicates that fill-in reduction is performed for KML Reorder. This is the default option.
  • KMLDSS_RDR_CUSTOM indicates that a user-defined fill-in reduction function is used.

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)".

  • If rdrType is not set to KMLDSS_RDR_CUSTOM, ignore this field.
  • If rdrType is set to KMLDSS_RDR_CUSTOM but this field and rdrPerm are not set, fill-in reduction is not performed. rdrPerm has a higher priority than customRdrAlgo.

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.

  • If rdrType is not set to KMLDSS_RDR_CUSTOM, ignore this field.
  • If rdrType is set to KMLDSS_RDR_CUSTOM but neither this field nor the customRdrAlgo field is set, the value is equivalent to KMLDSS_FR_NONE. rdrPerm has a higher priority than customRdrAlgo.

Mask bit: KMLDSS_ANALYZE_OPTION_RDR_PERM

pivotingType

KmlDssPivotingType

Pivoting algorithm type. The options are as follows:

  • KMLDSS_PIVOTING_OFF indicates that dynamic pivot selection is disabled. This is the default option.
  • KMLDSS_PIVOTING_LOCAL indicates local dynamic pivot selection.

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:

  • KMLDSS_MATRIX_NO_TRANS indicates that the original linear solving system. This is the default option.
  • KMLDSS_MATRIX_TRANS indicates that the transposed linear solving system.

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"