mt-Metis
vsinfo.h
Go to the documentation of this file.
1 
13 #ifndef MTMETIS_VSINFO_H
14 #define MTMETIS_VSINFO_H
15 
16 
17 
18 
19 #include "base.h"
20 #include "graph.h"
21 #include "ctrl.h"
22 
23 
24 
25 
26 /******************************************************************************
27 * TYPES ***********************************************************************
28 ******************************************************************************/
29 
30 
31 typedef struct vsnbrinfo_type {
32  /* no need to store information about connectivity to separator */
33  wgt_type con[2];
35 
36 
37 typedef struct vsinfo_type {
38  vtx_iset_t * bnd;
39  vsnbrinfo_type * nbrinfo;
40 } vsinfo_type;
41 
42 
43 
44 
45 /******************************************************************************
46 * DOMLIB MACROS ***************************************************************
47 ******************************************************************************/
48 
49 
50 #define DLMEM_PREFIX vsnbrinfo
51 #define DLMEM_TYPE_T vsnbrinfo_type
52 #include <dlmem_headers.h>
53 #undef DLMEM_TYPE_T
54 #undef DLMEM_PREFIX
55 
56 
57 
58 
59 /******************************************************************************
60 * FUNCTION PROTOTYPES *********************************************************
61 ******************************************************************************/
62 
63 
64 #define vsinfo_free MTMETIS_vsinfo_free
65 
70 void vsinfo_free(
71  graph_type * graph);
72 
73 
74 #define par_vsinfo_create MTMETIS_par_vsinfo_create
75 
82  ctrl_type * ctrl,
83  graph_type * graph);
84 
85 
86 #define par_vsinfo_free MTMETIS_par_vsinfo_free
87 
92 void par_vsinfo_free(
93  graph_type * graph);
94 
95 
96 
97 
98 /******************************************************************************
99 * INLINE FUNCTIONS ************************************************************
100 ******************************************************************************/
101 
102 
103 static inline void S_calc_conn(
104  vtx_type const v,
105  tid_type const myid,
106  vtx_type const mynvtxs,
107  adj_type const * const xadj,
108  vtx_type const * const adjncy,
109  wgt_type const * const * const gvwgt,
110  pid_type const * const * const gwhere,
111  graphdist_type const dist,
112  wgt_type * const con)
113 {
114  vtx_type k, lvtx;
115  adj_type j;
116  tid_type nbrid;
117  pid_type nbr;
118  wgt_type a, b, w;
119 
120  a = 0;
121  b = 0;
122 
123  for (j=xadj[v];j<xadj[v+1];++j) {
124  k = adjncy[j];
125  if (k < mynvtxs) {
126  lvtx = k;
127  nbrid = myid;
128  } else {
129  lvtx = gvtx_to_lvtx(k,dist);
130  nbrid = gvtx_to_tid(k,dist);
131  }
132  nbr = gwhere[nbrid][lvtx];
133  w = gvwgt[nbrid][lvtx];
134  switch (nbr) {
135  case 0:
136  a += w;
137  break;
138  case 1:
139  b += w;
140  break;
141  }
142  }
143 
144  con[0] = a;
145  con[1] = b;
146 }
147 
148 
149 
150 
151 #endif
Type and function prototypes for the ctrl structure.
Definition: graph.h:38
Definition: ctrl.h:48
void par_vsinfo_free(graph_type *graph)
Free a vsinfo and its associate memory.
Definition: vsinfo.c:88
Definition: graph.h:30
Definition: vsinfo.h:31
void vsinfo_free(graph_type *graph)
Free a vsinfo and its associate memory.
Definition: vsinfo.c:43
void par_vsinfo_create(ctrl_type *ctrl, graph_type *graph)
Allocate the memory arrays for refinement of a vertex separator.
Definition: vsinfo.c:64
Types and functions for distributed graph objects.
Base types etc.
Definition: vsinfo.h:37