mt-Metis
ctrl.h
Go to the documentation of this file.
1 
13 #ifndef MTMETIS_CTRL_H
14 #define MTMETIS_CTRL_H
15 
16 
17 
18 
19 #include "base.h"
20 
21 
22 
23 
24 /******************************************************************************
25 * TYPES ***********************************************************************
26 ******************************************************************************/
27 
28 
29 typedef struct timers_type {
30  dl_timer_t total;
31  dl_timer_t io;
32  dl_timer_t preprocess;
33  dl_timer_t postprocess;
34  dl_timer_t metis;
35  dl_timer_t ordering;
36  dl_timer_t partitioning;
37  dl_timer_t coarsening;
38  dl_timer_t matching;
39  dl_timer_t contraction;
40  dl_timer_t initpart;
41  dl_timer_t uncoarsening;
42  dl_timer_t projection;
43  dl_timer_t refinement;
44  dl_timer_t recursion;
45 } timers_type;
46 
47 
48 typedef struct ctrl_type {
49  /* runtime parameters */
50  unsigned int seed;
51  tid_type nthreads;
52  int verbosity;
53  int time;
54  int runstats;
55  int dist;
56  timers_type timers;
57  wgt_type * runs;
58  int vwgtdegree;
59  int ignore;
60  /* thread communication structures */
61  dlthread_comm_t comm;
62  /* partitioning parameters */
63  int ptype;
64  pid_type nparts;
65  size_t nruns;
66  size_t ncuts;
67  real_type * tpwgts;
68  real_type * pijbm;
69  real_type ubfactor;
70  int metis_serial;
71  int removeislands;
72  /* coarsening parameters */
73  int ctype;
74  int contype;
75  int leafmatch;
76  vtx_type coarsen_to;
77  wgt_type maxvwgt;
78  double stopratio;
79  /* initial partitiong parameters */
80  size_t ninitsolutions;
81  /* refinement parameters */
82  int rtype;
83  size_t nrefpass;
84  vtx_type hillsize;
85  int hs_stype;
86  int global_relabel;
87  /* pre-partitioning parameters */
88  size_t partfactor;
89 } ctrl_type;
90 
91 
92 
93 
94 /******************************************************************************
95 * SERIAL FUNCTION PROTOTYPES **************************************************
96 ******************************************************************************/
97 
98 
99 #define ctrl_create MTMETIS_ctrl_create
100 
105 ctrl_type * ctrl_create(void);
106 
107 
108 #define ctrl_setup MTMETIS_ctrl_setup
109 
118 void ctrl_setup(
119  ctrl_type * ctrl,
120  real_type * tpwgts,
121  vtx_type nvtxs);
122 
123 
124 #define ctrl_parse MTMETIS_ctrl_parse
125 
133 int ctrl_parse(
134  double const * options,
135  ctrl_type ** ctrl);
136 
137 
138 #define ctrl_free MTMETIS_ctrl_free
139 
144 void ctrl_free(
145  ctrl_type * ctrl);
146 
147 
148 #define ctrl_combine_timers MTMETIS_ctrl_combine_timers
149 
156  ctrl_type * ctrl,
157  ctrl_type const * ctrl2);
158 
159 
160 #define ser_ctrl_split MTMETIS_ser_ctrl_split
161 
169 void ser_ctrl_split(
170  ctrl_type const * ctrl,
171  vtx_type const * hnvtxs,
172  ctrl_type ** hctrls);
173 
174 
175 #define ser_ctrl_rb MTMETIS_ser_ctrl_rb
176 
187  ctrl_type * ctrl,
188  pid_type const * offset);
189 
190 
191 
192 
193 /******************************************************************************
194 * PARALLEL FUNCTION PROTOTYPES ************************************************
195 ******************************************************************************/
196 
197 
198 #define par_ctrl_split MTMETIS_par_ctrl_split
199 
210  ctrl_type const * ctrl,
211  vtx_type nvtxs,
212  pid_type nparts,
213  dlthread_comm_t comm);
214 
215 
216 #define par_ctrl_free MTMETIS_par_ctrl_free
217 
222 void par_ctrl_free(
223  ctrl_type * ctrl);
224 
225 
226 #define par_ctrl_parse MTMETIS_par_ctrl_parse
227 
236 int par_ctrl_parse(
237  double const * options,
238  ctrl_type ** r_ctrl,
239  dlthread_comm_t comm);
240 
241 
242 #define par_ctrl_setup MTMETIS_par_ctrl_setup
243 
250 void par_ctrl_setup(
251  ctrl_type * ctrl,
252  real_type * tpwgts,
253  vtx_type nvtxs);
254 
255 
256 #define par_ctrl_rb MTMETIS_par_ctrl_rb
257 
268  ctrl_type * ctrl,
269  pid_type const * offset);
270 
271 
272 
273 /******************************************************************************
274 * TRANSLATION PROTOTYPES ******************************************************
275 ******************************************************************************/
276 
277 
278 char const * trans_ptype_string(
279  mtmetis_ptype_t type);
280 
281 
282 char const * trans_ctype_string(
283  mtmetis_ctype_t type);
284 
285 
286 char const * trans_contype_string(
287  mtmetis_contype_t type);
288 
289 
290 char const * trans_rtype_string(
291  mtmetis_rtype_t type);
292 
293 
294 char const * trans_verbosity_string(
295  mtmetis_verbosity_t type);
296 
297 
298 char const * trans_dtype_string(
299  mtmetis_dtype_t type);
300 
301 
302 mtmetis_ptype_t trans_string_ptype(
303  char const * str);
304 
305 
306 mtmetis_ctype_t trans_string_ctype(
307  char const * str);
308 
309 
310 mtmetis_contype_t trans_string_contype(
311  char const * str);
312 
313 
314 mtmetis_rtype_t trans_string_rtype(
315  char const * str);
316 
317 
318 mtmetis_verbosity_t trans_string_verbosity(
319  char const * str);
320 
321 
322 mtmetis_dtype_t trans_string_dtype(
323  char const * str);
324 
325 
326 
327 
328 #endif
void par_ctrl_free(ctrl_type *ctrl)
Free a control structure and its associated memory.
Definition: ctrl.c:562
ctrl_type * ctrl_create(void)
Allocate and initialize a control structure.
Definition: ctrl.c:167
Definition: ctrl.h:48
ctrl_type * ser_ctrl_rb(ctrl_type *ctrl, pid_type const *offset)
Create a new control for creating an edge separator.
Definition: ctrl.c:517
void ctrl_combine_timers(ctrl_type *ctrl, ctrl_type const *ctrl2)
Combine the times of the two timers into the first.
Definition: ctrl.c:458
int ctrl_parse(double const *options, ctrl_type **ctrl)
Create a control structure using the specified set of options.
Definition: ctrl.c:260
Definition: ctrl.h:29
ctrl_type * par_ctrl_rb(ctrl_type *ctrl, pid_type const *offset)
Create a new control for creating an edge separator.
Definition: ctrl.c:664
void par_ctrl_setup(ctrl_type *ctrl, real_type *tpwgts, vtx_type nvtxs)
Setup a control structure in parallel.
Definition: ctrl.c:651
int par_ctrl_parse(double const *options, ctrl_type **r_ctrl, dlthread_comm_t comm)
Parse a control structure options in parallel.
Definition: ctrl.c:617
void ctrl_setup(ctrl_type *ctrl, real_type *tpwgts, vtx_type nvtxs)
Setup a control structure to partition a graph with a specified number of vertices. The structure should already be configured with nthreads and nparts.
Definition: ctrl.c:204
void ser_ctrl_split(ctrl_type const *ctrl, vtx_type const *hnvtxs, ctrl_type **hctrls)
Split the control structure serially for recursive bisection or nested dissection.
Definition: ctrl.c:480
Base types etc.
ctrl_type * par_ctrl_split(ctrl_type const *ctrl, vtx_type nvtxs, pid_type nparts, dlthread_comm_t comm)
Duplicate a control structure.
Definition: ctrl.c:575
void ctrl_free(ctrl_type *ctrl)
Free a control structure and its associated memory.
Definition: ctrl.c:442