TBCI Numerical high perf. C++ Library 2.8.0
util.h
Go to the documentation of this file.
1
4
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 */
67typedef float flops_t;
68typedef 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 */
76typedef 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
92typedef 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
103extern "C" {
104#endif
105
106extern void PrintStat (SuperLUStat_t *);
107
108#ifdef __cplusplus
109 }
110#endif
111
112#endif /* __SUPERLU_UTIL */
double * utime
Definition util.h:94
int * panel_histo
Definition util.h:93
flops_t * ops
Definition util.h:95
unsigned char Logical
Definition util.h:68
float flops_t
Definition util.h:67
void PrintStat(SuperLUStat_t *)
PhaseType
Definition util.h:76
@ FACT
Definition util.h:81
@ NPHASES
Definition util.h:89
@ FERR
Definition util.h:88
@ ETREE
Definition util.h:79
@ RELAX
Definition util.h:78
@ RCOND
Definition util.h:82
@ FLOAT
Definition util.h:85
@ EQUIL
Definition util.h:80
@ GEMV
Definition util.h:87
@ SOLVE
Definition util.h:83
@ REFINE
Definition util.h:84
@ TRSV
Definition util.h:86
@ COLPERM
Definition util.h:77