00001 /* 00002 * Copyright 1997, Regents of the University of Minnesota 00003 * 00004 * struct.h 00005 * 00006 * This file contains data structures for ILU routines. 00007 * 00008 * Started 9/26/95 00009 * George 00010 * 00011 * $Id: struct.h 13900 2013-03-24 15:27:07Z karypis $ 00012 */ 00013 00014 #ifndef _LIBMETIS_STRUCT_H_ 00015 #define _LIBMETIS_STRUCT_H_ 00016 00017 00018 00019 /*************************************************************************/ 00022 /*************************************************************************/ 00023 typedef struct cnbr_t { 00024 idx_t pid; 00025 idx_t ed; 00027 } cnbr_t; 00028 00029 00030 /*************************************************************************/ 00033 /*************************************************************************/ 00034 typedef struct ckrinfo_t { 00035 idx_t id; 00036 idx_t ed; 00037 idx_t nnbrs; 00038 idx_t inbr; 00040 } ckrinfo_t; 00041 00042 00043 /*************************************************************************/ 00046 /*************************************************************************/ 00047 typedef struct vnbr_t { 00048 idx_t pid; 00049 idx_t ned; 00051 idx_t gv; 00053 } vnbr_t; 00054 00055 00056 /*************************************************************************/ 00059 /*************************************************************************/ 00060 typedef struct vkrinfo_t { 00061 idx_t nid; 00062 idx_t ned; 00063 idx_t gv; 00064 idx_t nnbrs; 00065 idx_t inbr; 00067 } vkrinfo_t; 00068 00069 00070 /*************************************************************************/ 00073 /*************************************************************************/ 00074 typedef struct nrinfo_t { 00075 idx_t edegrees[2]; 00076 } nrinfo_t; 00077 00078 00079 /*************************************************************************/ 00081 /*************************************************************************/ 00082 typedef struct graph_t { 00083 idx_t nvtxs, nedges; /* The # of vertices and edges in the graph */ 00084 idx_t ncon; /* The # of constrains */ 00085 idx_t *xadj; /* Pointers to the locally stored vertices */ 00086 idx_t *vwgt; /* Vertex weights */ 00087 idx_t *vsize; /* Vertex sizes for min-volume formulation */ 00088 idx_t *adjncy; /* Array that stores the adjacency lists of nvtxs */ 00089 idx_t *adjwgt; /* Array that stores the weights of the adjacency lists */ 00090 00091 idx_t *tvwgt; /* The sum of the vertex weights in the graph */ 00092 real_t *invtvwgt; /* The inverse of the sum of the vertex weights in the graph */ 00093 00094 00095 /* These are to keep track control if the corresponding fields correspond to 00096 application or library memory */ 00097 int free_xadj, free_vwgt, free_vsize, free_adjncy, free_adjwgt; 00098 00099 idx_t *label; 00100 00101 idx_t *cmap; 00102 00103 /* Partition parameters */ 00104 idx_t mincut, minvol; 00105 idx_t *where, *pwgts; 00106 idx_t nbnd; 00107 idx_t *bndptr, *bndind; 00108 00109 /* Bisection refinement parameters */ 00110 idx_t *id, *ed; 00111 00112 /* K-way refinement parameters */ 00113 ckrinfo_t *ckrinfo; 00114 vkrinfo_t *vkrinfo; 00116 /* Node refinement information */ 00117 nrinfo_t *nrinfo; 00118 00119 struct graph_t *coarser, *finer; 00120 } graph_t; 00121 00122 00123 /*************************************************************************/ 00125 /*************************************************************************/ 00126 typedef struct mesh_t { 00127 idx_t ne, nn; 00128 idx_t ncon; 00130 idx_t *eptr, *eind; 00131 idx_t *ewgt; 00132 } mesh_t; 00133 00134 00135 00136 /*************************************************************************/ 00138 /*************************************************************************/ 00139 typedef struct ctrl_t { 00140 moptype_et optype; /* Type of operation */ 00141 mobjtype_et objtype; /* Type of refinement objective */ 00142 mdbglvl_et dbglvl; /* Controls the debuging output of the program */ 00143 mctype_et ctype; /* The type of coarsening */ 00144 miptype_et iptype; /* The type of initial partitioning */ 00145 mrtype_et rtype; /* The type of refinement */ 00146 00147 idx_t CoarsenTo; /* The # of vertices in the coarsest graph */ 00148 idx_t nIparts; /* The number of initial partitions to compute */ 00149 idx_t no2hop; /* Indicates if 2-hop matching will be used */ 00150 idx_t minconn; /* Indicates if the subdomain connectivity will be minimized */ 00151 idx_t contig; /* Indicates if contigous partitions are required */ 00152 idx_t nseps; /* The number of separators to be found during multiple bisections */ 00153 idx_t ufactor; /* The user-supplied load imbalance factor */ 00154 idx_t compress; /* If the graph will be compressed prior to ordering */ 00155 idx_t ccorder; /* If connected components will be ordered separately */ 00156 idx_t seed; /* The seed for the random number generator */ 00157 idx_t ncuts; /* The number of different partitionings to compute */ 00158 idx_t niter; /* The number of iterations during each refinement */ 00159 idx_t numflag; /* The user-supplied numflag for the graph */ 00160 idx_t *maxvwgt; /* The maximum allowed weight for a vertex */ 00161 00162 idx_t ncon; 00163 idx_t nparts; 00165 real_t pfactor; /* .1*(user-supplied prunning factor) */ 00166 00167 real_t *ubfactors; 00169 real_t *tpwgts; 00170 real_t *pijbm; 00173 real_t cfactor; 00175 /* Various Timers */ 00176 double TotalTmr, InitPartTmr, MatchTmr, ContractTmr, CoarsenTmr, UncoarsenTmr, 00177 RefTmr, ProjectTmr, SplitTmr, Aux1Tmr, Aux2Tmr, Aux3Tmr; 00178 00179 /* Workspace information */ 00180 gk_mcore_t *mcore; 00183 /* These are for use by the k-way refinement routines */ 00184 size_t nbrpoolsize; 00185 size_t nbrpoolcpos; 00186 size_t nbrpoolreallocs; 00188 cnbr_t *cnbrpool; 00191 vnbr_t *vnbrpool; 00195 /* The subdomain graph, in sparse format */ 00196 idx_t *maxnads; /* The maximum allocated number of adjacent domains */ 00197 idx_t *nads; /* The number of adjacent domains */ 00198 idx_t **adids; /* The IDs of the adjacent domains */ 00199 idx_t **adwgts; /* The edge-weight to the adjacent domains */ 00200 idx_t *pvec1, *pvec2; /* Auxiliar nparts-size vectors for efficiency */ 00201 00202 } ctrl_t; 00203 00204 00205 00206 #endif