SuperLU Distributed 8.2.1
Distributed memory sparse direct solver
supermatrix.h
Go to the documentation of this file.
1
15#ifndef __SUPERLU_SUPERMATRIX /* allow multiple inclusions */
16#define __SUPERLU_SUPERMATRIX
17
18
19/********************************************
20 * The matrix types are defined as follows. *
21 ********************************************/
22typedef enum {
23 SLU_NC, /* column-wise, no supernode */
24 SLU_NCP, /* column-wise, column-permuted, no supernode
25 (The consecutive columns of nonzeros, after permutation,
26 may not be stored contiguously.) */
27 SLU_NR, /* row-wize, no supernode */
28 SLU_SC, /* column-wise, supernode */
29 SLU_SCP, /* supernode, column-wise, permuted */
30 SLU_SR, /* row-wise, supernode */
31 SLU_DN, /* Fortran style column-wise storage for dense matrix */
32 SLU_NR_loc /* distributed compressed row format */
34
35typedef enum {
36 SLU_S, /* single */
37 SLU_D, /* double */
38 SLU_C, /* single complex */
39 SLU_Z /* double complex */
41
42typedef enum {
43 SLU_GE, /* general */
44 SLU_TRLU, /* lower triangular, unit diagonal */
45 SLU_TRUU, /* upper triangular, unit diagonal */
46 SLU_TRL, /* lower triangular */
47 SLU_TRU, /* upper triangular */
48 SLU_SYL, /* symmetric, store lower half */
49 SLU_SYU, /* symmetric, store upper half */
50 SLU_HEL, /* Hermitian, store lower half */
51 SLU_HEU /* Hermitian, store upper half */
53
54typedef struct {
55 Stype_t Stype; /* Storage type: interprets the storage structure
56 pointed to by *Store. */
57 Dtype_t Dtype; /* Data type. */
58 Mtype_t Mtype; /* Matrix type: describes the mathematical property of
59 the matrix. */
60 int_t nrow; /* number of rows */
61 int_t ncol; /* number of columns */
62 void *Store; /* pointer to the actual storage of the matrix */
64
65/***********************************************
66 * The storage schemes are defined as follows. *
67 ***********************************************/
68
69/* Stype == SLU_NC (Also known as Harwell-Boeing sparse matrix format) */
70typedef struct {
71 int_t nnz; /* number of nonzeros in the matrix */
72 void *nzval; /* pointer to array of nonzero values, packed by column */
73 int_t *rowind; /* pointer to array of row indices of the nonzeros */
74 int_t *colptr; /* pointer to array of beginning of columns in nzval[]
75 and rowind[] */
76 /* Note:
77 Zero-based indexing is used;
78 colptr[] has ncol+1 entries, the last one pointing
79 beyond the last column, so that colptr[ncol] = nnz. */
80} NCformat;
81
82/* Stype == SLU_NR */
83typedef struct {
84 int_t nnz; /* number of nonzeros in the matrix */
85 void *nzval; /* pointer to array of nonzero values, packed by raw */
86 int_t *colind; /* pointer to array of columns indices of the nonzeros */
87 int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
88 and colind[] */
89 /* Note:
90 Zero-based indexing is used;
91 rowptr[] has nrow+1 entries, the last one pointing
92 beyond the last row, so that rowptr[nrow] = nnz. */
93} NRformat;
94
95/* Stype == SLU_SC */
96typedef struct {
97 int_t nnz; /* number of nonzeros in the matrix */
98 int_t nsuper; /* number of supernodes, minus 1 */
99 void *nzval; /* pointer to array of nonzero values, packed by column */
100 int_t *nzval_colptr;/* pointer to array of beginning of columns in nzval[] */
101 int_t *rowind; /* pointer to array of compressed row indices of
102 rectangular supernodes */
103 int_t *rowind_colptr;/* pointer to array of beginning of columns in rowind[] */
104 int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column
105 j belongs; mapping from column to supernode number. */
106 int_t *sup_to_col; /* sup_to_col[s] points to the start of the s-th
107 supernode; mapping from supernode number to column.
108 e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12)
109 sup_to_col: 0 1 2 4 7 12 (nsuper=4) */
110 /* Note:
111 Zero-based indexing is used;
112 nzval_colptr[], rowind_colptr[], col_to_sup and
113 sup_to_col[] have ncol+1 entries, the last one
114 pointing beyond the last column.
115 For col_to_sup[], only the first ncol entries are
116 defined. For sup_to_col[], only the first nsuper+2
117 entries are defined. */
118} SCformat;
119
120/* Stype == SLU_SCP */
121typedef struct {
122 int_t nnz; /* number of nonzeros in the matrix */
123 int_t nsuper; /* number of supernodes */
124 void *nzval; /* pointer to array of nonzero values, packed by column */
125 int_t *nzval_colbeg;/* nzval_colbeg[j] points to beginning of column j
126 in nzval[] */
127 int_t *nzval_colend;/* nzval_colend[j] points to one past the last element
128 of column j in nzval[] */
129 int_t *rowind; /* pointer to array of compressed row indices of
130 rectangular supernodes */
131 int_t *rowind_colbeg;/* rowind_colbeg[j] points to beginning of column j
132 in rowind[] */
133 int_t *rowind_colend;/* rowind_colend[j] points to one past the last element
134 of column j in rowind[] */
135 int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column
136 j belongs; mapping from column to supernode. */
137 int_t *sup_to_colbeg; /* sup_to_colbeg[s] points to the start of the s-th
138 supernode; mapping from supernode to column.*/
139 int_t *sup_to_colend; /* sup_to_colend[s] points to one past the end of the
140 s-th supernode; mapping from supernode number to
141 column.
142 e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12)
143 sup_to_colbeg: 0 1 2 4 7 (nsuper=4)
144 sup_to_colend: 1 2 4 7 12 */
145 /* Note:
146 Zero-based indexing is used;
147 nzval_colptr[], rowind_colptr[], col_to_sup and
148 sup_to_col[] have ncol+1 entries, the last one
149 pointing beyond the last column. */
150} SCPformat;
151
152/* Stype == SLU_NCP */
153typedef struct {
154 int_t nnz; /* number of nonzeros in the matrix */
155 void *nzval; /* pointer to array of nonzero values, packed by column */
156 int_t *rowind;/* pointer to array of row indices of the nonzeros */
157 /* Note: nzval[]/rowind[] always have the same length */
158 int_t *colbeg;/* colbeg[j] points to the beginning of column j in nzval[]
159 and rowind[] */
160 int_t *colend;/* colend[j] points to one past the last element of column
161 j in nzval[] and rowind[] */
162 /* Note:
163 Zero-based indexing is used;
164 The consecutive columns of the nonzeros may not be
165 contiguous in storage, because the matrix has been
166 postmultiplied by a column permutation matrix. */
167} NCPformat;
168
169/* Stype == SLU_DN */
170typedef struct {
171 int_t lda; /* leading dimension */
172 void *nzval; /* array of size lda*ncol to represent a dense matrix */
173} DNformat;
174
175/* Stype == SLU_NR_loc (Distributed Compressed Row Format) */
176typedef struct {
177 int_t nnz_loc; /* number of nonzeros in the local submatrix */
178 int_t m_loc; /* number of rows local to this processor */
179 int_t fst_row; /* global index of the first row */
180 void *nzval; /* pointer to array of nonzero values, packed by row */
181 int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
182 and colind[] */
183 int_t *colind; /* pointer to array of column indices of the nonzeros */
184 /* Note:
185 Zero-based indexing is used;
186 rowptr[] has n_loc + 1 entries, the last one pointing
187 beyond the last row, so that rowptr[n_loc] = nnz_loc.*/
189
190
191/* Data structure for storing 3D matrix on layer 0 of the 2D process grid
192 Only grid-0 has meanful values of these data structures. */
193typedef struct NRformat_loc3d
194{
195 NRformat_loc *A_nfmt; // Gathered A matrix on 2D grid-0
196 void *B3d; // on the entire 3D process grid
197 int ldb; // relative to 3D process grid
198 int nrhs;
199 int m_loc; // relative to 3D process grid
200 void *B2d; // on 2D process layer grid-0
201
202 int *row_counts_int; // these counts are stored on 2D layer grid-0,
203 int *row_disp; // but count the number of {A, B} rows along Z-dimension
204 int *nnz_counts_int;
205 int *nnz_disp;
206 int *b_counts_int;
207 int *b_disp;
208
209 /* The following 4 structures are used for scattering
210 solution X from 2D grid-0 back to 3D processes */
213 int *send_count_list;
216 int *recv_count_list;
218
219
220#endif /* __SUPERLU_SUPERMATRIX */
L Dtype
Definition: dutil_dist.c:265
L Mtype
Definition: dutil_dist.c:266
L nrow
Definition: dutil_dist.c:267
L ncol
Definition: dutil_dist.c:268
L Store
Definition: dutil_dist.c:269
i< M;++i) Y[i+j *ldy]=X[i+j *ldx];}voiddCreate_SuperNode_Matrix_dist(SuperMatrix *L, int_t m, int_t n, int_t nnz, double *nzval, int_t *nzval_colptr, int_t *rowind, int_t *rowind_colptr, int_t *col_to_sup, int_t *sup_to_col, Stype_t stype, Dtype_t dtype, Mtype_t mtype){ SCformat *Lstore;L-> Stype
Definition: dutil_dist.c:264
int int_t
Definition: superlu_defs.h:114
struct NRformat_loc3d NRformat_loc3d
Mtype_t
Definition: supermatrix.h:42
@ SLU_TRUU
Definition: supermatrix.h:45
@ SLU_SYU
Definition: supermatrix.h:49
@ SLU_TRL
Definition: supermatrix.h:46
@ SLU_SYL
Definition: supermatrix.h:48
@ SLU_TRU
Definition: supermatrix.h:47
@ SLU_HEU
Definition: supermatrix.h:51
@ SLU_HEL
Definition: supermatrix.h:50
@ SLU_GE
Definition: supermatrix.h:43
@ SLU_TRLU
Definition: supermatrix.h:44
Dtype_t
Definition: supermatrix.h:35
@ SLU_S
Definition: supermatrix.h:36
@ SLU_Z
Definition: supermatrix.h:39
@ SLU_C
Definition: supermatrix.h:38
@ SLU_D
Definition: supermatrix.h:37
Stype_t
Definition: supermatrix.h:22
@ SLU_NC
Definition: supermatrix.h:23
@ SLU_NCP
Definition: supermatrix.h:24
@ SLU_SCP
Definition: supermatrix.h:29
@ SLU_SC
Definition: supermatrix.h:28
@ SLU_SR
Definition: supermatrix.h:30
@ SLU_DN
Definition: supermatrix.h:31
@ SLU_NR
Definition: supermatrix.h:27
@ SLU_NR_loc
Definition: supermatrix.h:32
Definition: supermatrix.h:170
Definition: supermatrix.h:153
Definition: supermatrix.h:70
Definition: supermatrix.h:194
int * row_disp
Definition: supermatrix.h:203
int * row_counts_int
Definition: supermatrix.h:202
int nrhs
Definition: supermatrix.h:198
int * send_count_list
Definition: supermatrix.h:213
int m_loc
Definition: supermatrix.h:199
int * procs_to_send_list
Definition: supermatrix.h:212
int * b_counts_int
Definition: supermatrix.h:206
NRformat_loc * A_nfmt
Definition: supermatrix.h:195
int num_procs_to_send
Definition: supermatrix.h:211
void * B2d
Definition: supermatrix.h:200
int * nnz_disp
Definition: supermatrix.h:205
int * recv_count_list
Definition: supermatrix.h:216
void * B3d
Definition: supermatrix.h:196
int * procs_recv_from_list
Definition: supermatrix.h:215
int num_procs_to_recv
Definition: supermatrix.h:214
int * b_disp
Definition: supermatrix.h:207
int ldb
Definition: supermatrix.h:197
int * nnz_counts_int
Definition: supermatrix.h:204
Definition: supermatrix.h:176
Definition: supermatrix.h:83
Definition: supermatrix.h:121
Definition: supermatrix.h:96
Definition: supermatrix.h:54