mt-Metis
Macros | Typedefs | Enumerations | Functions
mtmetis.h File Reference

Library entry points. More...

#include <unistd.h>
#include <stdint.h>
#include <float.h>

Go to the source code of this file.

Macros

#define MTMETIS_VER_MAJOR   0
 
#define MTMETIS_VER_MINOR   5
 
#define MTMETIS_VER_SUBMINOR   0
 

Typedefs

typedef uint32_t mtmetis_vtx_type
 
typedef uint32_t mtmetis_adj_type
 
typedef int32_t mtmetis_wgt_type
 
typedef uint32_t mtmetis_pid_type
 
typedef float mtmetis_real_type
 
typedef enum mtmetis_error_t mtmetis_error_t
 
typedef enum mtmetis_option_t mtmetis_option_t
 
typedef enum mtmetis_ctype_t mtmetis_ctype_t
 
typedef enum mtmetis_contype_t mtmetis_contype_t
 
typedef enum mtmetis_rtype_t mtmetis_rtype_t
 
typedef enum mtmetis_ptype_t mtmetis_ptype_t
 
typedef enum mtmetis_hs_scan_t mtmetis_hs_scan_t
 
typedef enum mtmetis_verbosity_t mtmetis_verbosity_t
 
typedef enum mtmetis_dtype_t mtmetis_dtype_t
 
typedef enum mtmetis_part_t mtmetis_part_t
 
typedef enum mtmetis_ignore_t mtmetis_ignore_t
 

Enumerations

enum  mtmetis_error_t { MTMETIS_SUCCESS = 1, MTMETIS_ERROR_INVALIDINPUT, MTMETIS_ERROR_NOTENOUGHMEMORY, MTMETIS_ERROR_THREADING }
 
enum  mtmetis_option_t {
  MTMETIS_OPTION_TIME, MTMETIS_OPTION_NPARTS, MTMETIS_OPTION_NTHREADS, MTMETIS_OPTION_SEED,
  MTMETIS_OPTION_NCUTS, MTMETIS_OPTION_NRUNS, MTMETIS_OPTION_NINITSOLUTIONS, MTMETIS_OPTION_NITER,
  MTMETIS_OPTION_UBFACTOR, MTMETIS_OPTION_CTYPE, MTMETIS_OPTION_CONTYPE, MTMETIS_OPTION_LEAFMATCH,
  MTMETIS_OPTION_RTYPE, MTMETIS_OPTION_PTYPE, MTMETIS_OPTION_VERBOSITY, MTMETIS_OPTION_DISTRIBUTION,
  MTMETIS_OPTION_RUNSTATS, MTMETIS_OPTION_METIS, MTMETIS_OPTION_REMOVEISLANDS, MTMETIS_OPTION_VWGTDEGREE,
  MTMETIS_OPTION_IGNORE, MTMETIS_OPTION_HILLSIZE, MTMETIS_OPTION_HS_SCANTYPE, MTMETIS_OPTION_VERSION,
  MTMETIS_OPTION_HELP, __MTMETIS_OPTION_TERM
}
 
enum  mtmetis_ctype_t {
  MTMETIS_CTYPE_RM, MTMETIS_CTYPE_SHEM, MTMETIS_CTYPE_SLEM, MTMETIS_CTYPE_MDM,
  MTMETIS_CTYPE_FC
}
 
enum  mtmetis_contype_t { MTMETIS_CONTYPE_CLS, MTMETIS_CONTYPE_DENSE, MTMETIS_CONTYPE_SORT }
 
enum  mtmetis_rtype_t {
  MTMETIS_RTYPE_GREEDY, MTMETIS_RTYPE_FM, MTMETIS_RTYPE_SFM, MTMETIS_RTYPE_SFG,
  MTMETIS_RTYPE_HS
}
 
enum  mtmetis_ptype_t {
  MTMETIS_PTYPE_KWAY, MTMETIS_PTYPE_ESEP, MTMETIS_PTYPE_RB, MTMETIS_PTYPE_VSEP,
  MTMETIS_PTYPE_ND
}
 
