TBCI Numerical high perf. C++ Library 2.8.0
csp_defs.h
Go to the documentation of this file.
1
5
6/* $Id: csp_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
16#ifndef __SUPERLU_cSP_DEFS /* allow multiple inclusions */
17#define __SUPERLU_cSP_DEFS
18
19/*
20 * File name: csp_defs.h
21 * Purpose: Sparse matrix types and function prototypes
22 * History:
23 */
24#ifdef _CRAY
25#include <fortran.h>
26#include <string.h>
27#endif
28#include "tbci/superlu/Cnames.h"
29#include "tbci/superlu/supermatrix.h"
30#include "tbci/superlu/scomplex.h"
31
32
33/* No of marker arrays used in the symbolic factorization,
34 each of size n */
35#define NO_MARKER 3
36#define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
37
38typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
39typedef enum {HEAD, TAIL} stack_end_t;
40typedef enum {SYSTEM, USER} LU_space_t;
41
42/*
43 * Global data structures used in LU factorization -
44 *
45 * nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
46 * (xsup,supno): supno[i] is the supernode no to which i belongs;
47 * xsup(s) points to the beginning of the s-th supernode.
48/bin/bash: s: command not found
49 * xsup 0 1 2 4 7 12
50 * Note: dfs will be performed on supernode rep. relative to the new
51 * row pivoting ordering
52 *
53 * (xlsub,lsub): lsub[*] contains the compressed subscript of
54 * rectangular supernodes; xlsub[j] points to the starting
55 * location of the j-th column in lsub[*]. Note that xlsub
56 * is indexed by column.
57 * Storage: original row subscripts
58 *
59 * During the course of sparse LU factorization, we also use
60 * (xlsub,lsub) for the purpose of symmetric pruning. For each
61 * supernode {s,s+1,...,t=s+r} with first column s and last
62 * column t, the subscript set
63 * lsub[j], j=xlsub[s], .., xlsub[s+1]-1
64 * is the structure of column s (i.e. structure of this supernode).
65 * It is used for the storage of numerical values.
66 * Furthermore,
67 * lsub[j], j=xlsub[t], .., xlsub[t+1]-1
68 * is the structure of the last column t of this supernode.
69 * It is for the purpose of symmetric pruning. Therefore, the
70 * structural subscripts can be rearranged without making physical
71 * interchanges among the numerical values.
72 *
73 * However, if the supernode has only one column, then we
74 * only keep one set of subscripts. For any subscript interchange
75 * performed, similar interchange must be done on the numerical
76 * values.
77 *
78 * The last column structures (for pruning) will be removed
79 * after the numercial LU factorization phase.
80 *
81 * (xlusup,lusup): lusup[*] contains the numerical values of the
82 * rectangular supernodes; xlusup[j] points to the starting
83 * location of the j-th column in storage vector lusup[*]
84 * Note: xlusup is indexed by column.
85 * Each rectangular supernode is stored by column-major
86 * scheme, consistent with Fortran 2-dim array storage.
87 *
88 * (xusub,ucol,usub): ucol[*] stores the numerical values of
89 * U-columns outside the rectangular supernodes. The row
90 * subscript of nonzero ucol[k] is stored in usub[k].
91 * xusub[i] points to the starting location of column i in ucol.
92 * Storage: new row subscripts; that is subscripts of PA.
93 */
94typedef struct {
95 int *xsup; /* supernode and column mapping */
96 int *supno;
97 int *lsub; /* compressed L subscripts */
98 int *xlsub;
99 complex *lusup; /* L supernodes */
100 int *xlusup;
101 complex *ucol; /* U columns */
102 int *usub;
103 int *xusub;
104 int nzlmax; /* current max size of lsub */
105 int nzumax; /* " " " ucol */
106 int nzlumax; /* " " " lusup */
107 int n; /* number of columns in the matrix */
108 LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
109} GlobalLU_t;
110
111typedef struct {
113 int relax;
115 float drop_tol;
117
118typedef struct {
119 float for_lu;
123
124#ifdef __cplusplus
125extern "C" {
126#endif
127
128/* Driver routines */
129extern void
131 SuperMatrix *, int *);
132extern void
133cgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
134 int *, int *, int *, char *, float *, float *,
135 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
136 SuperMatrix *, float *, float *, float *,
137 float *, mem_usage_t *, int *);
138
139/* Supernodal LU factor related */
140extern void
142 int *, int *, Stype_t, Dtype_t, Mtype_t);
143extern void
145extern void
148extern void
150 int *, int *, int *, int *, int *,
152extern void
153cCopy_Dense_Matrix(int, int, complex *, int, complex *, int);
154
160
161extern void callocateA (int, int, complex **, int **, int **);
162extern void StatInit (int, int);
163extern void StatFree ();
164extern void get_perm_c(int, SuperMatrix *, int *);
165extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
166extern int sp_coletree (int *, int *, int *, int, int, int *);
167extern void cgstrf (char*, SuperMatrix*, float, float, int, int, int*,
168 void *, int, int *, int *,
169 SuperMatrix *, SuperMatrix *, int *);
170extern void relax_snode (int, int *, int, int *, int *);
171extern int csnode_dfs (const int, const int, const int *, const int *,
172 const int *, int *, int *, GlobalLU_t *);
173extern int csnode_bmod (const int, const int, const int, complex *,
174 complex *, GlobalLU_t *);
175extern void cpanel_dfs (const int, const int, const int, SuperMatrix *,
176 int *, int *, complex *, int *, int *, int *,
177 int *, int *, int *, int *, GlobalLU_t *);
178extern void cpanel_bmod (const int, const int, const int, const int,
179 complex *, complex *, int *, int *,
180 GlobalLU_t *);
181extern int ccolumn_dfs (const int, const int, int *, int *, int *, int *,
182 int *, int *, int *, int *, int *, GlobalLU_t *);
183extern int ccolumn_bmod (const int, const int, complex *,
184 complex *, int *, int *, int, GlobalLU_t *);
185extern int ccopy_to_ucol (int, int, int *, int *, int *,
186 complex *, GlobalLU_t *);
187extern int cpivotL (const int, const float, int *, int *,
188 int *, int *, int *, GlobalLU_t *);
189extern void cpruneL (const int, const int *, const int, const int,
190 const int *, const int *, int *, GlobalLU_t *);
191extern void resetrep_col (const int, const int *, int *);
192extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
193extern void fixupL (const int, const int *, GlobalLU_t *);
194extern int spcoletree (int *, int *, int *, int, int, int *);
195extern int *TreePostorder (int, int *);
196extern void creadmt (int *, int *, int *, complex **, int **, int **);
197extern void cGenXtrue (int, int, complex *, int);
198extern void cFillRHS (char *, int, complex *, int, SuperMatrix *,
199 SuperMatrix *);
200extern void cgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
201 SuperMatrix *, int *);
202
203
204/* Driver related */
205
206extern void cgsequ (SuperMatrix *, float *, float *, float *,
207 float *, float *, int *);
208extern void claqgs (SuperMatrix *, float *, float *, float,
209 float, float, char *);
210extern void cgscon (char *, SuperMatrix *, SuperMatrix *,
211 float, float *, int *);
212extern float cPivotGrowth(int, SuperMatrix *, int *,
214extern void cgsrfs (char *, SuperMatrix *, SuperMatrix *,
215 SuperMatrix *, int *, int *, char *, float *,
216 float *, SuperMatrix *, SuperMatrix *, float *,
217 float *, int *);
218
219extern int sp_ctrsv (char *, char *, char *, SuperMatrix *,
220 SuperMatrix *, complex *, int *);
221extern int sp_cgemv (char *, complex, SuperMatrix *, complex *,
222 int, complex, complex *, int);
223
224extern int sp_cgemm (char *, char *, int, int, int, complex,
225 SuperMatrix *, complex *, int, complex,
226 complex *, int);
227
228/* Memory-related */
229extern void superlu_abort_and_exit(char*);
230extern void *superlu_malloc (int);
231extern void superlu_free (void*);
232extern int cLUMemInit (char *, void *, int, int, int, int, int,
234 GlobalLU_t *, int **, complex **);
235extern void SetIWork (int, int, int, int *, int **, int **, int **,
236 int **, int **, int **, int **);
237extern void cSetRWork (int, int, complex *, complex **, complex **);
238extern void cLUWorkFree (int *, complex *, GlobalLU_t *);
239extern int cLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
240
241extern int *intMalloc (int);
242extern int *intCalloc (int);
245extern float *floatMalloc(int);
246extern float *floatCalloc(int);
247extern void *superlu_malloc(int);
248extern int memory_usage();
249extern int cQuerySpace (SuperMatrix *, SuperMatrix *, int,
250 mem_usage_t *);
251
252/* Auxiliary routines */
253extern void cCompRow_to_CompCol(int, int, int, complex*, int*, int*,
254 complex **, int **, int **);
255extern double SuperLU_timer_ ();
256extern int sp_ienv (int);
257extern int lsame_ (char *, char *);
258extern int xerbla_ (char *, int *);
259extern void ifill (int *, int, int);
260extern void cfill (complex *, int, complex);
261extern void inf_norm_error (int, SuperMatrix *, complex *);
262extern void snode_profile (int, int *);
263extern void super_stats (int, int *);
264extern void PrintSumm (char *, int, int, int);
266 complex, complex, complex *, complex *, char *);
267
268/* Routines for debugging */
269extern void cPrint_CompCol_Matrix(char *, SuperMatrix *);
271extern void cPrint_Dense_Matrix(char *, SuperMatrix *);
272extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
273extern void print_panel_seg(int, int, int, int, int *, int *);
274extern void check_tempv(int, complex *);
275extern void check_repfnz(int, int, int, int *);
276
277#ifdef __cplusplus
278 }
279#endif
280
281#endif /* __SUPERLU_cSP_DEFS */
282
void sp_preorder(char *, SuperMatrix *, int *, int *, SuperMatrix *)
void cgssvx(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 snode_profile(int, int *)
int csnode_bmod(const int, const int, const int, complex *, complex *, GlobalLU_t *)
int sp_cgemm(char *, char *, int, int, int, complex, SuperMatrix *, complex *, int, complex, complex *, int)
float * floatCalloc(int)
int * intCalloc(int)
int spcoletree(int *, int *, int *, int, int, int *)
double SuperLU_timer_()
void cgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *)
void cgsrfs(char *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, float *, float *, SuperMatrix *, SuperMatrix *, float *, float *, int *)
void superlu_free(void *)
void cPrint_Dense_Matrix(char *, SuperMatrix *)
void cgstrf(char *, SuperMatrix *, float, float, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, int *)
void callocateA(int, int, complex **, int **, int **)
int ccopy_to_ucol(int, int, int *, int *, int *, complex *, GlobalLU_t *)
int cLUMemXpand(int, int, MemType, int *, GlobalLU_t *)
void get_perm_c(int, SuperMatrix *, int *)
void StatFree()
void relax_snode(int, int *, int, int *, int *)
void cCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
void Destroy_SuperMatrix_Store(SuperMatrix *)
void check_tempv(int, complex *)
void cCompRow_to_CompCol(int, int, int, complex *, int *, int *, complex **, int **, int **)
void cgscon(char *, SuperMatrix *, SuperMatrix *, float, float *, int *)
void Destroy_CompCol_Matrix(SuperMatrix *)
void PrintSumm(char *, int, int, int)
void print_panel_seg(int, int, int, int, int *, int *)
LU_space_t
Definition csp_defs.h:40
@ SYSTEM
Definition csp_defs.h:40
@ USER
Definition csp_defs.h:40
int lsame_(char *, char *)
void Destroy_CompCol_Permuted(SuperMatrix *)
void print_lu_col(char *, int, int, int *, GlobalLU_t *)
void cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, complex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
int sp_ctrsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, complex *, int *)
int sp_cgemv(char *, complex, SuperMatrix *, complex *, int, complex, complex *, int)
int cpivotL(const int, const float, int *, int *, int *, int *, int *, GlobalLU_t *)
void cfill(complex *, int, complex)
void cCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, complex *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
void cpruneL(const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
int ccolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
complex * complexCalloc(int)
void cFillRHS(char *, int, complex *, int, SuperMatrix *, SuperMatrix *)
void fixupL(const int, const int *, GlobalLU_t *)
int sp_ienv(int)
void cCopy_Dense_Matrix(int, int, complex *, int, complex *, int)
void cpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, complex *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void PrintPerf(SuperMatrix *, SuperMatrix *, mem_usage_t *, complex, complex, complex *, complex *, char *)
void cGenXtrue(int, int, complex *, int)
void countnz(const int, int *, int *, int *, GlobalLU_t *)
void cPrint_SuperNode_Matrix(char *, SuperMatrix *)
void creadmt(int *, int *, int *, complex **, int **, int **)
void * superlu_malloc(int)
int xerbla_(char *, int *)
complex * complexMalloc(int)
void StatInit(int, int)
int cQuerySpace(SuperMatrix *, SuperMatrix *, int, mem_usage_t *)
float cPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
void cCreate_Dense_Matrix(SuperMatrix *, int, int, complex *, int, Stype_t, Dtype_t, Mtype_t)
stack_end_t
Definition csp_defs.h:39
@ HEAD
Definition csp_defs.h:39
@ TAIL
Definition csp_defs.h:39
void check_repfnz(int, int, int, int *)
void Destroy_Dense_Matrix(SuperMatrix *)
void cpanel_bmod(const int, const int, const int, const int, complex *, complex *, int *, int *, GlobalLU_t *)
void cLUWorkFree(int *, complex *, GlobalLU_t *)
int ccolumn_bmod(const int, const int, complex *, complex *, int *, int *, int, GlobalLU_t *)
void ifill(int *, int, int)
float * floatMalloc(int)
void resetrep_col(const int, const int *, int *)
void cgstrs(char *, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, int *)
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 superlu_abort_and_exit(char *)
void super_stats(int, int *)
int csnode_dfs(const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
int memory_usage()
void cgsequ(SuperMatrix *, float *, float *, float *, float *, float *, int *)
int cLUMemInit(char *, void *, int, int, int, int, int, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, complex **)
void claqgs(SuperMatrix *, float *, float *, float, float, float, char *)
void Destroy_SuperNode_Matrix(SuperMatrix *)
int * TreePostorder(int, int *)
void inf_norm_error(int, SuperMatrix *, complex *)
void SetIWork(int, int, int, int *, int **, int **, int **, int **, int **, int **, int **)
void cPrint_CompCol_Matrix(char *, SuperMatrix *)
void cSetRWork(int, int, complex *, complex **, complex **)
int sp_coletree(int *, int *, int *, int, int, int *)
int * intMalloc(int)
#define complex
int * xusub
Definition csp_defs.h:103
int * xlsub
Definition csp_defs.h:98
int * xlusup
Definition csp_defs.h:100
int * usub
Definition csp_defs.h:102
int * lsub
Definition csp_defs.h:97
LU_space_t MemModel
Definition csp_defs.h:108
int * supno
Definition csp_defs.h:96
complex * lusup
Definition csp_defs.h:99
int nzlumax
Definition csp_defs.h:106
complex * ucol
Definition csp_defs.h:101
int * xsup
Definition csp_defs.h:95
float diag_pivot_thresh
Definition csp_defs.h:114
int expansions
Definition csp_defs.h:121
float total_needed
Definition csp_defs.h:120
float for_lu
Definition csp_defs.h:119
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