File: struct.h

package info (click to toggle)
parmetis 3.1.1-4
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 25,620 kB
  • ctags: 2,290
  • sloc: ansic: 27,908; makefile: 220
file content (290 lines) | stat: -rw-r--r-- 9,174 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/*
 * Copyright 1997, Regents of the University of Minnesota
 *
 * struct.h
 *
 * This file contains data structures for ILU routines.
 *
 * Started 9/26/95
 * George
 *
 * $Id: struct.h,v 1.2 2003/07/21 17:50:22 karypis Exp $
 */

/* Indexes are as long as integers for now */
#ifdef IDXTYPE_INT
#define IDX_DATATYPE	MPI_INT
#define MAX_INT		INT_MAX
#define MIN_INT		INT_MIN
#else
#define IDX_DATATYPE	MPI_SHORT
#define MAX_INT		SHRT_MAX
#define MIN_INT		SHRT_MIN
#endif


/*************************************************************************
* The following data structure stores key-value pair
**************************************************************************/
struct KeyValueType {
  idxtype key;
  idxtype val;
};

typedef struct KeyValueType KeyValueType;

/*************************************************************************
* The following data structure stores key-value pair
**************************************************************************/
struct KVType {
  int key;
  float val;
};

typedef struct KVType KVType;


/*************************************************************************
* The following data structure stores key-value pair
**************************************************************************/
struct FKeyValueType {
  float key;
  idxtype val;
};

typedef struct FKeyValueType FKeyValueType;

/*************************************************************************
* The following data structure stores key-key-value triplets
**************************************************************************/
struct KeyKeyValueType {
  idxtype key1, key2;
  idxtype val;
};

typedef struct KeyKeyValueType KeyKeyValueType;

/*************************************************************************
* The following data structure is used to store the buckets for the 
* refinment algorithms
**************************************************************************/
struct PQueueType {
  int nnodes;
  int maxnnodes;
  idxtype *perm, *iperm, *values;  
  /* iperm[i] stores where the ith entry is located
     perm[i] stores the entry that is located in the ith position */
};

typedef struct PQueueType PQueueType;


/*************************************************************************
* The following data structure is used to store the buckets for the
* refinment algorithms
**************************************************************************/
struct FPQueueType {
  int type;                     /* The type of the representation used */
  int nnodes;
  int maxnodes;

  /* Heap version of the data structure */
  FKeyValueType *heap;
  idxtype *locator;
};

typedef struct FPQueueType FPQueueType;

/*************************************************************************
* The following data structure stores an edge
**************************************************************************/
struct edgedef {
  idxtype edge;
  idxtype ewgt;
};
typedef struct edgedef EdgeType;


/*************************************************************************
* This data structure holds various working space data
**************************************************************************/
struct workspacedef {
  idxtype *core;			/* Where pairs, indices, and degrees are coming from */
  int maxcore;

  int nlarge;				/* The size of 'Large' */

  KeyValueType *pairs;			/* Large pair array used during setup */
  idxtype *indices;			/* Large array of indxtype used for various purposes */

  /* Auxiliary parameters */
  idxtype *pv1, *pv2, *pv3, *pv4;	/* Vectors of npes+1 size used in various places */
  KeyValueType *pepairs1, *pepairs2;

  EdgeType *degrees;
};

typedef struct workspacedef WorkSpaceType;


/*************************************************************************
* The following data structure holds information on degrees for k-way
* partition
**************************************************************************/
struct rinfodef {
 int id, ed;            /* ID/ED of edges */
 int ndegrees;          /* The number of different ext-degrees */
 EdgeType *degrees;     /* List of edges */
};

typedef struct rinfodef RInfoType;


/*************************************************************************
* The following data structure holds information on degrees for k-way
* partition
**************************************************************************/
struct nrinfodef {
 int edegrees[2];  
};

typedef struct nrinfodef NRInfoType;


/*************************************************************************
* The following data structure stores a sparse matrix in CSR format
* The diagonal entry is in the first position of each row.
**************************************************************************/
struct matrixdef {
  int nrows, nnzs;		/* Number of rows and nonzeros in the matrix */
  idxtype *rowptr;
  idxtype *colind;
  float *values;
  float *transfer;
};

typedef struct matrixdef MatrixType;


