Rate This Document
Findability
Accuracy
Completeness
Readability

KmlScasolverMatrixCreate

Create a matrix operation handle.

Shallow copy is used during matrix creation. You need to ensure that the memory specified by the store parameter is not freed before KmlScasolverMatrixDestroy is called.

Interface Definition

C interface:

int KmlScasolverMatrixCreate(KmlScasolverMatrix **pMatrix, KmlSolverMatrixStore *store, const KmlSolverMatrixOption *basicOptions, const KmlScasolverMatrixOption *scaOptions);

Parameters

Parameter

Type

Description

Input/Output

pMatrix

KmlScasolverMatrix **

Matrix handle. pMatrix cannot be a null pointer.

Input/Output

store

KmlSolverMatrixStore *

Matrix format information structure, which describes only the local matrix of the current process. This parameter cannot be a null pointer. For details, see Table 1.

Input

basicOptions

KmlSolverMatrixOption *

Basic matrix configuration options. This parameter cannot be a null pointer. For details, see Table 2.

Input

scaOptions

KmlScasolverMatrixOption *

Distributed matrix configuration options. The matrices saved by all processes must be able to form a complete matrix without any duplicate parts. This parameter cannot be a null pointer. For details, see Table 1.

Input

Table 1 KmlScasolverMatrixOption 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.

globalNumRows

int64_t

Number of global matrix rows. If not specified, the default value is the same as that of KmlSolverMatrixStore::nrows.

Mask bit: KMLSS_MATRIX_OPTIONS_GLOBAL_NROWS

globalNumCols

int64_t

Number of global matrix columns. If not specified, the default value is the same as that of KmlSolverMatrixStore::ncols.

Mask bit: KMLSS_MATRIX_OPTIONS_GLOBAL_NCOLS

partition

KmlScadssMatrixPartition

Global matrix partitioning among processes. For details, see Table 2.

Mask bit: KMLSS_MATRIX_OPTIONS_PARTITION

Table 2 KmlScadssMatrixPartition structure

Field

Type

Description

type

KmlScasolverMatrixPartitionType

Matrix partitioning mode among processes. The options are as follows:

  • KMLSS_MATRIX_PARTITION_ROW: partitioning by row.
  • KMLSS_MATRIX_PARTITION_COL: partitioning by column.
  • KMLSS_MATRIX_PARTITION_NZ: partitioning by non-zero element.

localBegin

int64_t

Bias of the current process in the global matrix. The meaning depends on the partitioning mode type. The details are as follows:

  • When KMLSS_MATRIX_PARTITION_ROW is used, this parameter indicates the global row number of the first local matrix row.
  • When KMLSS_MATRIX_PARTITION_COL is used, this parameter indicates the global column number of the first local matrix column.
  • When KMLSS_MATRIX_PARTITION_NZ is used, ignore this parameter.

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 {pMatrix, store, basicOptions, scaOptions}.

Dependencies

#include "kml_scadss.h"