File: proto.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 (352 lines) | stat: -rw-r--r-- 14,054 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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
/*
 * Copyright 1997, Regents of the University of Minnesota
 *
 * proto.h
 *
 * This file contains header files
 *
 * Started 10/19/95
 * George
 *
 * $Id: proto.h,v 1.11 2003/07/25 13:52:03 karypis Exp $
 *
 */

/* kmetis.c */
void Moc_Global_Partition(CtrlType *, GraphType *, WorkSpaceType *);

/* mmetis.c */

/* gkmetis.c */

/* match.c */
void Moc_GlobalMatch_Balance(CtrlType *, GraphType *, WorkSpaceType *);

/* coarsen.c */
void Moc_Global_CreateCoarseGraph(CtrlType *, GraphType *, WorkSpaceType *, int);

/* initpart.c */
void Moc_InitPartition_RB(CtrlType *, GraphType *, WorkSpaceType *);
void Moc_KeepPart(GraphType *, WorkSpaceType *, idxtype *, int);

/* kwayrefine.c */
void Moc_ProjectPartition(CtrlType *, GraphType *, WorkSpaceType *);
void Moc_ComputePartitionParams(CtrlType *, GraphType *, WorkSpaceType *);

/* kwayfm.c */
void Moc_KWayFM(CtrlType *, GraphType *, WorkSpaceType *, int);

/* kwaybalance.c */
void Moc_KWayBalance(CtrlType *, GraphType *, WorkSpaceType *, int);

/* remap.c */
void ParallelReMapGraph(CtrlType *, GraphType *, WorkSpaceType *);
void ParallelTotalVReMap(CtrlType *, idxtype *, idxtype *, WorkSpaceType *, int, int);
int SimilarTpwgts(float *, int, int, int);

/* move.c */
GraphType *Moc_MoveGraph(CtrlType *, GraphType *, WorkSpaceType *);
/* move.c */
void CheckMGraph(CtrlType *, GraphType *); 
void ProjectInfoBack(CtrlType *, GraphType *, idxtype *, idxtype *, WorkSpaceType *);
void FindVtxPerm(CtrlType *, GraphType *, idxtype *, WorkSpaceType *);

/* memory.c */
void PreAllocateMemory(CtrlType *, GraphType *, WorkSpaceType *);
void FreeWSpace(WorkSpaceType *);
void FreeCtrl(CtrlType *);
GraphType *CreateGraph(void);
void InitGraph(GraphType *);
void FreeGraph(GraphType *);
void FreeInitialGraphAndRemap(GraphType *, int);


/* ametis.c */
void Adaptive_Partition(CtrlType *, GraphType *, WorkSpaceType *);

/* rmetis.c */


/* lmatch.c */
void Mc_LocalMatch_HEM(CtrlType *, GraphType *, WorkSpaceType *);
void Mc_Local_CreateCoarseGraph(CtrlType *, GraphType *, WorkSpaceType *, int);

/* wave.c */
float WavefrontDiffusion(CtrlType *, GraphType *, idxtype *);

/* balancemylink.c */
int BalanceMyLink(CtrlType *, GraphType *, idxtype *, int, int, float *, float, float *, float *, float);

/* redomylink.c */
void RedoMyLink(CtrlType *, GraphType *, idxtype *, int, int, float *, float *, float *);

/* initbalance.c */
void Balance_Partition(CtrlType *, GraphType *, WorkSpaceType *);
GraphType *Moc_AssembleAdaptiveGraph(CtrlType *, GraphType *, WorkSpaceType *);

/* mdiffusion.c */
int Moc_Diffusion(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *, WorkSpaceType *, int);
GraphType *ExtractGraph(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *);

/* diffutil.c */
void SetUpConnectGraph(GraphType *, MatrixType *, idxtype *);
void Mc_ComputeMoveStatistics(CtrlType *, GraphType *, int *, int *, int *);
 int Mc_ComputeSerialTotalV(GraphType *, idxtype *);
void ComputeLoad(GraphType *, int, float *, float *, int);
void ConjGrad2(MatrixType *, float *, float *, float, float *);
void mvMult2(MatrixType *, float *, float *);
void ComputeTransferVector(int, MatrixType *, float *, float *, int);
int ComputeSerialEdgeCut(GraphType *);
int ComputeSerialTotalV(GraphType *, idxtype *);

