00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <metis.h>
00015
00016
00017
00018
00019
00020 void MocRefine2Way2(CtrlType *ctrl, GraphType *orggraph, GraphType *graph, floattype *tpwgts,
00021 floattype *ubvec)
00022 {
00023
00024 IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->UncoarsenTmr));
00025
00026
00027 MocCompute2WayPartitionParams(ctrl, graph);
00028
00029 for (;;) {
00030 ASSERT(CheckBnd(graph));
00031
00032 IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->RefTmr));
00033 switch (ctrl->RType) {
00034 case RTYPE_FM:
00035 MocBalance2Way2(ctrl, graph, tpwgts, ubvec);
00036 MocFM_2WayEdgeRefine2(ctrl, graph, tpwgts, ubvec, 8);
00037 break;
00038 default:
00039 errexit("Unknown refinement type: %d\n", ctrl->RType);
00040 }
00041 IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->RefTmr));
00042
00043 if (graph == orggraph)
00044 break;
00045
00046 graph = graph->finer;
00047 IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->ProjectTmr));
00048 MocProject2WayPartition(ctrl, graph);
00049 IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->ProjectTmr));
00050 }
00051
00052 IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->UncoarsenTmr));
00053 }
00054
00055