mt-Metis
Macros | Functions
ctrl.c File Reference

Functions for allocating, freeing, and manipulating control structures. More...

#include <omp.h>
#include "ctrl.h"

Macros

#define MTMETIS_CTRL_C
 
#define FIND_STRING(table, str)   S_find_string(table,sizeof(table)/sizeof(char*),str)
 

Functions

ctrl_typectrl_create (void)
 Allocate and initialize a control structure. More...
 
void ctrl_setup (ctrl_type *const ctrl, real_type *const tpwgts, vtx_type const 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. More...
 
int ctrl_parse (double const *const options, ctrl_type **const r_ctrl)
 Create a control structure using the specified set of options. More...
 
void ctrl_free (ctrl_type *ctrl)
 Free a control structure and its associated memory. More...
 
void ctrl_combine_timers (ctrl_type *const ctrl, ctrl_type const *const ctrl2)
 Combine the times of the two timers into the first. More...
 
void ser_ctrl_split (ctrl_type const *const ctrl, vtx_type const *const hnvtxs, ctrl_type **const hctrls)
 Split the control structure serially for recursive bisection or nested dissection. More...
 
ctrl_typeser_ctrl_rb (ctrl_type *const ctrl, pid_type const *const offset)
 Create a new control for creating an edge separator. More...
 
void par_ctrl_free (ctrl_type *ctrl)
 Free a control structure and its associated memory. More...
 
ctrl_typepar_ctrl_split (ctrl_type const *const ctrl, vtx_type const nvtxs, pid_type const nparts, dlthread_comm_t comm)
 Duplicate a control structure. More...
 
int par_ctrl_parse (double const *const options, ctrl_type **const r_ctrl, dlthread_comm_t comm)
 Parse a control structure options in parallel. More...
 
void par_ctrl_setup (ctrl_type *const ctrl, real_type *const tpwgts, vtx_type const nvtxs)
 Setup a control structure in parallel. More...
 
ctrl_typepar_ctrl_rb (ctrl_type *const ctrl, pid_type const *const offset)
 Create a new control for creating an edge separator. More...
 
char const * trans_ptype_string (const mtmetis_ptype_t type)
 
char const * trans_ctype_string (const mtmetis_ctype_t type)
 
char const * trans_contype_string (const mtmetis_contype_t type)
 
char const * trans_rtype_string (const mtmetis_rtype_t type)
 
char const * trans_verbosity_string (const mtmetis_verbosity_t type)
 
char const * trans_dtype_string (mtmetis_dtype_t const type)
 
mtmetis_ptype_t trans_string_ptype (char const *const str)
 
mtmetis_ctype_t trans_string_ctype (char const *const str)
 
mtmetis_contype_t trans_string_contype (char const *const str)
 
mtmetis_rtype_t trans_string_rtype (char const *const str)
 
mtmetis_verbosity_t trans_string_verbosity (char const *const str)
 
mtmetis_dtype_t trans_string_dtype (char const *const str)
 

Detailed Description

Functions for allocating, freeing, and manipulating control structures.

Author
Dominique LaSalle lasal.nosp@m.le@c.nosp@m.s.umn.nosp@m..edu Copyright 2014, Regents of the University of Minnesota
Version
1
Date
2014-09-17

Function Documentation

void ctrl_combine_timers ( ctrl_type ctrl,
ctrl_type const *  ctrl2 
)

Combine the times of the two timers into the first.

Parameters
ctrlThe timer to recieve the combined times.
ctrl2The timer to combine times with.
ctrl_type* ctrl_create ( void  )

Allocate and initialize a control structure.

Returns
The new control structure.
void ctrl_free ( ctrl_type ctrl)

Free a control structure and its associated memory.

Parameters
ctrlThe control structure to free.
int ctrl_parse ( double const *  options,
ctrl_type **  ctrl 
)

Create a control structure using the specified set of options.

Parameters
optionsThe options specifying how to setup the ctrl.
ctrlA reference to the control structure to allocate and configure.
Returns
MTMETIS_SUCCESS if the options array is valid.
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.

Parameters
ctrlThe control structure to configure.
tpwgtsThe target partition weights for this control (can be NULL).
nvtxsThe number of vertices in the graph to partition.
void par_ctrl_free ( ctrl_type ctrl)

Free a control structure and its associated memory.

Parameters
ctrlThe control structure to free.
int par_ctrl_parse ( double const *  options,
ctrl_type **  r_ctrl,
dlthread_comm_t  comm 
)

Parse a control structure options in parallel.

Parameters
optionsThe options to parse.
r_ctrlA reference to the ctrl pointer.
commThe thread communicator for the current thread group.
Returns
MTMETIS_SUCCESS if the options are valid.
ctrl_type* par_ctrl_rb ( ctrl_type ctrl,
pid_type const *  offset 
)

Create a new control for creating an edge separator.

Parameters
ctrlThe control to parse options from.
offsetThe prefixsum of the number of partitions per half (lengh 3). This is an exclusive prefixsum so offset[0] = 0, and offset[2] = ctrl->nparts.
Returns
The new control.
void par_ctrl_setup ( ctrl_type ctrl,
real_type *  tpwgts,
vtx_type  nvtxs 
)

Setup a control structure in parallel.

Parameters
ctrlThe control structure.
tpwgtsThe target partition weights for this control (can be NULL).
nvtxsThe number of vertices in the graph.
ctrl_type* par_ctrl_split ( ctrl_type const *  ctrl,
vtx_type  nvtxs,
pid_type  nparts,
dlthread_comm_t  comm 
)

Duplicate a control structure.

Parameters
ctrlThe control structure to split.
nvtxsThe new number of starting vertices.
npartsThe new number of partitions.
commThe new thread communicator.
Returns
The duplicated contrl structure.
ctrl_type* ser_ctrl_rb ( ctrl_type ctrl,
pid_type const *  offset 
)

Create a new control for creating an edge separator.

Parameters
ctrlThe control to parse options from.
offsetThe prefixsum of the number of partitions per half (lengh 3). This is an exclusive prefixsum so offset[0] = 0, and offset[2] = ctrl->nparts.
Returns
The new control.
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.

Parameters
ctrlThe base control to split.
hnvtxsThe number of vertices in each graph.
hctrlThe two resulting ctrls (output).