/* akwayfm.c */
void Moc_KWayAdaptiveRefine(CtrlType *, GraphType *, WorkSpaceType *, int);

/* selectq.c */
void Moc_DynamicSelectQueue(int, int, int, int, idxtype *, float *, int *, int *, int, float, float);
int Moc_HashVwgts(int, float *);
int Moc_HashVRank(int, int *);


/* csrmatch.c */
void CSR_Match_SHEM(MatrixType *, idxtype *, idxtype *, idxtype *, int);

/* serial.c */
void Moc_SerialKWayAdaptRefine(GraphType *, int, idxtype *, float *, int);
void Moc_ComputeSerialPartitionParams(GraphType *, int, EdgeType *);
int AreAllHVwgtsBelow(int, float, float *, float, float *, float *);
void ComputeHKWayLoadImbalance(int, int, float *, float *);
void SerialRemap(GraphType *, int, idxtype *, idxtype *, idxtype *, float *);
int SSMIncKeyCmp(const void *, const void *);
void Moc_Serial_FM_2WayRefine(GraphType *, float *, int);
void Serial_SelectQueue(int, float *, float *, int *, int *, FPQueueType [MAXNCON][2]);
int Serial_BetterBalance(int, float *, float *, float *);
float Serial_Compute2WayHLoadImbalance(int, float *, float *);
void Moc_Serial_Balance2Way(GraphType *, float *, float);
void Moc_Serial_Init2WayBalance(GraphType *, float *);
int Serial_SelectQueueOneWay(int, float *, float *, int, FPQueueType [MAXNCON][2]);
void Moc_Serial_Compute2WayPartitionParams(GraphType *);
int Serial_AreAnyVwgtsBelow(int, float, float *, float, float *, float *);

/* weird.c */
void PartitionSmallGraph(CtrlType *, GraphType *, WorkSpaceType *);
void CheckInputs(int partType, int npes, int dbglvl, int *wgtflag, int *iwgtflag,
                 int *numflag, int *inumflag, int *ncon, int *incon, int *nparts, 
		 int *inparts, float *tpwgts, float **itpwgts, float *ubvec, 
		 float *iubvec, float *ipc2redist, float *iipc2redist, int *options, 
		 int *ioptions, idxtype *part, MPI_Comm *comm);

/* mesh.c */

/* ometis.c */

/* pspases.c */
GraphType *AssembleEntireGraph(CtrlType *, idxtype *, idxtype *, idxtype *);

/* node_refine.c */
void ComputeNodePartitionParams0(CtrlType *, GraphType *, WorkSpaceType *);
void ComputeNodePartitionParams(CtrlType *, GraphType *, WorkSpaceType *);
void KWayNodeRefine0(CtrlType *, GraphType *, WorkSpaceType *, int, float);
void KWayNodeRefine(CtrlType *, GraphType *, WorkSpaceType *, int, float);
void KWayNodeRefine2(CtrlType *, GraphType *, WorkSpaceType *, int, float);
void PrintNodeBalanceInfo(CtrlType *, int, idxtype *, idxtype *, idxtype *, int);

/* initmsection.c */
void InitMultisection(CtrlType *, GraphType *, WorkSpaceType *);
GraphType *AssembleMultisectedGraph(CtrlType *, GraphType *, WorkSpaceType *);

/* order.c */
void MultilevelOrder(CtrlType *, GraphType *, idxtype *, idxtype *, WorkSpaceType *);
void LabelSeparators(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *, idxtype *, WorkSpaceType *);
void CompactGraph(CtrlType *, GraphType *, idxtype *, WorkSpaceType *);
void LocalOrder(CtrlType *, GraphType *, idxtype *, int, WorkSpaceType *);
void LocalNDOrder(CtrlType *, GraphType *, idxtype *, int, WorkSpaceType *);
void Order_Partition(CtrlType *, GraphType *, WorkSpaceType *);

/* xyzpart.c */
void Coordinate_Partition(CtrlType *, GraphType *, int, float *, int, WorkSpaceType *);
void PartSort(CtrlType *, GraphType *, KeyValueType *, WorkSpaceType *);


