TBCI Numerical high perf. C++ Library 2.8.0
zsp_defs.h
Go to the documentation of this file.
1
5
6/* $Id: zsp_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_zSP_DEFS /* allow multiple inclusions */
16#define __SUPERLU_zSP_DEFS
17
18/*
19 * File name: zsp_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#include "tbci/superlu/dcomplex.h"
30
31
32/* No of marker arrays used in the symbolic factorization,
33 each of size n */
34#define NO_MARKER 3
35#define NUM_TEMPV(m,w,t,b) ( MAX(m, (t + b)*w) )
36
37typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
38typedef enum {HEAD, TAIL} stack_end_t;
39typedef enum {SYSTEM, USER} LU_space_t;
40
41/*
42 * Global data structures used in LU factorization -
43 *
44 * nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
45 * (xsup,supno): supno[i] is the supernode no to which i belongs;
46 * xsup(s) points to the beginning of the s-th supernode.
47 * e.g. supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
48 * xsup 0 1 2 4 7 12
49 * Note: dfs will be performed on supernode rep. relative to the new
50 * row pivoting ordering
51 *
52 * (xlsub,lsub): lsub[*] contains the compressed subscript of
53 * rectangular supernodes; xlsub[j] points to the starting
54 * location of the j-th column in lsub[*]. Note that xlsub
55 * is indexed by column.
56 * Storage: original row subscripts
57 *
58 * During the course of sparse LU factorization, we also use
59 * (xlsub,lsub) for the purpose of symmetric pruning. For each
60 * supernode {s,s+1,...,t=s+r} with first column s and last
61 * column t, the subscript set
62 * lsub[j], j=xlsub[s], .., xlsub[s+1]-1
63 * is the structure of column s (i.e. structure of this supernode).
64 * It is used for the storage of numerical values.
65 * Furthermore,
66 * lsub[j], j=xlsub[t], .., xlsub[t+1]-1
67 * is the structure of the last column t of this supernode.
68 * It is for the purpose of symmetric pruning. Therefore, the
69 * structural subscripts can be rearranged without making physical
70 * interchanges among the numerical values.
71 *
72 * However, if the supernode has only one column, then we
73 * only keep one set of subscripts. For any subscript interchange
74 * performed, similar interchange must be done on the numerical
75 * values.
76 *
77 * The last column structures (for pruning) will be removed
78 * after the numercial LU factorization phase.
79 *
80 * (xlusup,lusup): lusup[*] contains the numerical values of the
81 * rectangular supernodes; xlusup[j] points to the starting
82 * location of the j-th column in storage vector lusup[*]
83 * Note: xlusup is indexed by column.
84 * Each rectangular supernode is stored by column-major
85 * scheme, consistent with Fortran 2-dim array storage.
86 *
87 * (xusub,ucol,usub): ucol[*] stores the numerical values of
88 * U-columns outside the rectangular supernodes. The row
89 * subscript of nonzero ucol[k] is stored in usub[k].
90 * xusub[i] points to the starting location of column i in ucol.
91 * Storage: new row subscripts; that is subscripts of PA.
92 */
93typedef struct {
94 int *xsup; /* supernode and column mapping */
95 int *supno;
96 int *lsub; /* compressed L subscripts */
97 int *xlsub;
98 doublecomplex *lusup; /* L supernodes */
99 int *xlusup;
100 doublecomplex *ucol; /* U columns */
101 int *usub;
102 int *xusub;
103 int nzlmax; /* current max size of lsub */
104 int nzumax; /* " " " ucol */
105 int nzlumax; /* " " " lusup */
106 int n; /* number of columns in the matrix */
107 LU_space_t MemModel; /* 0 - system malloc'd; 1 - user provided */
108} GlobalLU_t;
109
110typedef struct {
111 int panel_size;
112 int relax;
113 double diag_pivot_thresh;
114 double drop_tol;
116
117typedef struct {
118 float for_lu;
119 float total_needed;
120 int expansions;
122
123#ifdef __cplusplus
124extern "C" {
125#endif
126
127/* Driver routines */
128extern void
130 SuperMatrix *, int *);
131extern void
132zgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *,
133 int *, int *, int *, char *, double *, double *,
134 SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *,
135 SuperMatrix *, double *, double *, double *,
136 double *, mem_usage_t *, int *);
137
138/* Supernodal LU factor related */
139extern void
141 int *, int *, Stype_t, Dtype_t, Mtype_t);
142extern void
144extern void
147extern void
149 int *, int *, int *, int *, int *,
151extern void
153
159
160extern void zallocateA (int, int, doublecomplex **, int **, int **);
161extern void StatInit (int, int);
162extern void StatFree ();
163extern void get_perm_c(int, SuperMatrix *, int *);
164extern void sp_preorder (char*, SuperMatrix*, int*, int*, SuperMatrix*);
165extern int sp_coletree (int *, int *, int *, int, int, int *);
166extern void zgstrf (char*, SuperMatrix*, double, double, int, int, int*,
167 void *, int, int *, int *,
168 SuperMatrix *, SuperMatrix *, int *);
169extern void relax_snode (int, int *, int, int *, int *);
170extern int zsnode_dfs (const int, const int, const int *, const int *,
171 const int *, int *, int *, GlobalLU_t *);
172extern int zsnode_bmod (const int, const int, const int, doublecomplex *,
174extern void zpanel_dfs (const int, const int, const int, SuperMatrix *,
175 int *, int *, doublecomplex *, int *, int *, int *,
176 int *, int *, int *, int *, GlobalLU_t *);
177extern void zpanel_bmod (const int, const int, const int, const int,
178 doublecomplex *, doublecomplex *, int *, int *,
179 GlobalLU_t *);
180extern int zcolumn_dfs (const int, const int, int *, int *, int *, int *,
181 int *, int *, int *, int *, int *, GlobalLU_t *);
182extern int zcolumn_bmod (const int, const int, doublecomplex *,
183 doublecomplex *, int *, int *, int, GlobalLU_t *);
184extern int zcopy_to_ucol (int, int, int *, int *, int *,
186extern int zpivotL (const int, const double, int *, int *,
187 int *, int *, int *, GlobalLU_t *);
188extern void zpruneL (const int, const int *, const int, const int,
189 const int *, const int *, int *, GlobalLU_t *);
190extern void resetrep_col (const int, const int *, int *);
191extern void countnz (const int, int *, int *, int *, GlobalLU_t *);
192extern void fixupL (const int, const int *, GlobalLU_t *);
193extern int spcoletree (int *, int *, int *, int, int, int *);
194extern int *TreePostorder (int, int *);
195extern void zreadmt (int *, int *, int *, doublecomplex **, int **, int **);
196extern void zGenXtrue (int, int, doublecomplex *, int);
197extern void zFillRHS (char *, int, doublecomplex *, int, SuperMatrix *,
198 SuperMatrix *);
199extern void zgstrs (char *, SuperMatrix *, SuperMatrix *, int *, int *,
200 SuperMatrix *, int *);
201
202
203/* Driver related */
204
205extern void zgsequ (SuperMatrix *, double *, double *, double *,
206 double *, double *, int *);
207extern void zlaqgs (SuperMatrix *, double *, double *, double,
208 double, double, char *);
209extern void zgscon (char *, SuperMatrix *, SuperMatrix *,
210 double, double *, int *);
211extern double zPivotGrowth(int, SuperMatrix *, int *,
213extern void zgsrfs (char *, SuperMatrix *, SuperMatrix *,
214 SuperMatrix *, int *, int *, char *, double *,
215 double *, SuperMatrix *, SuperMatrix *,
216 double *, double *, int *);
217
218extern int sp_ztrsv (char *, char *, char *, SuperMatrix *,
219 SuperMatrix *, doublecomplex *, int *);
221 int, doublecomplex, doublecomplex *, int);
222
223extern int sp_zgemm (char *, char *, int, int, int, doublecomplex,
225 doublecomplex *, int);
226
227/* Memory-related */
228extern void superlu_abort_and_exit(char*);
229extern void *superlu_malloc (int);
230extern void superlu_free (void*);
231extern int zLUMemInit (char *, void *, int, int, int, int, int,
233 GlobalLU_t *, int **, doublecomplex **);
234extern void SetIWork (int, int, int, int *, int **, int **, int **,
235 int **, int **, int **, int **);
236extern void zSetRWork (int, int, doublecomplex *, doublecomplex **, doublecomplex **);
237extern void zLUWorkFree (int *, doublecomplex *, GlobalLU_t *);
238extern int zLUMemXpand (int, int, MemType, int *, GlobalLU_t *);
239
240extern int *intMalloc (int);
241extern int *intCalloc (int);
244extern double *doubleMalloc(int);
245extern double *doubleCalloc(int);
246extern void *superlu_malloc(int);
247extern int memory_usage();
248extern int zQuerySpace (SuperMatrix *, SuperMatrix *, int,
249 mem_usage_t *);
250
251/* Auxiliary routines */
252extern void zCompRow_to_CompCol(int, int, int, doublecomplex*, int*, int*,
253 doublecomplex **, int **, int **);
254extern double SuperLU_timer_ ();
255extern int sp_ienv (int);
256extern int lsame_ (char *, char *);
257extern int xerbla_ (char *, int *);
258extern void ifill (int *, int, int);
259extern void zfill (doublecomplex *, int, doublecomplex);
261extern void snode_profile (int, int *);
262extern void super_stats (int, int *);
263extern void PrintSumm (char *, int, int, int);
266
267/* Routines for debugging */
268extern void zPrint_CompCol_Matrix(char *, SuperMatrix *);
270extern void zPrint_Dense_Matrix(char *, SuperMatrix *);
271extern void print_lu_col(char *, int, int, int *, GlobalLU_t *);
272extern void print_panel_seg(int, int, int, int, int *, int *);
273extern void check_tempv(int, doublecomplex *);
274extern void check_repfnz(int, int, int, int *);
275
276#ifdef __cplusplus
277 }
278#endif
279
280#endif /* __SUPERLU_zSP_DEFS */
281
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
#define doublecomplex
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
void sp_preorder(char *, SuperMatrix *, int *, int *, SuperMatrix *)
void snode_profile(int, int *)
int zcopy_to_ucol(int, int, int *, int *, int *, doublecomplex *, GlobalLU_t *)
void zPrint_CompCol_Matrix(char *, SuperMatrix *)
int * intCalloc(int)
int spcoletree(int *, int *, int *, int, int, int *)
double SuperLU_timer_()
int zQuerySpace(SuperMatrix *, SuperMatrix *, int, mem_usage_t *)
void superlu_free(void *)
double * doubleMalloc(int)
void get_perm_c(int, SuperMatrix *, int *)
void zallocateA(int, int, doublecomplex **, int **, int **)
void StatFree()
int sp_zgemv(char *, doublecomplex, SuperMatrix *, doublecomplex *, int, doublecomplex, doublecomplex *, int)
void relax_snode(int, int *, int, int *, int *)
void Destroy_SuperMatrix_Store(SuperMatrix *)
int zLUMemXpand(int, int, MemType, int *, GlobalLU_t *)
void zgscon(char *, SuperMatrix *, SuperMatrix *, double, double *, 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 zsp_defs.h:39
void zCopy_Dense_Matrix(int, int, doublecomplex *, int, doublecomplex *, int)
void zPrint_Dense_Matrix(char *, SuperMatrix *)
int lsame_(char *, char *)
void Destroy_CompCol_Permuted(SuperMatrix *)
void print_lu_col(char *, int, int, int *, GlobalLU_t *)
double * doubleCalloc(int)
void zLUWorkFree(int *, doublecomplex *, GlobalLU_t *)
void zCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *)
int zsnode_bmod(const int, const int, const int, doublecomplex *, doublecomplex *, GlobalLU_t *)
int zcolumn_bmod(const int, const int, doublecomplex *, doublecomplex *, int *, int *, int, GlobalLU_t *)
void fixupL(const int, const int *, GlobalLU_t *)
int sp_zgemm(char *, char *, int, int, int, doublecomplex, SuperMatrix *, doublecomplex *, int, doublecomplex, doublecomplex *, int)
void zCreate_CompCol_Matrix(SuperMatrix *, int, int, int, doublecomplex *, int *, int *, Stype_t, Dtype_t, Mtype_t)
int sp_ienv(int)
void countnz(const int, int *, int *, int *, GlobalLU_t *)
void check_tempv(int, doublecomplex *)
doublecomplex * doublecomplexCalloc(int)
double zPivotGrowth(int, SuperMatrix *, int *, SuperMatrix *, SuperMatrix *)
void zpruneL(const int, const int *, const int, const int, const int *, const int *, int *, GlobalLU_t *)
void * superlu_malloc(int)
void zgstrs(char *, SuperMatrix *, SuperMatrix *, int *, int *, SuperMatrix *, int *)
int xerbla_(char *, int *)
int zLUMemInit(char *, void *, int, int, int, int, int, SuperMatrix *, SuperMatrix *, GlobalLU_t *, int **, doublecomplex **)
int sp_ztrsv(char *, char *, char *, SuperMatrix *, SuperMatrix *, doublecomplex *, int *)
void zFillRHS(char *, int, doublecomplex *, int, SuperMatrix *, SuperMatrix *)
void StatInit(int, int)
void check_repfnz(int, int, int, int *)
void zgstrf(char *, SuperMatrix *, double, double, int, int, int *, void *, int, int *, int *, SuperMatrix *, SuperMatrix *, int *)
void Destroy_Dense_Matrix(SuperMatrix *)
void zSetRWork(int, int, doublecomplex *, doublecomplex **, doublecomplex **)
void zlaqgs(SuperMatrix *, double *, double *, double, double, double, char *)
void inf_norm_error(int, SuperMatrix *, doublecomplex *)
void ifill(int *, int, int)
void zCompRow_to_CompCol(int, int, int, doublecomplex *, int *, int *, doublecomplex **, int **, int **)
void zgsrfs(char *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, double *, double *, int *)
void resetrep_col(const int, const int *, int *)
int zcolumn_dfs(const int, const int, int *, int *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void zCreate_Dense_Matrix(SuperMatrix *, int, int, doublecomplex *, int, Stype_t, Dtype_t, Mtype_t)
void superlu_abort_and_exit(char *)
void zGenXtrue(int, int, doublecomplex *, int)
void super_stats(int, int *)
void zCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, doublecomplex *, int *, int *, int *, int *, int *, Stype_t, Dtype_t, Mtype_t)
void zpanel_bmod(const int, const int, const int, const int, doublecomplex *, doublecomplex *, int *, int *, GlobalLU_t *)
int memory_usage()
void zreadmt(int *, int *, int *, doublecomplex **, int **, int **)
void zgssv(SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *, SuperMatrix *, int *)
void zpanel_dfs(const int, const int, const int, SuperMatrix *, int *, int *, doublecomplex *, int *, int *, int *, int *, int *, int *, int *, GlobalLU_t *)
void Destroy_SuperNode_Matrix(SuperMatrix *)
void zgsequ(SuperMatrix *, double *, double *, double *, double *, double *, int *)
int * TreePostorder(int, int *)
doublecomplex * doublecomplexMalloc(int)
void PrintPerf(SuperMatrix *, SuperMatrix *, mem_usage_t *, doublecomplex, doublecomplex, doublecomplex *, doublecomplex *, char *)
void SetIWork(int, int, int, int *, int **, int **, int **, int **, int **, int **, int **)
void zgssvx(char *, char *, char *, SuperMatrix *, factor_param_t *, int *, int *, int *, char *, double *, double *, SuperMatrix *, SuperMatrix *, void *, int, SuperMatrix *, SuperMatrix *, double *, double *, double *, double *, mem_usage_t *, int *)
int zsnode_dfs(const int, const int, const int *, const int *, const int *, int *, int *, GlobalLU_t *)
int zpivotL(const int, const double, int *, int *, int *, int *, int *, GlobalLU_t *)
int sp_coletree(int *, int *, int *, int, int, int *)
void zPrint_SuperNode_Matrix(char *, SuperMatrix *)
int * intMalloc(int)
void zfill(doublecomplex *, int, doublecomplex)