SU2
struct.h
1 /*
2  * Copyright 1997, Regents of the University of Minnesota
3  *
4  * struct.h
5  *
6  * This file contains data structures for ILU routines.
7  *
8  * Started 9/26/95
9  * George
10  *
11  * $Id: struct.h 10592 2011-07-16 21:17:53Z karypis $
12  */
13 
14 
15 /*************************************************************************/
18 /*************************************************************************/
19 typedef struct cnbr_t {
20  idx_t pid;
21  idx_t ed;
23 } cnbr_t;
24 
25 
26 /*************************************************************************
27 * The following data structure stores key-key-value triplets
28 **************************************************************************/
29 typedef struct i2kv_t {
30  idx_t key1, key2;
31  idx_t val;
32 } i2kv_t;
33 
34 
35 /*************************************************************************
36 * The following data structure holds information on degrees for k-way
37 * partition
38 **************************************************************************/
39 typedef struct ckrinfo_t {
40  idx_t id;
41  idx_t ed;
42  idx_t nnbrs;
43  idx_t inbr;
45 } ckrinfo_t;
46 
47 
48 /*************************************************************************
49 * The following data structure holds information on degrees for k-way
50 * partition
51 **************************************************************************/
52 struct nrinfodef {
53  idx_t edegrees[2];
54 };
55 
56 typedef struct nrinfodef NRInfoType;
57 
58 
59 /*************************************************************************
60 * The following data structure stores a sparse matrix in CSR format
61 * The diagonal entry is in the first position of each row.
62 **************************************************************************/
63 typedef struct matrix_t {
64  idx_t nrows, nnzs; /* Number of rows and nonzeros in the matrix */
65  idx_t *rowptr;
66  idx_t *colind;
67  real_t *values;
68  real_t *transfer;
69 } matrix_t;
70 
71 
72 /*************************************************************************
73 * This data structure holds the input graph
74 **************************************************************************/
75 typedef struct graph_t {
76  idx_t gnvtxs, nvtxs, nedges, ncon, nobj;
77  idx_t *xadj; /* Pointers to the locally stored vertices */
78  idx_t *vwgt; /* Vertex weights */
79  real_t *nvwgt; /* Vertex weights */
80  idx_t *vsize; /* Vertex size */
81  idx_t *adjncy; /* Array that stores the adjacency lists of nvtxs */
82  idx_t *adjwgt; /* Array that stores the weights of the adjacency lists */
83  idx_t *vtxdist; /* Distribution of vertices */
84  idx_t *home; /* The initial partition of the vertex */
85 
86  /* used for not freeing application supplied arrays */
87  idx_t free_vwgt;
88  idx_t free_adjwgt;
89  idx_t free_vsize;
90 
91  /* Coarsening structures */
92  idx_t *match;
93  idx_t *cmap;
94 
95  /* Used during initial partitioning */
96  idx_t *label;
97 
98  /* Communication/Setup parameters */
99  idx_t nnbrs;
100  idx_t nrecv;
102  idx_t nsend;
107  idx_t *peind;
108  idx_t *sendptr, *sendind;
110  idx_t *recvptr, *recvind;
112  idx_t *imap;
113  idx_t *pexadj, *peadjncy,
114  *peadjloc;
118  idx_t nlocal;
119  idx_t *lperm;
122  /* Communication parameters for projecting the partition.
123  * These are computed during CreateCoarseGraph and used during projection
124  * Note that during projection, the meaning of received and sent is reversed! */
125  idx_t *rlens, *slens; /* Arrays of size nnbrs of how many vertices you are sending and receiving */
126  ikv_t *rcand;
127 
128 
129  /* Partition parameters */
130  idx_t *where;
131  idx_t *lpwgts, *gpwgts;
132  real_t *lnpwgts, *gnpwgts;
133  ckrinfo_t *ckrinfo;
134 
135  /* Node refinement information */
136  idx_t nsep; /* The number of vertices in the separator */
137  NRInfoType *nrinfo;
138  idx_t *sepind; /* The indices of the vertices in the separator */
139 
140  idx_t lmincut, mincut;
141 
142  idx_t level;
143  idx_t match_type;
144  idx_t edgewgt_type;
145 
146  struct graph_t *coarser, *finer;
147 } graph_t;
148 
149 
150 
151 /*************************************************************************
152 * The following data type implements a timer
153 **************************************************************************/
154 typedef double timer;
155 
156 
157 /*************************************************************************
158 * The following structure stores information used by parallel kmetis
159 **************************************************************************/
160 typedef struct ctrl_t {
161  pmoptype_et optype;
162  idx_t mype, npes; /* Info about the parallel system */
163  idx_t ncon;
164  idx_t CoarsenTo; /* The # of vertices in the coarsest graph */
165  idx_t dbglvl; /* Controls the debuging output of the program */
166  idx_t nparts; /* The number of partitions */
167  idx_t foldf; /* What is the folding factor */
168  idx_t mtype; /* The matching type */
169  idx_t ipart; /* The initial partitioning type */
170  idx_t rtype; /* The refinement type */
171  idx_t p_nseps; /* The number of separators to compute at each
172  parallel bisection */
173  idx_t s_nseps; /* The number of separators to compute at each
174  serial bisection */
175  real_t ubfrac; /* The max/avg fraction for separator bisections */
176  idx_t seed; /* Random number seed */
177  idx_t sync; /* Random number seed */
178  real_t *tpwgts; /* Target subdomain weights */
179  real_t *invtvwgts; /* Per-constraint 1/total vertex weight */
180  real_t *ubvec; /* Per-constraint unbalance factor */
181 
182  idx_t partType;
183  idx_t ps_relation;
184 
185  real_t redist_factor;
186  real_t redist_base;
187  real_t ipc_factor;
188  real_t edge_size_ratio;
189  matrix_t *matrix;
190 
191  idx_t free_comm;
192  MPI_Comm gcomm;
193  MPI_Comm comm;
194  idx_t ncommpes;
198  MPI_Request *sreq;
199  MPI_Request *rreq;
200  MPI_Status *statuses;
201  MPI_Status status;
202 
203  /* workspace variables */
204  gk_mcore_t *mcore; /* GKlib's mcore */
205 
206  /* These are for use by the k-way refinement routines */
207  size_t nbrpoolsize;
208  size_t nbrpoolcpos;
209  size_t nbrpoolreallocs;
211  cnbr_t *cnbrpool;
216  /* Various Timers */
217  timer TotalTmr, InitPartTmr, MatchTmr, ContractTmr, CoarsenTmr, RefTmr,
218  SetupTmr, ProjectTmr, KWayInitTmr, KWayTmr, MoveTmr, RemapTmr,
219  SerialTmr, AuxTmr1, AuxTmr2, AuxTmr3, AuxTmr4, AuxTmr5, AuxTmr6;
220 } ctrl_t;
221 
222 
223 
224 /*************************************************************************
225 * The following data structure stores a mesh.
226 **************************************************************************/
227 typedef struct mesh_t {
228  idx_t etype;
229  idx_t gnelms, gnns;
230  idx_t nelms, nns;
231  idx_t ncon;
232  idx_t esize, gminnode;
233  idx_t *elmdist;
234  idx_t *elements;
235  idx_t *elmwgt;
236 } mesh_t;
237 
Definition: struct.h:139
Definition: struct.h:29
idx_t * imap
Definition: struct.h:112
MPI_Comm gcomm
Definition: struct.h:192
Definition: struct.h:63
idx_t ncommpes
Definition: struct.h:194
idx_t nsend
Definition: struct.h:102
idx_t * sendind
Definition: struct.h:108
MPI_Comm comm
Definition: struct.h:193
idx_t nnbrs
Definition: struct.h:99
idx_t pid
Definition: struct.h:24
Definition: gk_struct.h:242
Definition: struct.h:52
idx_t nlocal
Definition: struct.h:118
MPI_Status * statuses
Definition: struct.h:200
idx_t * lperm
Definition: struct.h:119
idx_t * peadjloc
Definition: struct.h:113
idx_t * peind
Definition: struct.h:107
idx_t nrecv
Definition: struct.h:100
Definition: struct.h:34
Definition: struct.h:126
idx_t free_comm
Definition: struct.h:191
MPI_Request * sreq
Definition: struct.h:198
Definition: struct.h:82
idx_t ed
Definition: struct.h:25
Definition: struct.h:23
MPI_Request * rreq
Definition: struct.h:199
pmoptype_et optype
Definition: struct.h:161
idx_t * recvind
Definition: struct.h:110