TBCI Numerical high perf. C++ Library  2.8.0
util.h
Go to the documentation of this file.
1 
5 /* $Id: util.h,v 1.3.2.4 2019/05/28 11:13:02 garloff Exp $ */
6 
7 #ifndef __SUPERLU_UTIL /* allow multiple inclusions */
8 #define __SUPERLU_UTIL
9 
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
13 #include <malloc.h>
14 #include <assert.h>
15 
16 /* Macros */
17 #ifndef USER_ABORT
18 #define USER_ABORT(msg) superlu_abort_and_exit(msg)
19 #endif
20 
21 #define ABORT(err_msg) \
22  { char msg[256];\
23  sprintf(msg,"%s at line %d in file %s\n",err_msg,__LINE__, __FILE__);\
24  USER_ABORT(msg); }
25 
26 
27 #ifndef USER_MALLOC
28 #define USER_MALLOC(size) superlu_malloc(size)
29 #endif
30 
31 #define SUPERLU_MALLOC(size) USER_MALLOC(size)
32 
33 #ifndef USER_FREE
34 #define USER_FREE(addr) superlu_free(addr)
35 #endif
36 
37 #define SUPERLU_FREE(addr) USER_FREE(addr)
38 
39 #ifdef HAVE_TBCICONFIG_H
40 # include "tbci/tbciconfig.h"
41 #else
42 # include "tbci/config_manual.h"
43 #endif
44 
45 #if defined (_SYSTYPE_SVR4) || defined(HAVE_MINMAX_IN_SYS_PARAM_H)
46 # include <sys/param.h>
47 #endif
48 
49 #ifndef MAX
50 # define MAX(x, y) ( (x) > (y) ? (x) : (y) )
51 #endif
52 #ifndef MIN
53 # define MIN(x, y) ( (x) < (y) ? (x) : (y) )
54 #endif
55 
56 /*
57  * Constants
58  */
59 #define EMPTY (-1)
60 #define NO (-1)
61 #define FALSE 0
62 #define TRUE 1
63 
64 /*
65  * Type definitions
66  */
67 typedef float flops_t;
68 typedef unsigned char Logical;
69 
70 /*
71  * The following enumerate type is used by the statistics variable
72  * SuperLUStat, to keep track of flop count and time spent at various stages.
73  *
74  * Note that not all of the fields are disjoint.
75  */
76 typedef enum {
77  COLPERM, /* find a column ordering that minimizes fills */
78  RELAX, /* find artificial supernodes */
79  ETREE, /* compute column etree */
80  EQUIL, /* equilibrate the original matrix */
81  FACT, /* perform LU factorization */
82  RCOND, /* estimate reciprocal condition number */
83  SOLVE, /* forward and back solves */
84  REFINE, /* perform iterative refinement */
85  FLOAT, /* time spent in floating-point operations */
86  TRSV, /* fraction of FACT spent in xTRSV */
87  GEMV, /* fraction of FACT spent in xGEMV */
88  FERR, /* estimate error bounds after iterative refinement */
89  NPHASES /* total number of phases */
90 } PhaseType;
91 
92 typedef struct {
93  int *panel_histo; /* histogram of panel size distribution */
94  double *utime; /* running time at various phases */
95  flops_t *ops; /* operation count at various phases */
97 
98 /* Macros */
99 #define FIRSTCOL_OF_SNODE(i) (xsup[i])
100 
101 
102 #ifdef __cplusplus
103 extern "C" {
104 #endif
105 
106 extern void PrintStat (SuperLUStat_t *);
107 
108 #ifdef __cplusplus
109  }
110 #endif
111 
112 #endif /* __SUPERLU_UTIL */
Definition: util.h:86
Definition: util.h:85
int * panel_histo
Definition: util.h:93
Definition: util.h:83
Definition: util.h:87
unsigned char Logical
Definition: util.h:68
Definition: util.h:80
float flops_t
Definition: util.h:67
Definition: util.h:81
Definition: util.h:77
PhaseType
Definition: util.h:76
Definition: util.h:89
Definition: util.h:79
void PrintStat(SuperLUStat_t *)
Definition: util.h:84
Definition: util.h:78
flops_t * ops
Definition: util.h:95
Definition: util.h:88
Definition: util.h:82
double * utime
Definition: util.h:94