/* fpqueue.c */
void FPQueueInit(FPQueueType *, int);
void FPQueueReset(FPQueueType *);
void FPQueueFree(FPQueueType *);
int FPQueueGetSize(FPQueueType *);
int FPQueueInsert(FPQueueType *, int, float);
int FPQueueDelete(FPQueueType *, int);
int FPQueueUpdate(FPQueueType *, int, float, float);
void FPQueueUpdateUp(FPQueueType *, int, float, float);
int FPQueueGetMax(FPQueueType *);
int FPQueueSeeMaxVtx(FPQueueType *);
float FPQueueSeeMaxGain(FPQueueType *);
float FPQueueGetKey(FPQueueType *);
int FPQueueGetQSize(FPQueueType *);
int CheckHeapFloat(FPQueueType *);

/* stat.c */
void Moc_ComputeSerialBalance(CtrlType *, GraphType *, idxtype *, float *);
void Moc_ComputeParallelBalance(CtrlType *, GraphType *, idxtype *, float *);
void Moc_PrintThrottleMatrix(CtrlType *, GraphType *, float *);
void Moc_ComputeRefineStats(CtrlType *, GraphType *, float *);

/* debug.c */
void PrintVector(CtrlType *, int, int, idxtype *, char *);
void PrintVector2(CtrlType *, int, int, idxtype *, char *);
void PrintPairs(CtrlType *, int, KeyValueType *, char *);
void PrintGraph(CtrlType *, GraphType *);
void PrintGraph2(CtrlType *, GraphType *);
void PrintSetUpInfo(CtrlType *ctrl, GraphType *graph);
void PrintTransferedGraphs(CtrlType *, int, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *);
void WriteMetisGraph(int, idxtype *, idxtype *, idxtype *, idxtype *);

/* comm.c */
void CommInterfaceData(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *);
void CommChangedInterfaceData(CtrlType *, GraphType *, int, idxtype *, idxtype *, KeyValueType *, KeyValueType *, idxtype *);
int GlobalSEMax(CtrlType *, int);
double GlobalSEMaxDouble(CtrlType *, double);
int GlobalSEMin(CtrlType *, int);
int GlobalSESum(CtrlType *, int);
float GlobalSEMaxFloat(CtrlType *, float);
float GlobalSEMinFloat(CtrlType *, float);
float GlobalSESumFloat(CtrlType *, float);

/* util.c */
void errexit(char *,...);
void myprintf(CtrlType *, char *f_str,...);
void rprintf(CtrlType *, char *f_str,...);
#ifndef DMALLOC
int *imalloc(int, char *);
idxtype *idxmalloc(int, char *);
float *fmalloc(int, char *);
int *ismalloc(int, int, char *);
idxtype *idxsmalloc(int, idxtype, char *);
void *GKmalloc(int, char *);
#endif
/*void GKfree(void **,...); */
int *iset(int n, int val, int *x);
idxtype * idxset(int n, idxtype val, idxtype *x);
int idxamax(int n, idxtype *x);
int idxamin(int n, idxtype *x);
int idxasum(int n, idxtype *x);
float snorm2(int, float *);
float sdot(int n, float *, float *);
void saxpy(int, float, float *, float *);
void ikeyvalsort_org(int, KeyValueType *);
int IncKeyValueCmp(const void *, const void *);
void dkeyvalsort(int, KeyValueType *);
int DecKeyValueCmp(const void *, const void *);
int BSearch(int, idxtype *, int);
void RandomPermute(int, idxtype *, int);
void FastRandomPermute(int, idxtype *, int);
int ispow2(int);
int log2Int(int);
void BucketSortKeysDec(int, int, idxtype *, idxtype *);
float *sset(int n, float val, float *x);
int iamax(int, int *);
int idxamax_strd(int, idxtype *, int);
int idxamin_strd(int, idxtype *, int);
int samax_strd(int, float *, int);
int sfamax(int, float *);
int samin_strd(int, float *, int);
float idxavg(int, idxtype *);
float savg(int, float *);
int samax(int, float *);
int sfavg(int n, float *x);
int samax2(int, float *);
int samin(int, float *);
int idxsum(int, idxtype *);
int idxsum_strd(int, idxtype *, int);
void idxadd(int, idxtype *, idxtype *);
float ssum(int, float *);
float ssum_strd(int, float *, int);
void sscale(int, float, float *);
void saneg(int, float *);
float BetterVBalance(int, float *, float *, float *);
int IsHBalanceBetterTT(int, float *, float *, float *, float *);
int IsHBalanceBetterFT(int, float *, float *, float *, float *);
int myvalkeycompare(const void *, const void *);
int imyvalkeycompare(const void *, const void *);
float *fsmalloc(int, float, char *);
void saxpy2(int, float, float *, int, float *, int);
void GetThreeMax(int, float *, int *, int *, int *);