/*************************************************************************
* This data structure holds the input graph
**************************************************************************/
struct graphdef {
  int gnvtxs, nvtxs, nedges, ncon, nobj;
  idxtype *xadj;		/* Pointers to the locally stored vertices */
  idxtype *vwgt;		/* Vertex weights */
  float *nvwgt;		/* Vertex weights */
  idxtype *vsize;		/* Vertex size */
  idxtype *adjncy;		/* Array that stores the adjacency lists of nvtxs */
  idxtype *adjwgt;		/* Array that stores the weights of the adjacency lists */
  idxtype *vtxdist;		/* Distribution of vertices */

  idxtype *match;
  idxtype *cmap;

  idxtype *label;

  /* Communication/Setup parameters */
  int nnbrs, nrecv, nsend;		/* The number of neighboring processors */
  idxtype *peind;			/* Array of size nnbrs storing the neighboring PEs */
  idxtype *sendptr, *sendind;		/* CSR format of the vertices that are sent */
  idxtype *recvptr, *recvind;		/* CSR format of the vertices that are received */
  idxtype *imap;			/* The inverse map of local to global indices */
  idxtype *pexadj, *peadjncy, 
          *peadjloc;			/* CSR format of the PEs each vertex is adjancent to */

  int nlocal;			/* Number of interior vertices */
  idxtype *lperm;		/* lperm[0:nlocal] points to interior vertices, the rest are interface */

  /* Communication parameters for projecting the partition. 
   * These are computed during CreateCoarseGraph and used during projection 
   * Note that during projection, the meaning of received and sent is reversed! */
  idxtype *rlens, *slens;	/* Arrays of size nnbrs of how many vertices you are sending and receiving */
  KeyValueType *rcand;


  /* Partition parameters */
  idxtype *where, *home;
  idxtype *lpwgts, *gpwgts;
  float *lnpwgts, *gnpwgts;
  RInfoType *rinfo;

  /* Node refinement information */
  NRInfoType *nrinfo;
  int nsep;  			/* The number of vertices in the separator */
  idxtype *sepind;		/* The indices of the vertices in the separator */

  int lmincut, mincut;

  int level;
  int match_type;
  int edgewgt_type;

  struct graphdef *coarser, *finer;
};

typedef struct graphdef GraphType;


/*************************************************************************
* The following data type implements a timer
**************************************************************************/
typedef double timer;


/*************************************************************************
* The following structure stores information used by parallel kmetis
**************************************************************************/
struct controldef {
  int mype, npes;		/* Info about the parallel system */
  int CoarsenTo;		/* The # of vertices in the coarsest graph */
  int dbglvl;			/* Controls the debuging output of the program */
  int nparts;			/* The number of partitions */
  int foldf;			/* What is the folding factor */
  int ipart;			/* The type of initial partitioning */
  int xyztype;			/* The type of coordinate indexing */
  int seed;			/* Random number seed */
  int sync;			/* Random number seed */
  float *tpwgts;		/* Target subdomain weights */
  int tvwgts[MAXNCON];
  float ubvec[MAXNCON];
  int partType;
  int ps_relation;

  float redist_factor, redist_base, ipc_factor;
  float edge_size_ratio;
  MatrixType *matrix;

  MPI_Comm gcomm;
  MPI_Comm comm;		/* MPI Communicator */
  MPI_Request sreq[MAX_PES], 
              rreq[MAX_PES];    /* MPI send and receive requests */
  MPI_Status statuses[MAX_PES];
  MPI_Status status;

  /* Various Timers */
  timer TotalTmr, InitPartTmr, MatchTmr, ContractTmr, CoarsenTmr, RefTmr,
        SetupTmr, ColorTmr, ProjectTmr, KWayInitTmr, KWayTmr, MoveTmr,
        RemapTmr, AuxTmr1, AuxTmr2, AuxTmr3, AuxTmr4, AuxTmr5, AuxTmr6;
};

typedef struct controldef CtrlType;



/*************************************************************************
* The following data structure stores a mesh.
**************************************************************************/
struct meshdef {
  int etype;
  int gnelms, gnns;
  int nelms, nns;
  int ncon;
  int esize, gminnode;
  idxtype *elmdist;
  idxtype *elements;
  idxtype *elmwgt;
};

typedef struct meshdef MeshType;