enum  mtmetis_hs_scan_t {
  MTMETIS_HS_SCAN_SQRT, MTMETIS_HS_SCAN_1PC, MTMETIS_HS_SCAN_5PC, MTMETIS_HS_SCAN_25PC,
  MTMETIS_HS_SCAN_FULL
}
 
enum  mtmetis_verbosity_t {
  MTMETIS_VERBOSITY_NONE, MTMETIS_VERBOSITY_LOW, MTMETIS_VERBOSITY_MEDIUM, MTMETIS_VERBOSITY_HIGH,
  MTMETIS_VERBOSITY_MAXIMUM
}
 
enum  mtmetis_dtype_t { MTMETIS_DISTRIBUTION_BLOCK, MTMETIS_DISTRIBUTION_CYCLIC, MTMETIS_DISTRIBUTION_BLOCKCYCLIC }
 
enum  mtmetis_part_t {
  MTMETIS_VSEP_NULL = -1, MTMETIS_VSEP_PARTA = 0, MTMETIS_VSEP_PARTB = 1, MTMETIS_VSEP_SEP = 2,
  MTMETIS_VSEP_NPARTS = 3, MTMETIS_ESEP_PARTA = 0, MTMETIS_ESEP_PARTB = 1, MTMETIS_ESEP_NPARTS = 2
}
 
enum  mtmetis_ignore_t { MTMETIS_IGNORE_NONE = 0x00, MTMETIS_IGNORE_VERTEXWEIGHTS = 0x01, MTMETIS_IGNORE_EDGEWEIGHTS = 0x02 }
 

Functions

double * mtmetis_init_options (void)
 Allocate and initialize a set of options for use with the mtmetis_partkway_explicit() function. More...
 
int MTMETIS_PartGraphRecursive (mtmetis_vtx_type const *nvtxs, mtmetis_vtx_type const *ncon, mtmetis_adj_type const *xadj, mtmetis_vtx_type const *adjncy, mtmetis_wgt_type const *vwgt, mtmetis_vtx_type const *vsize, mtmetis_wgt_type const *adjwgt, mtmetis_pid_type const *nparts, mtmetis_real_type const *tpwgts, mtmetis_real_type const *ubvec, double const *options, mtmetis_wgt_type *r_edgecut, mtmetis_pid_type *where)
 Create a partitioning of a graph using recursive bisection. More...
 
int MTMETIS_PartGraphKway (mtmetis_vtx_type const *nvtxs, mtmetis_vtx_type const *ncon, mtmetis_adj_type const *xadj, mtmetis_vtx_type const *adjncy, mtmetis_wgt_type const *vwgt, mtmetis_vtx_type const *vsize, mtmetis_wgt_type const *adjwgt, mtmetis_pid_type const *nparts, mtmetis_real_type const *tpwgts, mtmetis_real_type const *ubvec, double const *options, mtmetis_wgt_type *r_edgecut, mtmetis_pid_type *where)
 Create a direct k-way partitioning of a graph. More...
 
int MTMETIS_NodeND (mtmetis_vtx_type const *nvtxs, mtmetis_adj_type const *xadj, mtmetis_vtx_type const *adjncy, mtmetis_wgt_type const *vwgt, double const *options, mtmetis_pid_type *perm, mtmetis_pid_type *iperm)
 Create a nested dissection ordering of a graph. More...
 
int mtmetis_partition_explicit (mtmetis_vtx_type nvtxs, mtmetis_adj_type const *xadj, mtmetis_vtx_type const *adjncy, mtmetis_wgt_type const *vwgt, mtmetis_wgt_type const *adjwgt, double const *options, mtmetis_pid_type *where, mtmetis_wgt_type *r_edgecut)
 Partition a graph using an explicit set of options detailing what tupe of operation to perform. More...
 

Detailed Description

Library entry points.

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

Function Documentation

double* mtmetis_init_options ( void  )

Allocate and initialize a set of options for use with the mtmetis_partkway_explicit() function.

Returns
The allocated and initialized options.
int MTMETIS_NodeND ( mtmetis_vtx_type const *  nvtxs,
mtmetis_adj_type const *  xadj,
mtmetis_vtx_type const *  adjncy,
mtmetis_wgt_type const *  vwgt,
double const *  options,
mtmetis_pid_type *  perm,
mtmetis_pid_type *  iperm 
)

