13 #ifndef MTMETIS_GRAPH_H 14 #define MTMETIS_GRAPH_H 70 twgt_type tvwgt, tadjwgt;
76 wgt_type mincut, minsep;
79 int free_xadj, free_vwgt, free_vsize, free_adjncy, free_adjwgt;
92 #define graph_create MTMETIS_graph_create 104 #define graph_setup MTMETIS_graph_setup 126 #define graph_distribute MTMETIS_graph_distribute 143 adj_type
const * xadj,
144 vtx_type
const * adjncy,
145 wgt_type
const * vwgt,
146 wgt_type
const * adjwgt,
150 #define graph_gather MTMETIS_graph_gather 165 vtx_type ** r_adjncy,
167 wgt_type ** r_adjwgt,
171 #define graph_setup_coarse MTMETIS_graph_setup_coarse 186 #define graph_setup_twgts MTMETIS_graph_setup_twgts 196 #define graph_alloc_partmemory MTMETIS_graph_alloc_partmemory 207 #define graph_free MTMETIS_graph_free 217 #define graph_free_rdata MTMETIS_graph_free_rdata 227 #define graph_imbalance MTMETIS_graph_imbalance 240 real_type
const * pijbm);
243 #define graph_imbalance_diff MTMETIS_graph_imbalance_diff 257 pid_type
const nparts,
258 real_type
const *
const pijbm,
259 real_type
const ubfactor);
262 #define graph_cut MTMETIS_graph_cut 273 pid_type
const *
const * where);
276 #define graph_isbalanced MTMETIS_graph_isbalanced 293 #define graph_readjust_memory MTMETIS_graph_readjust_memory 305 #define graph_extract_halves MTMETIS_graph_extract_halves 319 pid_type
const *
const * where,
323 #define graph_size MTMETIS_graph_size 335 #define graph_calc_dist MTMETIS_graph_calc_dist 356 #define par_graph_create MTMETIS_par_graph_create 365 dlthread_comm_t comm);
368 #define par_graph_setup MTMETIS_par_graph_setup 387 dlthread_comm_t comm);
390 #define par_graph_gather MTMETIS_par_graph_gather 405 vtx_type ** r_adjncy,
407 wgt_type ** r_adjwgt,
411 #define par_graph_shuffle MTMETIS_par_graph_shuffle 424 pid_type
const *
const * where,
428 #define par_graph_setup_coarse MTMETIS_par_graph_setup_coarse 443 #define par_graph_setup_twgts MTMETIS_par_graph_setup_twgts 453 #define par_graph_alloc_partmemory MTMETIS_par_graph_alloc_partmemory 465 #define par_graph_free MTMETIS_par_graph_free 475 #define par_graph_free_rdata MTMETIS_par_graph_free_rdata 485 #define par_graph_readjust_memory MTMETIS_par_graph_readjust_memory 497 #define par_graph_extract_halves MTMETIS_par_graph_extract_halves 513 pid_type
const *
const * where,
517 #define par_graph_extract_boundary MTMETIS_par_graph_extract_boundary 535 vtx_iset_t
const * bnd);
538 #define par_graph_extract_separator MTMETIS_par_graph_extract_separator 555 vtx_iset_t
const * bnd);
558 #define par_graph_extract_aseparator MTMETIS_par_graph_extract_aseparator 575 vtx_iset_t
const * bnd);
578 #define par_graph_build_radj MTMETIS_par_graph_build_radj 590 #define par_graph_contract MTMETIS_par_graph_contract 605 vtx_type
const cnvtxs,
606 vtx_type
const *
const * gmatch,
607 vtx_type
const * fcmap);
610 #define par_graph_intext_vtx MTMETIS_par_graph_intext_vtx 621 vtx_type *
const r_nint,
622 vtx_type *
const r_next);
625 #define par_graph_cut MTMETIS_par_graph_cut 636 pid_type
const *
const * where);
639 #define par_graph_removeislands MTMETIS_par_graph_removeislands 651 #define par_graph_restoreislands MTMETIS_par_graph_restoreislands 663 pid_type *
const * gwhere);
666 #define par_graph_extract_parts MTMETIS_par_graph_extract_parts 681 pid_type
const *
const *
const gwhere,
682 pid_type
const nparts,
686 #define par_graph_distribute MTMETIS_par_graph_distribute 703 adj_type
const * xadj,
704 vtx_type
const * adjncy,
705 wgt_type
const * vwgt,
706 wgt_type
const * adjwgt,
707 dlthread_comm_t comm);
Type and function prototypes for the ctrl structure.
void par_graph_restoreislands(ctrl_type *ctrl, graph_type *graph, pid_type *const *gwhere)
Restore island vertices and parameters to a graph.
Definition: graph.c:3105
void par_graph_removeislands(ctrl_type *ctrl, graph_type *graph)
Remove island vertices from a graph and adjust parameters.
Definition: graph.c:2946
graph_type * par_graph_extract_separator(ctrl_type const *ctrl, graph_type const *graph, vtx_iset_t const *bnd)
Extract a subgraph consisting only the current separator and two super vertices representing each hal...
wgt_type par_graph_cut(graph_type const *graph, pid_type const *const *where)
Compute the edgecut of a partitioning in parallel.
Definition: graph.c:2886
void graph_gather(graph_type const *graph, adj_type **r_xadj, vtx_type **r_adjncy, wgt_type **r_vwgt, wgt_type **r_adjwgt, vtx_type **r_voff)
Gather a copy of the graph to each thread. Alias is private to each thread where the other three arra...
Definition: graph.c:1664
void par_graph_intext_vtx(graph_type const *const graph, vtx_type *const r_nint, vtx_type *const r_next)
Count the number of internal and external (interface) vertices owned by this thread.
Definition: graph.c:2846
void par_graph_free_rdata(graph_type *graph)
Free partition/refinement data associated with a graph.
Definition: graph.c:2310
void par_graph_free(graph_type *graph)
Free a graph structure and its associated memory.
Definition: graph.c:2276
int graph_isbalanced(ctrl_type const *ctrl, graph_type const *graph, real_type ffactor)
Check if a partitioning of a graph is balanced within the given constraint.
Definition: graph.c:2044
void graph_calc_dist(vtx_type maxnvtxs, tid_type nthreads, graphdist_type *dist)
Configure the distribution structure.
Definition: graph.c:2130
graph_type * par_graph_create(dlthread_comm_t comm)
Allocate and initialize a graph structure.
Definition: graph.c:2153
void par_graph_setup_twgts(graph_type *graph)
Calculate and save the twgts of a new graph.
Definition: graph.c:2239
void par_graph_shuffle(ctrl_type *ctrl, graph_type *graph, pid_type const *const *where, int wgts)
Shuffle the vertices in a graph such that the partition matches the owning thread.
Definition: graph.c:2456
void graph_extract_halves(graph_type *graph, pid_type const *const *where, graph_type **halves)
Pull out partition 0 and partition 1 from a vertex separated graph or edge bisected graph...
void graph_readjust_memory(graph_type *const graph, adj_type adjsize)
Re-adjust the memory used the by edge arrays of a graph.
Definition: graph.c:2054
graph_type * graph_create(tid_type nthreads)
Allocate and initialize a graph structure.
Definition: graph.c:1437
graph_type * graph_setup(vtx_type *nvtxs, adj_type **xadj, vtx_type **adjncy, wgt_type **adjwgt, wgt_type **vwgt, tid_type nthreads)
Setup a graph structure given this threads parts of the graph.
Definition: graph.c:1450
void graph_alloc_partmemory(ctrl_type *ctrl, graph_type *graph)
Allocate memory for partition informatin.
Definition: graph.c:1838
graph_type * par_graph_setup(vtx_type nvtxs, adj_type *xadj, vtx_type *adjncy, wgt_type *adjwgt, wgt_type *vwgt, dlthread_comm_t comm)
Setup a graph structure given this threads parts of the graph.
Definition: graph.c:2166
void par_graph_gather(graph_type const *graph, adj_type **r_xadj, vtx_type **r_adjncy, wgt_type **r_vwgt, wgt_type **r_adjwgt, vtx_type *r_voff)
Gather a copy of the graph to each thread. Alias is private to each thread where the other three arra...
Definition: graph.c:2359
double graph_imbalance_diff(graph_type const *const graph, pid_type const nparts, real_type const *const pijbm, real_type const ubfactor)
Compute the amount the load imbalance of the graph violates the constraint.
Definition: graph.c:1959
void graph_free_rdata(graph_type *graph)
Free partition/refinement data associated with a graph.
Definition: graph.c:1890
adj_type * par_graph_build_radj(graph_type const *graph)
Build a reverse adjacency index and store it in graph->radj.
Definition: graph.c:2795
void graph_free(graph_type *graph)
Free a graph structure and its associated memory.
Definition: graph.c:1856
graph_type * par_graph_extract_boundary(ctrl_type const *ctrl, graph_type const *graph, vtx_iset_t const *bnd)
Extract a subgraph exposing the boundary of a bisection, where the size of the boundary is determined...
size_t graph_size(graph_type const *graph)
Determine the amount of memory required to store the graph.
Definition: graph.c:2068
void par_graph_readjust_memory(graph_type *const graph, adj_type adjsize)
Re-adjust the memory used the by edge arrays of a graph.
graph_type * par_graph_distribute(int distribution, vtx_type nvtxs, adj_type const *xadj, vtx_type const *adjncy, wgt_type const *vwgt, wgt_type const *adjwgt, dlthread_comm_t comm)
Distribute a csr based graph among a set of active threads.
Definition: graph.c:3451
void par_graph_alloc_partmemory(ctrl_type *ctrl, graph_type *graph)
Allocate memory for partition informatin.
Definition: graph.c:2758
graph_type * graph_setup_coarse(graph_type *graph, vtx_type *cnvtxs)
Setup a coarse graph given the fine graph and the number of coarse vertices.
Definition: graph.c:1750
void par_graph_extract_parts(graph_type *const graph, pid_type const *const *const gwhere, pid_type const nparts, graph_type **const parts)
Extract the partitions from a graph. If called with more threads than partitions, the number of threa...
Definition: graph.c:3210
graph_type * graph_distribute(int dist, vtx_type nvtxs, adj_type const *xadj, vtx_type const *adjncy, wgt_type const *vwgt, wgt_type const *adjwgt, tid_type nthreads)
Distribute a csr based graph among threads.
Definition: graph.c:1504
wgt_type graph_cut(graph_type const *graph, pid_type const *const *where)
Compute the edgecut of a partitioning.
Definition: graph.c:1983
void graph_setup_twgts(graph_type *graph)
Calculate and save the tvwgts of a new graph.
Definition: graph.c:1800
void par_graph_contract(ctrl_type *ctrl, graph_type *graph, vtx_type const cnvtxs, vtx_type const *const *gmatch, vtx_type const *fcmap)
Create a coarse graph given a matching using hash table to identify edges to be merged.
graph_type * par_graph_setup_coarse(graph_type *const graph, vtx_type cnvtxs)
Setup a coarse graph given the fine graph and the number of coarse vertices.
Definition: graph.c:2699
graph_type * par_graph_extract_aseparator(ctrl_type const *ctrl, graph_type const *graph, vtx_iset_t const *bnd)
Extract a subgraph consisting only the current separator and two super vertices representing each hal...
tid_type par_graph_extract_halves(graph_type *graph, pid_type const *const *where, graph_type **halves)
Pull out partition 0 and partition 1 from a vertex separated graph or edge bisected graph...
Definition: graph.c:2778
double graph_imbalance(graph_type const *graph, pid_type nparts, real_type const *pijbm)
Compute the load imbalance of a partitioning.
Definition: graph.c:1936