/* qsort_special.c */
void iidxsort(int, idxtype *);
void iintsort(int, int *);
void ikeysort(int, KeyValueType *);
void ikeyvalsort(int, KeyValueType *);

/* grsetup.c */
GraphType *Moc_SetUpGraph(CtrlType *, int, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int *);
void SetUpCtrl(CtrlType *ctrl, int, int, MPI_Comm);
void ChangeNumbering(idxtype *, idxtype *, idxtype *, idxtype *, int, int, int);
void ChangeNumberingMesh(idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int, int, int, int);
void ChangeNumberingMesh2(idxtype *elmdist, idxtype *eptr, idxtype *eind,
                          idxtype *xadj, idxtype *adjncy, idxtype *part,
			  int npes, int mype, int from);
void GraphRandomPermute(GraphType *);
void ComputeMoveStatistics(CtrlType *, GraphType *, int *, int *, int *);

/* timer.c */
void InitTimers(CtrlType *);
void PrintTimingInfo(CtrlType *);
void PrintTimer(CtrlType *, timer, char *);

/* setup.c */
void SetUp(CtrlType *, GraphType *, WorkSpaceType *);
int Home_PE(int, int, idxtype *, int);


/*********************/
/* METIS subroutines */
/*********************/
void METIS_WPartGraphKway2(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
void METIS_mCPartGraphRecursive2(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
int MCMlevelRecursiveBisection2(CtrlType *, GraphType *, int, float *, idxtype *, float, int); 
void METIS_PartGraphKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
void METIS_mCPartGraphKway(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, float *, int *, int *, idxtype *);
void METIS_EdgeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *); 
void METIS_NodeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *); 
void METIS_NodeND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *);
void METIS_NodeNDP(int, idxtype *, idxtype *, int, int *, idxtype *, idxtype *, idxtype *);



/***********************/
/* TESTing subroutines */
/***********************/

/* pio.c */
void ParallelReadGraph(GraphType *, char *, MPI_Comm);
void Moc_ParallelWriteGraph(CtrlType *, GraphType *, char *, int, int);
void ReadTestGraph(GraphType *, char *, MPI_Comm);
float *ReadTestCoordinates(GraphType *, char *, int, MPI_Comm);
void ReadMetisGraph(char *, int *, idxtype **, idxtype **);
void Moc_SerialReadGraph(GraphType *, char *, int *, MPI_Comm);
void Moc_SerialReadMetisGraph(char *, int *, int *, int *, int *, idxtype **, idxtype **, idxtype **, idxtype **, int *);

/* adaptgraph */
void AdaptGraph(GraphType *, int, MPI_Comm);
void AdaptGraph2(GraphType *, int, MPI_Comm);
void Mc_AdaptGraph(GraphType *, idxtype *, int, int, MPI_Comm);

/* ptest.c */
void TestParMetis(char *, MPI_Comm);

/* NEW_ptest.c */
void TestParMetis_V3(char *, MPI_Comm);
int ComputeRealCut(idxtype *, idxtype *, char *, MPI_Comm);
int ComputeRealCut2(idxtype *, idxtype *, idxtype *, idxtype *, char *, MPI_Comm);
void TestMoveGraph(GraphType *, GraphType *, idxtype *, MPI_Comm);
GraphType *SetUpGraph(CtrlType *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int);

/* mienio.c */
void mienIO(MeshType *, char *, int, int, MPI_Comm);

/* meshio.c */
void ParallelReadMesh(MeshType *, char *, MPI_Comm);

/* parmetis.c */
void ChangeToFortranNumbering(idxtype *, idxtype *, idxtype *, int, int);