Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
mrefine2.c
Go to the documentation of this file.
1 /*
2  * Copyright 1997, Regents of the University of Minnesota
3  *
4  * mrefine2.c
5  *
6  * This file contains the driving routines for multilevel refinement
7  *
8  * Started 7/24/97
9  * George
10  *
11  * $Id: mrefine2.c,v 1.1 1998/11/27 17:59:26 karypis Exp $
12  */
13 
14 #include <metis.h>
15 
16 
17 /*************************************************************************
18 * This function is the entry point of refinement
19 **************************************************************************/
20 void MocRefine2Way2(CtrlType *ctrl, GraphType *orggraph, GraphType *graph, float *tpwgts,
21  float *ubvec)
22 {
23 
25 
26  /* Compute the parameters of the coarsest graph */
27  MocCompute2WayPartitionParams(ctrl, graph);
28 
29  for (;;) {
30  ASSERT(CheckBnd(graph));
31 
32  IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->RefTmr));
33  switch (ctrl->RType) {
34  case RTYPE_FM:
35  MocBalance2Way2(ctrl, graph, tpwgts, ubvec);
36  MocFM_2WayEdgeRefine2(ctrl, graph, tpwgts, ubvec, 8);
37  break;
38  default:
39  errexit("Unknown refinement type: %d\n", ctrl->RType);
40  }
41  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->RefTmr));
42 
43  if (graph == orggraph)
44  break;
45 
46  graph = graph->finer;
47  IFSET(ctrl->dbglvl, DBG_TIME, starttimer(ctrl->ProjectTmr));
48  MocProject2WayPartition(ctrl, graph);
49  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->ProjectTmr));
50  }
51 
52  IFSET(ctrl->dbglvl, DBG_TIME, stoptimer(ctrl->UncoarsenTmr));
53 }
54 
55 
timer ProjectTmr
Definition: struct.h:230
timer RefTmr
Definition: struct.h:230
#define MocRefine2Way2
Definition: rename.h:275
#define MocProject2WayPartition
Definition: rename.h:271
#define stoptimer(tmr)
Definition: macros.h:54
struct graphdef * finer
Definition: struct.h:198
HitTile_Vector graph
#define MocFM_2WayEdgeRefine2
Definition: rename.h:190
#define IFSET(a, flag, cmd)
Definition: macros.h:61
int dbglvl
Definition: struct.h:216
#define MocCompute2WayPartitionParams
Definition: rename.h:270
#define RTYPE_FM
Definition: defs.h:113
#define CheckBnd
Definition: rename.h:44
#define MocBalance2Way2
Definition: rename.h:151
timer UncoarsenTmr
Definition: struct.h:230
#define errexit
Definition: rename.h:379
#define DBG_TIME
Definition: defs.h:154
int RType
Definition: struct.h:219
#define ASSERT(expr)
Definition: macros.h:130
#define starttimer(tmr)
Definition: macros.h:53