Go to the documentation of this file.
25 memset((
void *)ctrl, 0,
sizeof(
ctrl_t));
42 ctrl->CoarsenTo = 100;
71 ctrl->CoarsenTo = 100;
86 ctrl->optype = optype;
107 ctrl->tpwgts =
rsmalloc(2, .5,
"SetupCtrl: ctrl->tpwgts");
112 ctrl->ubfactors =
rsmalloc(ctrl->ncon,
I2RUBFACTOR(ctrl->ufactor),
"SetupCtrl: ubfactors");
115 for (
i=0;
i<ctrl->ncon;
i++)
116 ctrl->ubfactors[
i] += 0.0000499;
158 for (
i=0;
i<2;
i++) {
172 printf(
" Runtime parameters:\n");
174 printf(
" Objective type: ");
177 printf(
"METIS_OBJTYPE_CUT\n");
180 printf(
"METIS_OBJTYPE_VOL\n");
183 printf(
"METIS_OBJTYPE_NODE\n");
186 printf(
"Unknown!\n");
189 printf(
" Coarsening type: ");
190 switch (ctrl->
ctype) {
192 printf(
"METIS_CTYPE_RM\n");
195 printf(
"METIS_CTYPE_SHEM\n");
198 printf(
"Unknown!\n");
201 printf(
" Initial partitioning type: ");
204 printf(
"METIS_IPTYPE_GROW\n");
207 printf(
"METIS_IPTYPE_RANDOM\n");
210 printf(
"METIS_IPTYPE_EDGE\n");
213 printf(
"METIS_IPTYPE_NODE\n");
216 printf(
"METIS_IPTYPE_METISRB\n");
219 printf(
"Unknown!\n");
222 printf(
" Refinement type: ");
223 switch (ctrl->
rtype) {
225 printf(
"METIS_RTYPE_FM\n");
228 printf(
"METIS_RTYPE_GREEDY\n");
231 printf(
"METIS_RTYPE_SEP2SIDED\n");
234 printf(
"METIS_RTYPE_SEP1SIDED\n");
237 printf(
"Unknown!\n");
240 printf(
" Perform a 2-hop matching: %s\n", (ctrl->
no2hop ?
"Yes" :
"No"));
242 printf(
" Number of balancing constraints: %"PRIDX"\n", ctrl->
ncon);
243 printf(
" Number of refinement iterations: %"PRIDX"\n", ctrl->
niter);
244 printf(
" Random number seed: %"PRIDX"\n", ctrl->
seed);
247 printf(
" Number of separators: %"PRIDX"\n", ctrl->
nseps);
248 printf(
" Compress graph prior to ordering: %s\n", (ctrl->
compress ?
"Yes" :
"No"));
249 printf(
" Detect & order connected components separately: %s\n", (ctrl->
ccorder ?
"Yes" :
"No"));
250 printf(
" Prunning factor for high degree vertices: %"PRREAL"\n", ctrl->
pfactor);
253 printf(
" Number of partitions: %"PRIDX"\n", ctrl->
nparts);
254 printf(
" Number of cuts: %"PRIDX"\n", ctrl->
ncuts);
255 printf(
" User-supplied ufactor: %"PRIDX"\n", ctrl->
ufactor);
258 printf(
" Minimize connectivity: %s\n", (ctrl->
minconn ?
"Yes" :
"No"));
259 printf(
" Create contigous partitions: %s\n", (ctrl->
contig ?
"Yes" :
"No"));
262 modnum = (ctrl->
ncon==1 ? 5 : (ctrl->
ncon==2 ? 3 : (ctrl->
ncon==3 ? 2 : 1)));
263 printf(
" Target partition weights: ");
269 printf(
"%s%.2e", (
j==0 ?
"" :
" "), (
double)ctrl->
tpwgts[
i*ctrl->
ncon+
j]);
275 printf(
" Allowed maximum load imbalance: ");
304 IFSET(dbglvl,
METIS_DBG_INFO, printf(
"Input Error: Incorrect initial partitioning scheme.\n"));
311 if (ctrl->
ncuts <= 0) {
315 if (ctrl->
niter <= 0) {
331 if (ctrl->
ncon <= 0) {
338 if (sum < 0.99 || sum > 1.01) {
340 printf(
"Input Error: Incorrect sum of %"PRREAL" for tpwgts for constraint %"PRIDX".\n", sum,
i));
348 printf(
"Input Error: Incorrect tpwgts for partition %"PRIDX" and constraint %"PRIDX".\n",
j,
i));
357 printf(
"Input Error: Incorrect ubfactor for constraint %"PRIDX".\n",
i));
374 IFSET(dbglvl,
METIS_DBG_INFO, printf(
"Input Error: Incorrect initial partitioning scheme.\n"));
381 if (ctrl->
ncuts <= 0) {
385 if (ctrl->
niter <= 0) {
401 if (ctrl->
ncon <= 0) {
416 if (sum < 0.99 || sum > 1.01) {
418 printf(
"Input Error: Incorrect sum of %"PRREAL" for tpwgts for constraint %"PRIDX".\n", sum,
i));
426 printf(
"Input Error: Incorrect tpwgts for partition %"PRIDX" and constraint %"PRIDX".\n",
j,
i));
435 printf(
"Input Error: Incorrect ubfactor for constraint %"PRIDX".\n",
i));
454 IFSET(dbglvl,
METIS_DBG_INFO, printf(
"Input Error: Incorrect initial partitioning scheme.\n"));
461 if (ctrl->
nseps <= 0) {
465 if (ctrl->
niter <= 0) {
481 if (ctrl->
ncon != 1) {
501 printf(
"Input Error: Incorrect ubfactor for constraint %"PRIDX".\n",
i));
#define I2RUBFACTOR(ufactor)
ctrl_t * SetupCtrl(moptype_et optype, idx_t *options, idx_t ncon, idx_t nparts, real_t *tpwgts, real_t *ubvec)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t * ubvec
void gk_free(void **ptr1,...)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
#define KMETIS_DEFAULT_UFACTOR
#define IFSET(a, flag, cmd)
void SetupKWayBalMultipliers(ctrl_t *ctrl, graph_t *graph)
#define GETOPTION(options, idx, defval)
#define OMETIS_DEFAULT_UFACTOR
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
int CheckParams(ctrl_t *ctrl)
void Setup2WayBalMultipliers(ctrl_t *ctrl, graph_t *graph, real_t *tpwgts)
void PrintCtrl(ctrl_t *ctrl)
#define PMETIS_DEFAULT_UFACTOR
void FreeCtrl(ctrl_t **r_ctrl)
NonlinearFactorGraph graph
void * gk_malloc(size_t nbytes, char *msg)
void gk_errexit(int signum, char *f_str,...)
#define MCPMETIS_DEFAULT_UFACTOR
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:13