1 /*****************************************************************************
2 /
3 / SPACE (SPArse Cholesky Elimination) Library: types.h
4 /
5 / author        J"urgen Schulze, University of Paderborn
6 / created       99sep14
7 /
8 / This file contains the fundamental data structures
9 /
10 ******************************************************************************/
11 
12 typedef double FLOAT;
13 typedef int    options_t;
14 typedef FLOAT  timings_t;
15 
16 /*****************************************************************************
17 Graph object
18 ******************************************************************************/
19 typedef struct _graph {
20   int   nvtx;
21   int   nedges;
22   int   type;
23   int   totvwght;
24   int   *xadj;
25   int   *adjncy;
26   int   *vwght;
27 } graph_t;
28 
29 /*****************************************************************************
30 Graph bisection object
31 ******************************************************************************/
32 typedef struct _gbisect {
33   graph_t *G;
34   int     *color;
35   int     cwght[3];
36 } gbisect_t;
37 
38 /*****************************************************************************
39 Domain decomposition object
40 ******************************************************************************/
41 typedef struct _domdec {
42   graph_t *G;
43   int     ndom;
44   int     domwght;
45   int     *vtype;
46   int     *color;
47   int     cwght[3];
48   int     *map;
49   struct _domdec *prev, *next;
50 } domdec_t;
51 
52 /*****************************************************************************
53 Bipartite graph object
54 ******************************************************************************/
55 typedef struct _gbipart {
56   graph_t *G;
57   int     nX;
58   int     nY;
59 } gbipart_t;
60 
61 /*****************************************************************************
62 Recursive nested dissection object
63 ******************************************************************************/
64 typedef struct _nestdiss {
65   graph_t *G;
66   int     *map;
67   int     depth;
68   int     nvint;
69   int     *intvertex;
70   int     *intcolor;
71   int     cwght[3];
72   struct _nestdiss *parent, *childB, *childW;
73 } nestdiss_t;
74 
75 /*****************************************************************************
76 Multisector object
77 ******************************************************************************/
78 typedef struct _multisector {
79   graph_t *G;
80   int     *stage;
81   int     nstages;
82   int     nnodes;
83   int     totmswght;
84 } multisector_t;
85 
86 /*****************************************************************************
87 Elimination graph object
88 ******************************************************************************/
89 typedef struct _gelim {
90   graph_t *G;
91   int     maxedges;
92   int     *len;
93   int     *elen;
94   int     *parent;
95   int     *degree;
96   int     *score;
97 } gelim_t;
98 
99 /*****************************************************************************
100 Bucket structure object
101 ******************************************************************************/
102 typedef struct _bucket {
103   int   maxbin, maxitem;
104   int   offset;
105   int   nobj;
106   int   minbin;
107   int   *bin;
108   int   *next;
109   int   *last;
110   int   *key;
111 } bucket_t;
112 
113 /*****************************************************************************
114 Minimum priority object
115 ******************************************************************************/
116 typedef struct _stageinfo stageinfo_t;
117 typedef struct _minprior {
118   gelim_t       *Gelim;
119   multisector_t *ms;
120   bucket_t      *bucket;
121   stageinfo_t   *stageinfo;
122   int           *reachset;
123   int           nreach;
124   int           *auxaux;
125   int           *auxbin;
126   int           *auxtmp;
127   int           flag;
128 } minprior_t;
129 struct _stageinfo {
130   int   nstep;
131   int   welim;
132   int   nzf;
133   FLOAT ops;
134 };
135 
136 /*****************************************************************************
137 Elimination tree object
138 ******************************************************************************/
139 typedef struct _elimtree {
140   int   nvtx;
141   int   nfronts;
142   int   root;
143   int   *ncolfactor;
144   int   *ncolupdate;
145   int   *parent;
146   int   *firstchild;
147   int   *silbings;
148   int   *vtx2front;
149 } elimtree_t;
150 
151 /*****************************************************************************
152 Input matrix object
153 ******************************************************************************/
154 typedef struct _inputMtx {
155   int   neqs;
156   int   nelem;
157   FLOAT *diag;
158   FLOAT *nza;
159   int   *xnza;
160   int   *nzasub;
161 } inputMtx_t;
162 
163 /*****************************************************************************
164 Dense matrix object
165 ******************************************************************************/
166 typedef struct _workspace workspace_t;
167 typedef struct _denseMtx {
168   workspace_t *ws;
169   int         front;
170   int         owned;
171   int         ncol;
172   int         nrow;
173   int         nelem;
174   int         nfloats;
175   int         *colind;
176   int         *rowind;
177   int         *collen;
178   FLOAT       *entries;
179   FLOAT       *mem;
180   struct _denseMtx *prevMtx, *nextMtx;
181 } denseMtx_t;
182 struct _workspace {
183   FLOAT      *mem;
184   int        size;
185   int        maxsize;
186   int        incr;
187   denseMtx_t *lastMtx;
188 };
189 
190 /*****************************************************************************
191 Compressed subscript structure object
192 ******************************************************************************/
193 typedef struct _css {
194   int   neqs;
195   int   nind;
196   int   owned;
197   int   *xnzl;
198   int   *nzlsub;
199   int   *xnzlsub;
200 } css_t;
201 
202 /*****************************************************************************
203 Front subscript object
204 ******************************************************************************/
205 typedef struct _frontsub {
206   elimtree_t *PTP;
207   int        nind;
208   int        *xnzf;
209   int        *nzfsub;
210 } frontsub_t;
211 
212 /*****************************************************************************
213 Factor matrix object
214 ******************************************************************************/
215 typedef struct _factorMtx {
216   int        nelem;
217   int        *perm;
218   FLOAT      *nzl;
219   css_t      *css;
220   frontsub_t *frontsub;
221 } factorMtx_t;
222 
223 /*****************************************************************************
224 Mapping object
225 ******************************************************************************/
226 typedef struct _groupinfo groupinfo_t;
227 typedef struct {
228   elimtree_t  *T;
229   int         dimQ;
230   int         maxgroup;
231   int         *front2group;
232   groupinfo_t *groupinfo;
233 } mapping_t;
234 struct _groupinfo {
235   FLOAT ops;
236   int   nprocs;
237   int   nfronts;
238 };
239 
240 /*****************************************************************************
241 Topology object
242 ******************************************************************************/
243 typedef struct {
244   int      nprocs;
245   int      mygridId;
246   int      dimX;
247   int      dimY;
248   int      myQId;
249   int      dimQ;
250   int      *cube2grid;
251 #ifdef PARIX
252   LinkCB_t **link;
253 #endif
254 #ifdef MPI
255   MPI_Comm   comm;
256   MPI_Status status;
257 #endif
258 } topology_t;
259 
260 /*****************************************************************************
261 Communication buffer object
262 ******************************************************************************/
263 typedef struct {
264   char   *data;
265   size_t len;
266   size_t maxlen;
267 } buffer_t;
268 
269 /*****************************************************************************
270 Bit mask object
271 ******************************************************************************/
272 typedef struct {
273   int   dimQ;
274   int   maxgroup;
275   int   mygroupId;
276   int   offset;
277   int   *group;
278   int   *colbits, *colmask;
279   int   *rowbits, *rowmask;
280 } mask_t;
281 
282