TBCI Numerical high perf. C++ Library 2.8.0
ssp_defs.h
Go to the documentation of this file.
1
5
6/* $Id: ssp_defs.h,v 1.3.2.2 2019/05/28 11:13:02 garloff Exp $ */
7
8/*
9 * -- SuperLU routine (version 1.1) --
10 * Univ. of California Berkeley, Xerox Palo Alto Research Center,
11 * and Lawrence Berkeley National Lab.
12 * November 15, 1997
13 *
14 */
15#ifndef __SUPERLU_sSP_DEFS /* allow multiple inclusions */
16#define __SUPERLU_sSP_DEFS
17
18/*
19 * File name: ssp_defs.h
20 * Purpose: Sparse matrix types and function prototypes
21 * History:
22 */
23#ifdef _CRAY
24#include <fortran.h>
25#include <string.h>
26#endif
27#include "tbci/superlu/Cnames.h"
28#include "tbci/superlu/supermatrix.h"
29
30
31/* No of marker arrays used in the symbolic factorization,
32 each of size n */
33#define NO_MARKER 3
34#define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
35
36typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
37typedef enum {HEAD, TAIL} stack_end_t;
38typedef enum {SYSTEM, USER} LU_space_t;
39
40/*
41 * Global data structures used in LU factorization -
42 *
43 * nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
44 * (xsup,supno): supno[i] is the supernode no to which i belongs;
45 * xsup(s) points to the beginning of the s-th supernode.
46 * e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
47 * xsup 0 1 2 4 7 12
48 * Note: dfs will be performed on supernode rep. relative to the new
49 * row pivoting ordering
50 *
51 * (xlsub,lsub): lsub[*] contains the compressed subscript of
52 * rectangular supernodes; xlsub[j] points to the starting
53 * location of the j-th column in lsub[*]. Note that xlsub
54 * is indexed by column.
55 * Storage: original row subscripts
56 *
57 * During the course of sparse LU factorization, we also use
58 * (xlsub,lsub) for the purpose of symmetric pruning. For each
59 * supernode {s,s+1,...,t=s+r} with first column s and last
60 * column t, the subscript set
61 * lsub[j], j=xlsub[s], .., xlsub[s+1]-1
62 * is the structure of column s (i.e. structure of this supernode).
63 * It is used for the storage of numerical values.
64 * Furthermore,
65 * lsub[j], j=xlsub[t], .., xlsub[t+1]-1
66 * is the structure of the last column t of this supernode.
67 * It is for the purpose of symmetric pruning. Therefore, the
68 * structural subscripts can be rearranged without making physical
69 * interchanges among the numerical values.
70 *
71 * However, if the supernode has only one column, then we
72 * only keep one set of subscripts. For any subscript interchange
73 * performed, similar interchange must be done on the numerical
74 * values.
75 *
76 * The last column structures (for pruning) will be removed
77 * after the numercial LU factorization phase.
78 *
79 * (xlusup,lusup): lusup[*] contains the numerical values of the
80 * rectangular supernodes; xlusup[j] points to the starting
81 * location of the j-th column in storage vector lusup[*]
82 * Note: xlusup is indexed by column.
83 * Each rectangular supernode is stored by column-major
84 * scheme, consistent with Fortran 2-dim array storage.
85 *
86 * (xusub,ucol,usub): ucol[*] stores the numerical values of
87 * U-columns outside the rectangular supernodes. The row
88 * subscript of nonzero ucol[k] is stored in usub[k].
89 * xusub[i] points to the starting location of column i in ucol.
90 * Storage: new row subscripts; that is subscripts of PA.
91 */
92typedef struct {
93 int *xsup; /* supernode and column mapping */
94 int *supno;
95 int *lsub; /* compressed L subscripts */
96 int *xlsub;
97 float *lusup; /* L supernodes */
98 int *xlusup;
99 float *ucol; /* U columns */
100 int *usub;
101 int *xusub;
102 int nzlmax; /* current max size of lsub */
103 int nzumax; /* " " " ucol */
104 int nzlumax; /* " " " lusup */
105 int n; /* number of columns in the matrix */
106 LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
107} GlobalLU_t;
108
109typedef struct {
110 int panel_size;
111 int relax;
112 float diag_pivot_thresh;
113 float drop_tol;
115
116typedef struct {
117 float for_lu;
118 float total_needed;
119 int expansions;
121
122#ifdef __cplusplus
123extern "C" {
124#endif
125
126/* Driver routines */
127extern void
129 SuperMatrix *, int *);
130extern void
131sgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
132 int *, int *, int *, char *, float *, float *,
133 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
134 SuperMatrix *, float *, float *, float *,
135 float *, mem_usage_t *, int *);
136
137/* Supernodal LU factor related */
138extern void
139sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *,
140 int *, int *, Stype_t, Dtype_t, Mtype_t);
141extern void
143extern void
144sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int,
146extern void
147sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *,
148 int *, int *, int *, int *, int *,
150extern void
151sCopy_Dense_Matrix(int, int, float *, int, float *, int);
152
158
159extern void sallocateA (int, int, float **, int **, int **);
160extern void StatInit (int, int);
161extern void StatFree ();
162extern void get_perm_c(int, SuperMatrix *, int *);
163extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
164extern int sp_coletree (int *, int *, int *, int, int, int *);
165extern void sgstrf (char*, SuperMatrix*, float, float, int, int, int*,
166 void *, int, int *, int *,
167 SuperMatrix *, SuperMatrix *, int *);
168extern void relax_snode (int, int *, int, int *, int *);
169extern int ssnode_dfs (const int, const int, const int *, const int *,
170 const int *, int *, int *, GlobalLU_t *);
171extern int ssnode_bmod (const int, const int, const int, float *,
172 float *, GlobalLU_t *);
173extern void spanel_dfs (const int, const int, const int, SuperMatrix *,
174 int *, int *, float *, int *, int *, int *,
175 int *, int *, int *, int *, GlobalLU_t *);
176extern void spanel_bmod (const int, const int, const int, const int,
177 float *, float *, int *, int *,
178 GlobalLU_t *);
179extern int scolumn_dfs (const int, const int, int *, int *, int *, int *,
180 int *, int *, int *, int *, int *, GlobalLU_t *);
181extern int scolumn_bmod (const int, const int, float *,
182 float *, int *, int *, int, GlobalLU_t *);
183extern int scopy_to_ucol (int, int, int *, int *, int *,
184 float *, GlobalLU_t *);
185extern int spivotL (const int, const float, int *, int *,
186 int *, int *, int *, GlobalLU_t *);
187extern void spruneL (const int, const int *, const int, const int,
188 const int *, const int *, int *, GlobalLU_t *);
189extern void resetrep_col (const int, const int *, int *);
190extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
191extern void fixupL (const int, const int *, GlobalLU_t *);
192extern int spcoletree (int *, int *, int *, int, int, int *);
193extern int *TreePostorder (int, int *);
194extern void sreadmt (int *, int *, int *, float **, int **, int **);
195extern void sGenXtrue (int, int, float *, int);
196extern void sFillRHS (char *, int, float *, int, SuperMatrix *,
197 SuperMatrix *);
198extern void sgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
199 SuperMatrix *, int *);
200
201
202/* Driver related */
203
204extern void sgsequ (SuperMatrix *, float *, float *, float *,
205 float *, float *, int *);
206extern void slaqgs (SuperMatrix *, float *, float *, float,
207 float, float, char *);
208extern void sgscon (char *, SuperMatrix *, SuperMatrix *,
209 float, float *, int *);
210extern float sPivotGrowth(int, SuperMatrix *, int *,
212extern void sgsrfs (char *, SuperMatrix *, SuperMatrix *,
213 SuperMatrix *, int *, int *, char *, float *,
214 float *, SuperMatrix *, SuperMatrix *, float *,
215 float *, int *);
216
217extern int sp_strsv (char *, char *, char *, SuperMatrix *,
218 SuperMatrix *, float *, int *);
219extern int sp_sgemv (char *, float, SuperMatrix *, float *,
220 int, float, float *, int);
221
222extern int sp_sgemm (char *, char *, int, int, int, float,
223 SuperMatrix *, float *, int, float,
224 float *, int);
225
226/* Memory-related */
227extern void superlu_abort_and_exit(char*);
228extern void *superlu_malloc (int);
229extern void superlu_free (void*);
230extern int sLUMemInit (char *, void *, int, int, int, int, int,
232 GlobalLU_t *, int **, float **);
233extern void SetIWork (int, int, int, int *, int **, int **, int **,
234 int **, int **, int **, int **);
235extern void sSetRWork (int, int, float *, float **, float **);
236extern void sLUWorkFree (int *, float *, GlobalLU_t *);
237extern int sLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
238
239extern int *intMalloc (int);
240extern int *intCalloc (int);
241extern float *floatMalloc(int);
242extern float *floatCalloc(int);
243extern void *superlu_malloc(int);
244extern int memory_usage();
245extern int sQuerySpace (SuperMatrix *, SuperMatrix *, int,
246 mem_usage_t *);
247
248/* Auxiliary routines */
249extern void sCompRow_to_CompCol(int, int, int, float*, int*, int*,
250 float **, int **, int **);
251extern double SuperLU_timer_ ();
252extern int sp_ienv (int);
253extern int lsame_ (char *, char *);
254extern int xerbla_ (char *, int *);
255extern void ifill (int *, int, int);
256extern void sfill (float *, int, float);
257extern void inf_norm_error (int, SuperMatrix *, float *);
258extern void snode_profile (int, int *);
259extern void super_stats (int, int *);
260extern void PrintSumm (char *, int, int, int);
262 float, float, float *, float *, char *);
263
264/* Routines for debugging */
265extern void sPrint_CompCol_Matrix(char *, SuperMatrix *);
267extern void sPrint_Dense_Matrix(char *, SuperMatrix *);
268extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
269extern void print_panel_seg(int, int, int, int, int *, int *);
270extern void check_tempv(int, float *);
271extern void check_repfnz(int, int, int, int *);
272
273#ifdef __cplusplus
274 }
275#endif
276
277#endif /* __SUPERLU_sSP_DEFS */
278
LU_space_t
Definition csp_defs.h:40
@ SYSTEM
Definition csp_defs.h:40
@ USER
Definition csp_defs.h:40
stack_end_t
Definition csp_defs.h:39
@ HEAD
Definition csp_defs.h:39
@ TAIL
Definition csp_defs.h:39
MemType
Definition csp_defs.h:38
@ LSUB
Definition csp_defs.h:38
@ UCOL
Definition csp_defs.h:38
@ LUSUP
Definition csp_defs.h:38
@ USUB
Definition csp_defs.h:38
void sp_preorder(char *, SuperMatrix *, int *, int *, SuperMatrix *)
void snode_profile(int, int *)
float * floatCalloc(int)
int * intCalloc(int)
int spcoletree(int *, int *, int *, int, int, int *)
double SuperLU_timer_()
void superlu_free(void *)
void spanel_bmod(const int, const int, const int, const int, float *, float *, int *, int *, GlobalLU_t *)
int scolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
int scopy_to_ucol(int, int, int *, int *, int *, float *, GlobalLU_t *)
void sPrint_Dense_Matrix(char *, SuperMatrix *)
void get_perm_c(int, SuperMatrix *, int *)
void StatFree()
void relax_snode(int, int *, int, int *, int *)
void Destroy_SuperMatrix_Store(SuperMatrix *)
void sfill(float *, int, float)
int sp_sgemm(char *, char *, int, int, int, float, SuperMatrix *, float *, int, float, float *, int)
void inf_norm_error(int, SuperMatrix *, float *)
void sgsequ(SuperMatrix *, float *, float *, float *, float *, float *, int *)
void Destroy_CompCol_Matrix(SuperMatrix *)
int sp_strsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, float *, int *)
void check_tempv(int, float *)
void PrintSumm(char *, int, int, int)
void print_panel_seg(int, int, int, int, int *, int *)
void sgscon(char *, SuperMatrix *, SuperMatrix *, float, float *, int *)
int lsame_(char *, char *)
void Destroy_CompCol_Permuted(SuperMatrix *)
void print_lu_col(char *, int, int, int *, GlobalLU_t *)
int ssnode_bmod(const int, const int, const int, float *, float *, GlobalLU_t *)
int sLUMemInit(char *, void *, int, int, int, int, int, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, float **)
void sgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *)
void sPrint_CompCol_Matrix(char *, SuperMatrix *)
void sCopy_Dense_Matrix(int, int, float *, int, float *, int)
void fixupL(const int, const int *, GlobalLU_t *)
int sp_ienv(int)
void sCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
void spanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, float *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void countnz(const int, int *, int *, int *, GlobalLU_t *)
void * superlu_malloc(int)
int xerbla_(char *, int *)
int scolumn_bmod(const int, const int, float *, float *, int *, int *, int, GlobalLU_t *)
void sLUWorkFree(int *, float *, GlobalLU_t *)
void sgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *, int *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, float *, float *, float *, float *, mem_usage_t *, int *)
void StatInit(int, int)
int sLUMemXpand(int, int, MemType, int *, GlobalLU_t *)
void check_repfnz(int, int, int, int *)
int sp_sgemv(char *, float, SuperMatrix *, float *, int, float, float *, int)
void Destroy_Dense_Matrix(SuperMatrix *)
void sgsrfs(char *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, int *)
int sQuerySpace(SuperMatrix *, SuperMatrix *, int, mem_usage_t *)
void sallocateA(int, int, float **, int **, int **)
void ifill(int *, int, int)
float * floatMalloc(int)
void sreadmt(int *, int *, int *, float **, int **, int **)
void sSetRWork(int, int, float *, float **, float **)
void resetrep_col(const int, const int *, int *)
void sGenXtrue(int, int, float *, int)
void sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *, int *, int *, Stype_t, Dtype_t, Mtype_t)
void superlu_abort_and_exit(char *)
void sFillRHS(char *, int, float *, int, SuperMatrix *, SuperMatrix *)
void super_stats(int, int *)
void sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, Stype_t, Dtype_t, Mtype_t)
int memory_usage()
float sPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
void spruneL(const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
int ssnode_dfs(const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
void PrintPerf(SuperMatrix *, SuperMatrix *, mem_usage_t *, float, float, float *, float *, char *)
void Destroy_SuperNode_Matrix(SuperMatrix *)
int * TreePostorder(int, int *)
void sgstrf(char *, SuperMatrix *, float, float, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, int *)
void SetIWork(int, int, int, int *, int **, int **, int **, int **, int **, int **, int **)
void sPrint_SuperNode_Matrix(char *, SuperMatrix *)
void sCompRow_to_CompCol(int, int, int, float *, int *, int *, float **, int **, int **)
void sCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, float *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
int spivotL(const int, const float, int *, int *, int *, int *, int *, GlobalLU_t *)
int sp_coletree(int *, int *, int *, int, int, int *)
void sgstrs(char *, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, int *)
int * intMalloc(int)
void slaqgs(SuperMatrix *, float *, float *, float, float, float, char *)
int * xusub
Definition csp_defs.h:103
int * xlusup
Definition csp_defs.h:100
int * usub
Definition csp_defs.h:102
LU_space_t MemModel
Definition csp_defs.h:108
complex * lusup
Definition csp_defs.h:99
int nzlumax
Definition csp_defs.h:106
complex * ucol
Definition csp_defs.h:101
Mtype_t
Definition supermatrix.h:31
Dtype_t
Definition supermatrix.h:24
Stype_t
Definition supermatrix.h:13
LU_space_t
Definition zsp_defs.h:39