Create a nested dissection ordering of a graph.

Parameters
nvtxsThe number of vertices in the graph.
xadjThe adjacency list pointer (equivalent to rowptr in CSR).
adjncyThe adjacency list.
vwgtThe vertex weights.
optionsThe options for the partitioning.
permThe permutation vector for re-ordering a sparse matrix (output).
ipermThe permutation vector for mapping from a re-ordered vector/matrix to the original ordering (output).
Returns
MTMETIS_SUCCESS upon successful ordering generation.
int MTMETIS_PartGraphKway ( mtmetis_vtx_type const *  nvtxs,
mtmetis_vtx_type const *  ncon,
mtmetis_adj_type const *  xadj,
mtmetis_vtx_type const *  adjncy,
mtmetis_wgt_type const *  vwgt,
mtmetis_vtx_type const *  vsize,
mtmetis_wgt_type const *  adjwgt,
mtmetis_pid_type const *  nparts,
mtmetis_real_type const *  tpwgts,
mtmetis_real_type const *  ubvec,
double const *  options,
mtmetis_wgt_type *  r_edgecut,
mtmetis_pid_type *  where 
)

Create a direct k-way partitioning of a graph.

Parameters
nvtxsThe number of vertices in the graph.
nconThe number of balance constraints (only 1 is supported at this time).
xadjThe adjacency list pointer (equivalent to rowptr in CSR).
adjncyThe adjacency list.
vwgtThe vertex weights.
vsizeUnused.
adjwgtThe edge weights.
npartsThe number of partitions desired.
tpwgtsThe target partition weights (as a fraction of the total).
ubvecThe imbalance tolerance for each constraint (again, only 1 is allowed currently).
optionsThe configuration options for this run.
r_edgecutThe total cut edgeweight of the resulting partitioning (output).
whereThe partition assignments for each vertex (output).
Returns
MTMETIS_SUCCESS upon success partitioning generation.
int MTMETIS_PartGraphRecursive ( mtmetis_vtx_type const *  nvtxs,
mtmetis_vtx_type const *  ncon,
mtmetis_adj_type const *  xadj,
mtmetis_vtx_type const *  adjncy,
mtmetis_wgt_type const *  vwgt,
mtmetis_vtx_type const *  vsize,
mtmetis_wgt_type const *  adjwgt,
mtmetis_pid_type const *  nparts,
mtmetis_real_type const *  tpwgts,
mtmetis_real_type const *  ubvec,
double const *  options,
mtmetis_wgt_type *  r_edgecut,
mtmetis_pid_type *  where 
)

Create a partitioning of a graph using recursive bisection.

Parameters
nvtxsThe number of vertices in the graph.
nconThe number of balance constraints (only 1 is supported at this time).
xadjThe adjacency list pointer (equivalent to rowptr in CSR).
adjncyThe adjacency list.
vwgtThe vertex weights.
vsizeUnused.
adjwgtThe edge weights.
npartsThe number of partitions desired.
tpwgtsThe target partition weights (as a fraction of the total).
ubvecThe imbalance tolerance for each constraint (again, only 1 is allowed currently).
optionsThe configuration options for this run.
r_edgecutThe total cut edgeweight of the resulting partitioning (output).
whereThe partition assignments for each vertex (output).
Returns
MTMETIS_SUCCESS upon success partitioning generation.
int mtmetis_partition_explicit ( mtmetis_vtx_type  nvtxs,
mtmetis_adj_type const *  xadj,
mtmetis_vtx_type const *  adjncy,
mtmetis_wgt_type const *  vwgt,
mtmetis_wgt_type const *  adjwgt,
double const *  options,
mtmetis_pid_type *  where,
mtmetis_wgt_type *  r_edgecut 
)

Partition a graph using an explicit set of options detailing what tupe of operation to perform.

Parameters
nvtxsThe number of vertices in the graph.
xadjThe adjacency list pointer.
adjncyThe adjacency list.
vwgtThe vertex weights.
adjwgtThe edge weights.
optionsThe set of options.
whereThe partition ID of each vertex (can be NULL, or of length nvtxs)
r_edgecutA reference to the weight of cut edges (can be NULL).
Returns
MTMETIS_SUCCESS unless an error was encountered.