23 int sigrval=0, renumber=0;
51 graph =
SetupGraph(ctrl, *nvtxs, *ncon, xadj, adjncy, vwgt, vsize, adjwgt);
62 gk_errexit(
SIGERR,
"METIS Error: A contiguous partition is requested for a non-contiguous input graph.\n");
106 real_t curbal=0.0, bestbal=0.0;
111 for (i=0; i<ctrl->
ncuts; i++) {
129 printf(
"Initial %"PRIDX"-way partitioning cut: %"PRIDX"\n", ctrl->
nparts, objval));
149 || (curbal <= 0.0005 && bestobj > curobj)
150 || (bestbal > 0.0005 && curbal < bestbal)) {
185 ubvec =
rmalloc(graph->
ncon,
"InitKWayPartitioning: ubvec");
186 for (i=0; i<graph->
ncon; i++)
197 options, &curobj, graph->
where);
206 bestwhere =
imalloc(graph->
nvtxs,
"InitKWayPartitioning: bestwhere");
210 for (i=0; i<ntrials; i++) {
214 options, &curobj, graph->
where);
220 if (i == 0 || bestobj > curobj) {
229 if (bestobj != curobj)
idx_t idx_t idx_t idx_t * vwgt
void InitKWayPartitioning(ctrl_t *ctrl, graph_t *graph)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t idx_t idx_t idx_t * part
#define gk_startcputimer(tmr)
#define ComputeLoadImbalanceDiff
#define SetupKWayBalMultipliers
#define gk_stopcputimer(tmr)
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
#define AllocateKWayPartitionMemory
void gk_errexit(int signum, char *f_str,...)
NonlinearFactorGraph graph
EIGEN_DEVICE_FUNC const LogReturnType log() const
int METIS_SetDefaultOptions(idx_t *options)
idx_t idx_t idx_t idx_t idx_t * vsize
#define AllocateRefinementWorkSpace
#define AllocateWorkSpace
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t * objval
#define Change2CNumbering
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t real_t * ubvec
void gk_malloc_cleanup(int showstats)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
idx_t idx_t idx_t idx_t idx_t idx_t * adjwgt
void gk_free(void **ptr1,...)
int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
idx_t idx_t idx_t * adjncy
int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
Recursive partitioning routine.
#define IFSET(a, flag, cmd)
idx_t MlevelKWayPartitioning(ctrl_t *ctrl, graph_t *graph, idx_t *part)
#define Change2FNumbering