00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 void Moc_Global_Partition(CtrlType *, GraphType *, WorkSpaceType *);
00017
00018
00019
00020
00021
00022
00023 void Moc_GlobalMatch_Balance(CtrlType *, GraphType *, WorkSpaceType *);
00024
00025
00026 void Moc_Global_CreateCoarseGraph(CtrlType *, GraphType *, WorkSpaceType *, int);
00027
00028
00029 void Moc_InitPartition_RB(CtrlType *, GraphType *, WorkSpaceType *);
00030 void Moc_KeepPart(GraphType *, WorkSpaceType *, idxtype *, int);
00031
00032
00033 void Moc_ProjectPartition(CtrlType *, GraphType *, WorkSpaceType *);
00034 void Moc_ComputePartitionParams(CtrlType *, GraphType *, WorkSpaceType *);
00035
00036
00037 void Moc_KWayFM(CtrlType *, GraphType *, WorkSpaceType *, int);
00038
00039
00040 void Moc_KWayBalance(CtrlType *, GraphType *, WorkSpaceType *, int);
00041
00042
00043 void ParallelReMapGraph(CtrlType *, GraphType *, WorkSpaceType *);
00044 void ParallelTotalVReMap(CtrlType *, idxtype *, idxtype *, WorkSpaceType *, int, int);
00045 int SimilarTpwgts(floattype *, int, int, int);
00046
00047
00048 GraphType *Moc_MoveGraph(CtrlType *, GraphType *, WorkSpaceType *);
00049
00050 void CheckMGraph(CtrlType *, GraphType *);
00051 void ProjectInfoBack(CtrlType *, GraphType *, idxtype *, idxtype *, WorkSpaceType *);
00052 void FindVtxPerm(CtrlType *, GraphType *, idxtype *, WorkSpaceType *);
00053
00054
00055 void PreAllocateMemory(CtrlType *, GraphType *, WorkSpaceType *);
00056 void FreeWSpace(WorkSpaceType *);
00057 void FreeCtrl(CtrlType *);
00058 GraphType *CreateGraph(void);
00059 void InitGraph(GraphType *);
00060 void FreeGraph(GraphType *);
00061 void FreeInitialGraphAndRemap(GraphType *, int);
00062
00063
00064
00065 void Adaptive_Partition(CtrlType *, GraphType *, WorkSpaceType *);
00066
00067
00068
00069
00070
00071 void Mc_LocalMatch_HEM(CtrlType *, GraphType *, WorkSpaceType *);
00072 void Mc_Local_CreateCoarseGraph(CtrlType *, GraphType *, WorkSpaceType *, int);
00073
00074
00075 floattype WavefrontDiffusion(CtrlType *, GraphType *, idxtype *);
00076
00077
00078 int BalanceMyLink(CtrlType *, GraphType *, idxtype *, int, int, floattype *, floattype, floattype *, floattype *, floattype);
00079
00080
00081 void RedoMyLink(CtrlType *, GraphType *, idxtype *, int, int, floattype *, floattype *, floattype *);
00082
00083
00084 void Balance_Partition(CtrlType *, GraphType *, WorkSpaceType *);
00085 GraphType *Moc_AssembleAdaptiveGraph(CtrlType *, GraphType *, WorkSpaceType *);
00086
00087
00088 int Moc_Diffusion(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *, WorkSpaceType *, int);
00089 GraphType *ExtractGraph(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *);
00090
00091
00092 void SetUpConnectGraph(GraphType *, MatrixType *, idxtype *);
00093 void Mc_ComputeMoveStatistics(CtrlType *, GraphType *, int *, int *, int *);
00094 int Mc_ComputeSerialTotalV(GraphType *, idxtype *);
00095 void ComputeLoad(GraphType *, int, floattype *, floattype *, int);
00096 void ConjGrad2(MatrixType *, floattype *, floattype *, floattype, floattype *);
00097 void mvMult2(MatrixType *, floattype *, floattype *);
00098 void ComputeTransferVector(int, MatrixType *, floattype *, floattype *, int);
00099 int ComputeSerialEdgeCut(GraphType *);
00100 int ComputeSerialTotalV(GraphType *, idxtype *);
00101
00102
00103 void Moc_KWayAdaptiveRefine(CtrlType *, GraphType *, WorkSpaceType *, int);
00104
00105
00106 void Moc_DynamicSelectQueue(int, int, int, int, idxtype *, floattype *, int *, int *, int, floattype, floattype);
00107 int Moc_HashVwgts(int, floattype *);
00108 int Moc_HashVRank(int, int *);
00109
00110
00111
00112 void CSR_Match_SHEM(MatrixType *, idxtype *, idxtype *, idxtype *, int);
00113
00114
00115 void Moc_SerialKWayAdaptRefine(GraphType *, int, idxtype *, floattype *, int);
00116 void Moc_ComputeSerialPartitionParams(GraphType *, int, EdgeType *);
00117 int AreAllHVwgtsBelow(int, floattype, floattype *, floattype, floattype *, floattype *);
00118 void ComputeHKWayLoadImbalance(int, int, floattype *, floattype *);
00119 void SerialRemap(GraphType *, int, idxtype *, idxtype *, idxtype *, floattype *);
00120 int SSMIncKeyCmp(const void *, const void *);
00121 void Moc_Serial_FM_2WayRefine(GraphType *, floattype *, int);
00122 void Serial_SelectQueue(int, floattype *, floattype *, int *, int *, FPQueueType [MAXNCON][2]);
00123 int Serial_BetterBalance(int, floattype *, floattype *, floattype *);
00124 floattype Serial_Compute2WayHLoadImbalance(int, floattype *, floattype *);
00125 void Moc_Serial_Balance2Way(GraphType *, floattype *, floattype);
00126 void Moc_Serial_Init2WayBalance(GraphType *, floattype *);
00127 int Serial_SelectQueueOneWay(int, floattype *, floattype *, int, FPQueueType [MAXNCON][2]);
00128 void Moc_Serial_Compute2WayPartitionParams(GraphType *);
00129 int Serial_AreAnyVwgtsBelow(int, floattype, floattype *, floattype, floattype *, floattype *);
00130
00131
00132 void PartitionSmallGraph(CtrlType *, GraphType *, WorkSpaceType *);
00133 void CheckInputs(int partType, int npes, int dbglvl, int *wgtflag, int *iwgtflag,
00134 int *numflag, int *inumflag, int *ncon, int *incon, int *nparts,
00135 int *inparts, floattype *tpwgts, floattype **itpwgts, floattype *ubvec,
00136 floattype *iubvec, floattype *ipc2redist, floattype *iipc2redist, int *options,
00137 int *ioptions, idxtype *part, MPI_Comm *comm);
00138
00139
00140
00141
00142
00143
00144 GraphType *AssembleEntireGraph(CtrlType *, idxtype *, idxtype *, idxtype *);
00145
00146
00147 void ComputeNodePartitionParams0(CtrlType *, GraphType *, WorkSpaceType *);
00148 void ComputeNodePartitionParams(CtrlType *, GraphType *, WorkSpaceType *);
00149 void KWayNodeRefine0(CtrlType *, GraphType *, WorkSpaceType *, int, floattype);
00150 void KWayNodeRefine(CtrlType *, GraphType *, WorkSpaceType *, int, floattype);
00151 void KWayNodeRefine2(CtrlType *, GraphType *, WorkSpaceType *, int, floattype);
00152 void PrintNodeBalanceInfo(CtrlType *, int, idxtype *, idxtype *, idxtype *, int);
00153
00154
00155 void InitMultisection(CtrlType *, GraphType *, WorkSpaceType *);
00156 GraphType *AssembleMultisectedGraph(CtrlType *, GraphType *, WorkSpaceType *);
00157
00158
00159 void MultilevelOrder(CtrlType *, GraphType *, idxtype *, idxtype *, WorkSpaceType *);
00160 void LabelSeparators(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *, idxtype *, WorkSpaceType *);
00161 void CompactGraph(CtrlType *, GraphType *, idxtype *, WorkSpaceType *);
00162 void LocalOrder(CtrlType *, GraphType *, idxtype *, int, WorkSpaceType *);
00163 void LocalNDOrder(CtrlType *, GraphType *, idxtype *, int, WorkSpaceType *);
00164 void Order_Partition(CtrlType *, GraphType *, WorkSpaceType *);
00165
00166
00167 void Coordinate_Partition(CtrlType *, GraphType *, int, floattype *, int, WorkSpaceType *);
00168 void PartSort(CtrlType *, GraphType *, KeyValueType *, WorkSpaceType *);
00169
00170
00171
00172 void FPQueueInit(FPQueueType *, int);
00173 void FPQueueReset(FPQueueType *);
00174 void FPQueueFree(FPQueueType *);
00175 int FPQueueGetSize(FPQueueType *);
00176 int FPQueueInsert(FPQueueType *, int, floattype);
00177 int FPQueueDelete(FPQueueType *, int);
00178 int FPQueueUpdate(FPQueueType *, int, floattype, floattype);
00179 void FPQueueUpdateUp(FPQueueType *, int, floattype, floattype);
00180 int FPQueueGetMax(FPQueueType *);
00181 int FPQueueSeeMaxVtx(FPQueueType *);
00182 floattype FPQueueSeeMaxGain(FPQueueType *);
00183 floattype FPQueueGetKey(FPQueueType *);
00184 int FPQueueGetQSize(FPQueueType *);
00185 int CheckHeapFloat(FPQueueType *);
00186
00187
00188 void Moc_ComputeSerialBalance(CtrlType *, GraphType *, idxtype *, floattype *);
00189 void Moc_ComputeParallelBalance(CtrlType *, GraphType *, idxtype *, floattype *);
00190 void Moc_PrintThrottleMatrix(CtrlType *, GraphType *, floattype *);
00191 void Moc_ComputeRefineStats(CtrlType *, GraphType *, floattype *);
00192
00193
00194 void PrintVector(CtrlType *, int, int, idxtype *, char *);
00195 void PrintVector2(CtrlType *, int, int, idxtype *, char *);
00196 void PrintPairs(CtrlType *, int, KeyValueType *, char *);
00197 void PrintGraph(CtrlType *, GraphType *);
00198 void PrintGraph2(CtrlType *, GraphType *);
00199 void PrintSetUpInfo(CtrlType *ctrl, GraphType *graph);
00200 void PrintTransferedGraphs(CtrlType *, int, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *);
00201 void WriteMetisGraph(int, idxtype *, idxtype *, idxtype *, idxtype *);
00202
00203
00204 void CommInterfaceData(CtrlType *, GraphType *, idxtype *, idxtype *, idxtype *);
00205 void CommChangedInterfaceData(CtrlType *, GraphType *, int, idxtype *, idxtype *, KeyValueType *, KeyValueType *, idxtype *);
00206 int GlobalSEMax(CtrlType *, int);
00207 double GlobalSEMaxDouble(CtrlType *, double);
00208 int GlobalSEMin(CtrlType *, int);
00209 int GlobalSESum(CtrlType *, int);
00210 floattype GlobalSEMaxFloat(CtrlType *, floattype);
00211 floattype GlobalSEMinFloat(CtrlType *, floattype);
00212 floattype GlobalSESumFloat(CtrlType *, floattype);
00213
00214
00215 void errexit(char *,...);
00216 void myprintf(CtrlType *, char *f_str,...);
00217 void rprintf(CtrlType *, char *f_str,...);
00218 #ifndef DMALLOC
00219 int *imalloc(int, char *);
00220 idxtype *idxmalloc(int, char *);
00221 floattype *fmalloc(int, char *);
00222 int *ismalloc(int, int, char *);
00223 idxtype *idxsmalloc(int, idxtype, char *);
00224 void *GKmalloc(int, char *);
00225 #endif
00226
00227 int *iset(int n, int val, int *x);
00228 idxtype * idxset(int n, idxtype val, idxtype *x);
00229 int idxamax(int n, idxtype *x);
00230 int idxamin(int n, idxtype *x);
00231 int idxasum(int n, idxtype *x);
00232 floattype snorm2(int, floattype *);
00233 floattype sdot(int n, floattype *, floattype *);
00234 void saxpy(int, floattype, floattype *, floattype *);
00235 void ikeyvalsort_org(int, KeyValueType *);
00236 int IncKeyValueCmp(const void *, const void *);
00237 void dkeyvalsort(int, KeyValueType *);
00238 int DecKeyValueCmp(const void *, const void *);
00239 int BSearch(int, idxtype *, int);
00240 void RandomPermute(int, idxtype *, int);
00241 void FastRandomPermute(int, idxtype *, int);
00242 int ispow2(int);
00243 int log2Int(int);
00244 void BucketSortKeysDec(int, int, idxtype *, idxtype *);
00245 floattype *sset(int n, floattype val, floattype *x);
00246 int iamax(int, int *);
00247 int idxamax_strd(int, idxtype *, int);
00248 int idxamin_strd(int, idxtype *, int);
00249 int samax_strd(int, floattype *, int);
00250 int sfamax(int, floattype *);
00251 int samin_strd(int, floattype *, int);
00252 floattype idxavg(int, idxtype *);
00253 floattype savg(int, floattype *);
00254 int samax(int, floattype *);
00255 int sfavg(int n, floattype *x);
00256 int samax2(int, floattype *);
00257 int samin(int, floattype *);
00258 int idxsum(int, idxtype *);
00259 int idxsum_strd(int, idxtype *, int);
00260 void idxadd(int, idxtype *, idxtype *);
00261 floattype ssum(int, floattype *);
00262 floattype ssum_strd(int, floattype *, int);
00263 void sscale(int, floattype, floattype *);
00264 void saneg(int, floattype *);
00265 floattype BetterVBalance(int, floattype *, floattype *, floattype *);
00266 int IsHBalanceBetterTT(int, floattype *, floattype *, floattype *, floattype *);
00267 int IsHBalanceBetterFT(int, floattype *, floattype *, floattype *, floattype *);
00268 int myvalkeycompare(const void *, const void *);
00269 int imyvalkeycompare(const void *, const void *);
00270 floattype *fsmalloc(int, floattype, char *);
00271 void saxpy2(int, floattype, floattype *, int, floattype *, int);
00272 void GetThreeMax(int, floattype *, int *, int *, int *);
00273
00274
00275 void iidxsort(int, idxtype *);
00276 void iintsort(int, int *);
00277 void ikeysort(int, KeyValueType *);
00278 void ikeyvalsort(int, KeyValueType *);
00279
00280
00281 GraphType *Moc_SetUpGraph(CtrlType *, int, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int *);
00282 void SetUpCtrl(CtrlType *ctrl, int, int, MPI_Comm);
00283 void ChangeNumbering(idxtype *, idxtype *, idxtype *, idxtype *, int, int, int);
00284 void ChangeNumberingMesh(idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int, int, int, int);
00285 void ChangeNumberingMesh2(idxtype *elmdist, idxtype *eptr, idxtype *eind,
00286 idxtype *xadj, idxtype *adjncy, idxtype *part,
00287 int npes, int mype, int from);
00288 void GraphRandomPermute(GraphType *);
00289 void ComputeMoveStatistics(CtrlType *, GraphType *, int *, int *, int *);
00290
00291
00292 void InitTimers(CtrlType *);
00293 void PrintTimingInfo(CtrlType *);
00294 void PrintTimer(CtrlType *, timer, char *);
00295
00296
00297 void SetUp(CtrlType *, GraphType *, WorkSpaceType *);
00298 int Home_PE(int, int, idxtype *, int);
00299
00300
00301
00302
00303
00304 void METIS_WPartGraphKway2(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, floattype *, int *, int *, idxtype *);
00305 void METIS_mCPartGraphRecursive2(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, floattype *, int *, int *, idxtype *);
00306 int MCMlevelRecursiveBisection2(CtrlType *, GraphType *, int, floattype *, idxtype *, floattype, int);
00307 void METIS_PartGraphKway(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, int *, int *, idxtype *);
00308 void METIS_mCPartGraphKway(int *, int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, int *, floattype *, int *, int *, idxtype *);
00309 void METIS_EdgeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *);
00310 void METIS_NodeComputeSeparator(int *, idxtype *, idxtype *, idxtype *, idxtype *, int *, int *, idxtype *);
00311 void METIS_NodeND(int *, idxtype *, idxtype *, int *, int *, idxtype *, idxtype *);
00312 void METIS_NodeNDP(int, idxtype *, idxtype *, int, int *, idxtype *, idxtype *, idxtype *);
00313
00314
00315
00316
00317
00318
00319
00320
00321 void ParallelReadGraph(GraphType *, char *, MPI_Comm);
00322 void Moc_ParallelWriteGraph(CtrlType *, GraphType *, char *, int, int);
00323 void ReadTestGraph(GraphType *, char *, MPI_Comm);
00324 floattype *ReadTestCoordinates(GraphType *, char *, int, MPI_Comm);
00325 void ReadMetisGraph(char *, int *, idxtype **, idxtype **);
00326 void Moc_SerialReadGraph(GraphType *, char *, int *, MPI_Comm);
00327 void Moc_SerialReadMetisGraph(char *, int *, int *, int *, int *, idxtype **, idxtype **, idxtype **, idxtype **, int *);
00328
00329
00330 void AdaptGraph(GraphType *, int, MPI_Comm);
00331 void AdaptGraph2(GraphType *, int, MPI_Comm);
00332 void Mc_AdaptGraph(GraphType *, idxtype *, int, int, MPI_Comm);
00333
00334
00335 void TestParMetis(char *, MPI_Comm);
00336
00337
00338 void TestParMetis_V3(char *, MPI_Comm);
00339 int ComputeRealCut(idxtype *, idxtype *, char *, MPI_Comm);
00340 int ComputeRealCut2(idxtype *, idxtype *, idxtype *, idxtype *, char *, MPI_Comm);
00341 void TestMoveGraph(GraphType *, GraphType *, idxtype *, MPI_Comm);
00342 GraphType *SetUpGraph(CtrlType *, idxtype *, idxtype *, idxtype *, idxtype *, idxtype *, int);
00343
00344
00345 void mienIO(MeshType *, char *, int, int, MPI_Comm);
00346
00347
00348 void ParallelReadMesh(MeshType *, char *, MPI_Comm);
00349
00350
00351 void ChangeToFortranNumbering(idxtype *, idxtype *, idxtype *, int, int);
00352