XC Open source finite element analysis program
pdsp_defs.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /*
28  * -- SuperLU MT routine (version 1.0) --
29  * Univ. of California Berkeley, Xerox Palo Alto Research Center,
30  * and Lawrence Berkeley National Lab.
31  * August 15, 1997
32  *
33  * Sparse matrix types and function prototypes.
34  *
35  */
36 
37 #ifndef __SUPERLU_dSP_DEFS /* allow multiple inclusions */
38 #define __SUPERLU_dSP_DEFS
39 
40 /****************************
41  Include thread header file
42  ***************************/
43 #if defined ( _SOLARIS )
44 #include <thread.h>
45 #include <sched.h>
46 #elif defined( _DEC )
47 #include <pthread.h>
48 #include <unistd.h>
49 #include <sys/mman.h>
50 #elif defined ( _PTHREAD )
51 #include <pthread.h>
52 #elif defined ( _CRAY )
53 #include <fortran.h>
54 #include <string.h>
55 #endif
56 
57 #include "machines.h"
58 #include "Cnames.h"
59 #include "supermatrix.h"
60 #include "util.h"
61 #include "pxgstrf_synch.h"
62 
63 #if ( MACH==DEC || MACH==PTHREAD )
64 typedef pthread_mutex_t mutex_t;
65 #elif ( MACH==SGI || MACH==ORIGIN )
66 typedef int mutex_t;
67 #elif ( MACH==CRAY_PVP )
68 typedef int mutex_t;
69 #endif
70 
71 /**********************
72  Enumerated constants
73  *********************/
74 typedef enum {NO, YES} yes_no_t;
75 typedef enum {NOTRANS, TRANS, CONJ} trans_t;
76 typedef enum {FACTORED, DOFACT, EQUILIBRATE} fact_t;
77 typedef enum {NOEQUIL, ROW, COL, BOTH} equed_t;
78 typedef enum {LUSUP, UCOL, LSUB, USUB} MemType;
79 
80 /* Number of marker arrays used in the symbolic factorization,
81  each of size nrow. */
82 #define NO_MARKER 3
83 
84 #define LOCOL 70
85 #define HICOL 78
86 #define BADROW 44
87 #define BADCOL 35
88 #define BADPAN BADCOL
89 #define BADREP 35
90 /*
91  * *************************************************
92  * Global data structures used in LU factorization
93  * *************************************************
94  *
95  * nsuper: number of supernodes = nsuper+1, numbered between 0 and nsuper.
96  *
97  * (supno, xsup, xsup_end):
98  * supno[i] is the supernode number to which column i belongs;
99  * xsup[s] points to the first column of supernode s;
100  * xsup_end[s] points to one past the last column of supernode s.
101  * Example: supno 0 1 2 2 3 3 3 4 4 4 4 4 (n=12)
102  * xsup 0 1 2 4 7
103  * xsup_end 1 2 4 7 12
104  * Note: dfs will be performed on supernode rep. relative to the new_
105  * row pivoting ordering
106  *
107  * (lsub, xlsub, xlsub_end):
108  * lsub[*] contains the compressed subscripts of the supernodes;
109  * xlsub[j] points to the starting location of the j-th column in
110  * lsub[*];
111  * xlsub_end[j] points to one past the ending location of the j-th
112  * column in lsub[*].
113  * Storage: original row subscripts in A.
114  *
115  * During the course of sparse LU factorization, we also use
116  * (lsub, xlsub, xlsub_end, xprune) to represent symmetrically
117  * pruned graph. Contention will occur when one processor is
118  * performing DFS on supernode S, while another processor is pruning
119  * supernode S. We use the following data structure to deal with
120  * this problem. Suppose each supernode contains columns {s,s+1,...,t},
121  * with first column s and last column t.
122  *
123  * (1) if t > s, only the subscript sets for column s and column t
124  * are stored. Column t represents pruned adjacency structure.
125  *
126  * --------------------------------------------
127  * lsub[*] ... | col s | col t | ...
128  * --------------------------------------------
129  * ^ ^ ^
130  * xlsub[s] xlsub_end[s] xlsub_end[s+1]
131  * xlsub[s+1] :
132  * : :
133  * : xlsub_end[t]
134  * xlsub[t] xprune[t]
135  * xprune[s]
136  *
137  * (2) if t == s, i.e., a singleton supernode, the subscript set
138  * is stored twice:
139  *
140  * --------------------------------------
141  * lsub[*] ... | s | s | ...
142  * --------------------------------------
143  * ^ ^ ^
144  * xlsub[s] xlsub_end[s] xprune[s]
145  *
146  * There are two subscript sets for each supernode, the last column
147  * structures (for pruning) will be removed after the numerical LU
148  * factorization phase:
149  * o lsub[j], j = xlsub[s], ..., xlsub_end[s]-1
150  * is the structure of column s (i.e. structure of this supernode).
151  * It is used for the storage of numerical values.
152  * o lsub[j], j = xlsub[t], ..., xlsub_end[t]-1
153  * is the structure of the last column t of this supernode.
154  * It is for the purpose of symmetric pruning. Therefore, the
155  * structural subscripts can be rearranged without making physical
156  * interchanges among the numerical values.
157  *
158  * DFS will traverse the first subscript set if the supernode
159  * has not been pruned; otherwise it will traverse the second
160  * subscript list, i.e., the part of the pruned graph.
161  *
162  * (lusup, xlusup, xlusup_end):
163  * lusup[*] contains the numerical values of the supernodes;
164  * xlusup[j] points to the starting location of the j-th column in
165  * storage vector lusup[*];
166  * xlusup_end[j] points to one past the ending location of the j-th
167  * column in lusup[*].
168  * Each supernode is stored in column-major, consistent with Fortran
169  * two-dimensional array storage.
170  *
171  * (ucol, usub, xusub, xusub_end):
172  * ucol[*] stores the numerical values of the U-columns above the
173  * supernodes.
174  * usub[k] stores the row subscripts of nonzeros ucol[k];
175  * xusub[j] points to the starting location of column j in ucol/usub[];
176  * xusub_end[j] points to one past the ending location column j in
177  * ucol/usub[].
178  * Storage: new_ row subscripts; that is indexed intp PA.
179  *
180  */
181 typedef struct {
182  int *xsup; /* supernode and column mapping */
183  int *xsup_end;
184  int *supno;
185  int *lsub; /* compressed L subscripts */
186  int *xlsub;
187  int *xlsub_end;
188  double *lusup; /* L supernodes */
189  int *xlusup;
190  int *xlusup_end;
191  double *ucol; /* U columns */
192  int *usub;
193  int *xusub;
194  int *xusub_end;
195  int nsuper; /* current supernode number */
196  int nextl; /* next position in lsub[] */
197  int nextu; /* next position in usub[]/ucol[] */
198  int nextlu; /* next position in lusup[] */
199  int nzlmax; /* current max size of lsub[] */
200  int nzumax; /* " " " ucol[] */
201  int nzlumax; /* " " " lusup[] */
202  /* ---------------------------------------------------------------
203  * Memory managemant for L supernodes
204  */
205  int *map_in_sup; /* size n+1 - the address offset of each column
206  * in lusup[*], which is divided into regions
207  * by the supernodes of Householder matrix H.
208  * If column k starts a supernode in H,
209  * map_in_sup[k] is the next open position in
210  * lusup[*]; otherwise map_in_sup[k] gives the
211  * offset (negative) to the leading column
212  * of the supernode in H.
213  */
214  int dynamic_snode_bound;
215  /* --------------------------------------------------------------- */
216 } GlobalLU_t;
217 
218 /*
219  * *********************************************************************
220  * The pdgstrf_options_t structure contains the shared variables used
221  * for factorization, which are passed to each thread.
222  * *********************************************************************
223  *
224  * nprocs (int)
225  * Number of processes (or threads) to be spawned and used to perform
226  * the LU factorization by pdgstrf().
227  *
228  * fact (fact_t)
229  * Specifies whether or not the factored form of the matrix
230  * A is supplied on entry, and if not, whether the matrix A should
231  * be equilibrated before it is factored.
232  * = FACTORED: On entry, L, U, perm_r and perm_c contain the
233  * factored form of A. If equed is not 'N', the matrix A has
234  * been equilibrated with scaling factors R and C.
235  * A, L, U, perm_r are not modified.
236  * = DOFACT: The matrix A will be factored, and the factors will be
237  * stored in L and U.
238  * = EQUILIBRATE: The matrix A will be equilibrated if necessary, then
239  * factored into L and U.
240  *
241  * trans (trans_t)
242  * Specifies the form of the system of equations:
243  * = NOTRANS: A * X = B (No transpose)
244  * = TRANS: A**T * X = B (Transpose)
245  * = CONJ: A**H * X = B (Transpose)
246  *
247  * refact (yes_no_t)
248  * Specifies whether this is first time or subsequent factorization.
249  * = NO: this factorization is treated as the first one;
250  * = YES: it means that a factorization was performed prior to this
251  * one. Therefore, this factorization will re-use some
252  * existing data structures, such as L and U storage, column
253  * elimination tree, and the symbolic information of the
254  * Householder matrix.
255  *
256  * panel_size (int)
257  * A panel consists of at most panel_size consecutive columns.
258  *
259  * relax (int)
260  * To control degree of relaxing supernodes. If the number
261  * of nodes (columns) in a subtree of the elimination tree is less
262  * than relax, this subtree is considered as one supernode,
263  * regardless of the row structures of those columns.
264  *
265  * diag_pivot_thresh (double)
266  * Diagonal pivoting threshold. At step j of the Gaussian elimination,
267  * if abs(A_jj) >= diag_pivot_thresh * (max_(i>=j) abs(A_ij)),
268  * use A_jj as pivot, else use A_ij with maximum magnitude.
269  * 0 <= diag_pivot_thresh <= 1. The default value is 1,
270  * corresponding to partial pivoting.
271  *
272  * usepr (yes_no_t)
273  * Whether the pivoting will use perm_r specified by the user.
274  * = YES: use perm_r; perm_r is input, unchanged on exit.
275  * = NO: perm_r is determined by partial pivoting, and is output.
276  *
277  * drop_tol (double) (NOT IMPLEMENTED)
278  * Drop tolerance parameter. At step j of the Gaussian elimination,
279  * if abs(A_ij)/(max_i abs(A_ij)) < drop_tol, drop entry A_ij.
280  * 0 <= drop_tol <= 1. The default value of drop_tol is 0,
281  * corresponding to not dropping any entry.
282  *
283  * perm_c (int*) dimension A->ncol
284  * Column permutation vector, which defines the
285  * permutation matrix Pc; perm_c[i] = j means column i of A is
286  * in position j in A*Pc.
287  * When search for diagonal, perm_c[*] is applied to the
288  * row subscripts of A, so that diagonal threshold pivoting
289  * can find the diagonal of A, instead of that of A*Pc.
290  *
291  * perm_r (int*) dimension A->nrow
292  * Row permutation vector which defines the permutation matrix Pr,
293  * perm_r[i] = j means row i of A is in position j in Pr*A.
294  * If usepr = NO, perm_r is output argument;
295  * If usepr = YES, the pivoting routine will try to use the input
296  * perm_r, unless a certain threshold criterion is violated.
297  * In that case, perm_r is overwritten by a new_ permutation
298  * determined by partial pivoting or diagonal threshold pivoting.
299  *
300  * work (void*) of size lwork
301  * User-supplied work space and space for the output data structures.
302  * Not referenced if lwork = 0;
303  *
304  * lwork (int)
305  * Specifies the length of work array.
306  * = 0: allocate space internally by system malloc;
307  * > 0: use user-supplied work array of length lwork in bytes,
308  * returns error if space runs out.
309  * = -1: the routine guesses the amount of space needed without
310  * performing the factorization, and returns it in
311  * superlu_memusage->total_needed; no other side effects.
312  *
313  * etree (int*)
314  * Elimination tree of A'*A, dimension A->ncol.
315  * Note: etree is a vector of parent pointers for a forest whose
316  * vertices are the integers 0 to A->ncol-1; etree[root]==A->ncol.
317  * On input, the columns of A should be permutated so that the
318  * etree is in a certain postorder.
319  *
320  * colcnt_h (int*)
321  * Column colunts of the Householder matrix.
322  *
323  * part_super_h (int*)
324  * Partition of the supernodes in the Householder matrix.
325  * part_super_h[k] = size of the supernode beginning at column k;
326  * = 0, elsewhere.
327  *
328  *
329  */
330 typedef struct {
331  int nprocs;
332  fact_t fact;
333  trans_t trans;
334  yes_no_t refact;
335  int panel_size;
336  int relax;
337  double diag_pivot_thresh;
338  yes_no_t usepr;
339  double drop_tol;
340  /* The following arrays are persistent during repeated factorizations. */
341  int *perm_c;
342  int *perm_r;
343  void *work;
344  int lwork;
345  /* The following structural arrays are computed internally by
346  sp_colorder(), so the user does not provide them on input.
347  These 3 arrays are computed in the first factorization, and are
348  re-used in the subsequent factors of the matrices with the same
349  nonzero structure. */
350  int *etree;
351  int *colcnt_h;
352  int *part_super_h;
354 
355 
356 /*
357  * *********************************************************************
358  * The pxgstrf_shared_t structure contains the shared task queue and
359  * the synchronization variables to facilitate parallel factorization.
360  * It also contains the shared L and U data structures.
361  * *********************************************************************
362  */
363 typedef struct {
364  /* ----------------------------------------------------------------
365  * Global variables introduced in parallel code for synchronization.
366  */
367  volatile int tasks_remain; /* number of untaken panels */
368  int num_splits; /* number of panels split at the top */
369  queue_t taskq; /* size ncol - shared work queue */
370  mutex_t *lu_locks; /* 5 named mutual exclusive locks */
371  volatile int *spin_locks; /* size ncol - mark every busy column */
372  pan_status_t *pan_status; /* size ncol - panel status */
373  int *fb_cols; /* size ncol - mark farthest busy column */
374  /* ---------------------------------------------------------------- */
375  int *inv_perm_c;
376  int *inv_perm_r;
377  int *xprune;
378  int *ispruned;
379  SuperMatrix *A;
380  GlobalLU_t *Glu;
381  Gstat_t *Gstat;
382  int *info;
384 
385 /* Arguments passed to each thread. */
386 typedef struct {
387  int pnum; /* process number */
388  int info; /* error code returned from each thread */
389  pdgstrf_options_t *pdgstrf_options;
390  pxgstrf_shared_t *pxgstrf_shared; /* shared for LU factorization */
392 
393 /* The structure to record a relaxed supernode. */
394 typedef struct {
395  int fcol;
396  int size;
398 
399 /* Headers for 4 types of dynamatically managed memory */
400 typedef struct e_node {
401  int size; /* length of the memory that has been used */
402  void *mem; /* pointer to the new_ malloc'd store */
403 } ExpHeader;
404 
405 /* The structure to keep track of memory usage. */
406 typedef struct {
407  float for_lu;
408  float total_needed;
409  int expansions;
411 
412 
413 /* *******
414  Macros
415  *******/
416 
417 #define SUPER_REP(s) ( xsup_end[s]-1 )
418 #define SUPER_FSUPC(s) ( xsup[s] )
419 #define SINGLETON(s) ( (xsup_end[s] - xsup[s]) == 1 )
420 #define ISPRUNED(j) ( ispruned[j] )
421 #define STATE(j) ( pxgstrf_shared->pan_status[j].state )
422 #define DADPANEL(j) ( etree[j + pxgstrf_shared->pan_status[j].size-1] )
423 
424 #ifdef PROFILE
425 #define TIC(t) t = SuperLU_timer_()
426 #define TOC(t2, t1) t2 = SuperLU_timer_() - t1
427 #else
428 #define TIC(t)
429 #define TOC(t2, t1)
430 #endif
431 
432 
433 /* *********************
434  Function prototypes
435  *********************/
436 
437 #ifdef __cplusplus
438 extern "C" {
439 #endif
440 
441 
442 /* ----------------
443  Driver routines
444  ---------------*/
445 extern void
446 pdgssv(int, SuperMatrix *, int *, int *, SuperMatrix *, SuperMatrix *,
447  SuperMatrix *, int *);
448 extern void
449 pdgssvx(int, pdgstrf_options_t *, SuperMatrix *, int *, int *,
450  equed_t *, double *, double *, SuperMatrix *, SuperMatrix *,
451  SuperMatrix *, SuperMatrix *,
452  double *, double *, double *, double *, superlu_memusage_t *, int *);
453 
454 /* ---------------
455  Driver related
456  ---------------*/
457 extern void dgsequ (SuperMatrix *, double *, double *, double *,
458  double *, double *, int *);
459 extern void dlaqgs (SuperMatrix *, double *, double *, double,
460  double, double, equed_t *);
461 extern void dgscon (char *, SuperMatrix *, SuperMatrix *,
462  double, double *, int *);
463 extern double dPivotGrowth(int, SuperMatrix *, int *,
464  SuperMatrix *, SuperMatrix *);
465 extern void dgsrfs (trans_t, SuperMatrix *, SuperMatrix *, SuperMatrix *,
466  int *, int *, equed_t, double *, double *, SuperMatrix *,
467  SuperMatrix *, double *, double *, Gstat_t *, int *);
468 extern int sp_dtrsv (char *, char *, char *, SuperMatrix *, SuperMatrix *,
469  double *, int *);
470 extern int sp_dgemv (char *, double, SuperMatrix *, double *,
471  int, double, double *, int);
472 extern int sp_dgemm (char *, int, int, int, double, SuperMatrix *,
473  double *, int, double, double *, int);
474 
475 /* ----------------------
476  Factorization related
477  ----------------------*/
478 extern void pxgstrf_scheduler (const int, const int, const int *,
479  int *, int *, pxgstrf_shared_t *);
480 extern int ParallelInit (int, pxgstrf_relax_t *, pdgstrf_options_t *,
481  pxgstrf_shared_t *);
482 extern int ParallelFinalize ();
483 extern int queue_init (queue_t *, int);
484 extern int queue_destroy (queue_t *);
485 extern int EnqueueRelaxSnode (queue_t *, int, pxgstrf_relax_t *,
486  pxgstrf_shared_t *);
487 extern int EnqueueDomains(queue_t *, struct Branch *, pxgstrf_shared_t *);
488 extern int Enqueue (queue_t *, qitem_t);
489 extern int Dequeue (queue_t *, qitem_t *);
490 extern int NewNsuper (const int, mutex_t *, int *);
491 extern int lockon(int *);
492 extern void PartDomains(const int, const float, SuperMatrix *, int *, int *);
493 
494 extern void
495 dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *,
496  int *, int *, Stype_t, Dtype_t, Mtype_t);
497 void
498 dCreate_CompCol_Permuted(SuperMatrix *, int, int, int, double *, int *,
499  int *, int *, Stype_t, Dtype_t, Mtype_t);
500 extern void
501 dCopy_CompCol_Matrix(SuperMatrix *, SuperMatrix *);
502 extern void
503 dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int,
504  Stype_t, Dtype_t, Mtype_t);
505 extern void
506 dCreate_SuperNode_Matrix(SuperMatrix *, int, int, int, double *, int *, int *,
507  int *, int *, int *, Stype_t, Dtype_t, Mtype_t);
508 extern void
509 dCreate_SuperNode_Permuted(SuperMatrix *, int, int, int, double *,
510  int *, int *, int *, int *, int *, int *,
511  int *, int *, Stype_t, Dtype_t, Mtype_t);
512 extern void
513 dCopy_Dense_Matrix(int, int, double *, int, double *, int);
514 
515 extern void Destroy_SuperMatrix_Store(SuperMatrix *);
516 extern void Destroy_CompCol_Matrix(SuperMatrix *);
517 extern void Destroy_CompCol_Permuted(SuperMatrix *);
518 extern void Destroy_CompCol_NCP(SuperMatrix *);
519 extern void Destroy_SuperNode_Matrix(SuperMatrix *);
520 extern void Destroy_SuperNode_SCP(SuperMatrix *);
521 
522 extern void dallocateA (int, int, double **, int **, int **);
523 extern void StatAlloc (const int, const int, const int, const int, Gstat_t*);
524 extern void StatInit (const int, const int, Gstat_t*);
525 extern void StatFree (Gstat_t*);
526 extern void get_perm_c(int, SuperMatrix *, int *);
527 extern void sp_colorder (SuperMatrix *, int *, pdgstrf_options_t *,
528  SuperMatrix *);
529 extern int sp_coletree (int *, int *, int *, int, int, int *);
530 extern int PresetMap (const int, SuperMatrix *, pxgstrf_relax_t *,
532 extern int qrnzcnt (int, int, int *, int *, int *, int *, int *, int *,
533  int *, int *, int *, int *);
534 extern int DynamicSetMap(const int, const int, const int, pxgstrf_shared_t*);
535 extern void pdgstrf (pdgstrf_options_t *, SuperMatrix *, int *,
536  SuperMatrix *, SuperMatrix *, Gstat_t *, int *);
537 extern void pdgstrf_init (int, yes_no_t, int, int, double, yes_no_t, double,
538  int *, int *, void *, int, SuperMatrix *,
539  SuperMatrix *, pdgstrf_options_t *, Gstat_t *);
540 extern pdgstrf_threadarg_t*
541 pdgstrf_thread_init (SuperMatrix *, SuperMatrix *, SuperMatrix *,
543 extern void
544 pdgstrf_thread_finalize (pdgstrf_threadarg_t *, pxgstrf_shared_t *,
545  SuperMatrix *, int *, SuperMatrix *, SuperMatrix *);
546 extern void pdgstrf_finalize(pdgstrf_options_t *, SuperMatrix *);
547 extern void pxgstrf_relax_snode (const int, pdgstrf_options_t *,
548  pxgstrf_relax_t *);
549 extern int
550 pdgstrf_factor_snode (const int, const int, SuperMatrix *, const double,
551  yes_no_t *, int *, int *, int*, int*, int*, int*,
552  double *, double *, pxgstrf_shared_t *, int *);
553 extern void
554 pxgstrf_mark_busy_descends (int, int, int *, pxgstrf_shared_t *, int *, int *);
555 extern int pdgstrf_snode_dfs (const int, const int, const int, const int *,
556  const int *, const int *, int*, int *, int *,
557  pxgstrf_shared_t *);
558 extern int pdgstrf_snode_bmod (const int, const int, const int, const int,
559  double *, double *, GlobalLU_t*, Gstat_t*);
560 extern void pdgstrf_panel_dfs (const int, const int, const int, const int,
561  SuperMatrix *, int*, int*, int*, int*, int*,
562  int*, int*, int*, int*, int*, int*, int*, int*,
563  double*, GlobalLU_t *);
564 extern void pdgstrf_panel_bmod (const int, const int, const int, const int,
565  const int, int*, int*, int*, int*, int*, int*,
566  int*, int*, double*, double*,
567  pxgstrf_shared_t *);
568 extern void pdgstrf_bmod1D (const int, const int, const int, const int,
569  const int, const int, const int, int, int,
570  int *, int *, int *, int *, double *, double *,
571  GlobalLU_t *, Gstat_t *);
572 extern void pdgstrf_bmod2D (const int, const int, const int, const int,
573  const int, const int, const int, int, int,
574  int *, int *, int *, int *, double *, double *,
575  GlobalLU_t *, Gstat_t *);
576 extern void pdgstrf_bmod1D_mv2 (const int, const int, const int, const int,
577  const int, const int, const int, int, int,
578  int *, int *, int *, int *, double *,
579  double *, GlobalLU_t *, Gstat_t *);
580 extern void pdgstrf_bmod2D_mv2 (const int, const int, const int, const int,
581  const int, const int, const int, int, int,
582  int *, int *, int *, int *, double *, double *,
583  GlobalLU_t *, Gstat_t *);
584 extern void pxgstrf_super_bnd_dfs (const int, const int, const int,
585  const int, const int, SuperMatrix*,
586  int*, int*, int*, int *, int *, int *,
587  int *, pxgstrf_shared_t *);
588 extern int pdgstrf_column_dfs(const int, const int, const int, const int,
589  int*, int*, int*, int, int*, int*, int*, int*,
590  int *, int *, int *, int *, pxgstrf_shared_t *);
591 extern int pdgstrf_column_bmod(const int, const int, const int, const int,
592  int*, int*, double*, double*,
594 extern int pdgstrf_pivotL (const int, const int, const double, yes_no_t*,
595  int*, int*, int*, int*, GlobalLU_t*, Gstat_t*);
596 extern int pdgstrf_copy_to_ucol (const int, const int, const int, const int *,
597  const int *, const int *, double*,
599 extern void pxgstrf_pruneL (const int, const int *, const int, const int,
600  const int *, const int *, int*, int *,
601  GlobalLU_t *);
602 extern void pxgstrf_resetrep_col (const int, const int *, int *);
603 extern void countnz (const int, int*, int *, int *, GlobalLU_t *);
604 extern void fixupL (const int, const int *, GlobalLU_t *);
605 extern void compressSUP (const int, GlobalLU_t *);
606 extern int spcoletree (int *, int *, int *, int, int, int *);
607 extern int *TreePostorder (int, int *);
608 extern void dreadmt (int *, int *, int *, double **, int **, int **);
609 extern void dreadhb (int *, int *, int *, double **, int **, int **);
610 extern void dGenXtrue (int, int, double *, int);
611 extern void dFillRHS (trans_t, int, double *, int,
612  SuperMatrix *, SuperMatrix *);
613 extern void dgstrs (trans_t, SuperMatrix *, SuperMatrix*,
614  int*, int*, SuperMatrix*, Gstat_t *, int *);
615 
616 
617 /* ---------------
618  Memory related
619  ---------------*/
620 extern int pdgstrf_MemInit (int, int, pdgstrf_options_t *,
621  SuperMatrix *, SuperMatrix *, GlobalLU_t *);
622 extern int pdgstrf_memory_use(const int, const int, const int);
623 extern int pdgstrf_WorkInit (int, int, int **, double **);
624 extern void pxgstrf_SetIWork (int, int, int *, int **, int **, int **,
625  int **, int **, int **, int **);
626 extern void pdgstrf_SetRWork (int, int, double *, double **, double **);
627 extern void pdgstrf_WorkFree (int *, double *, GlobalLU_t *);
628 extern int pdgstrf_MemXpand (int, int, MemType, int *, GlobalLU_t *);
629 
630 extern int *intMalloc (int);
631 extern int *intCalloc (int);
632 extern double *doubleMalloc(int);
633 extern double *doubleCalloc(int);
634 extern int memory_usage ();
635 extern int superlu_QuerySpace (int, SuperMatrix *, SuperMatrix *, int,
637 extern int Glu_alloc (const int, const int, const int, const MemType,
638  int *, pxgstrf_shared_t *);
639 
640 /* -------------------
641  Auxiliary routines
642  -------------------*/
643 extern double SuperLU_timer_();
644 extern int sp_ienv(int);
645 extern double dlamch_();
646 extern int lsame_(char *, char *);
647 extern int xerbla_(char *, int *);
648 extern void superlu_abort_and_exit(char *);
649 extern void ifill(int *, int, int);
650 extern void dfill(double *, int, double);
651 extern void inf_norm_error(int, SuperMatrix *, double *);
652 extern void dstat_allocate(int);
653 extern void snode_profile(int, int *);
654 extern void super_stats(int, int *, int *);
655 extern void panel_stats(int, int, int *, Gstat_t *);
656 extern void PrintSumm(char *, int, int, int);
657 extern void PrintPerf(SuperMatrix *, SuperMatrix *, superlu_memusage_t *,
658  double, double, double *, double *, char *);
659 
660 /* -----------------------
661  Routines for debugging
662  -----------------------*/
663 extern void print_lu_col(int, char *, int, int, int, int *, GlobalLU_t *);
664 extern void print_panel_seg(int, int, int, int, int *, int *);
665 extern void dcheck_zero_vec(int, char *, int, double *);
666 extern void check_repfnz(int, int, int, int *);
667 
668 #ifdef __cplusplus
669  }
670 #endif
671 
672 
673 #endif /* __SUPERLU_dSP_DEFS */
674 
Definition: pdsp_defs.h:330
Definition: pdsp_defs.h:394
Definition: SuperLU_MT_util.h:189
Definition: pdsp_defs.h:406
Definition: pdsp_defs.h:400
Definition: SuperLU_MT_util.h:210
Definition: pdsp_defs.h:386
Definition: pdsp_defs.h:181
Definition: pdsp_defs.h:363