-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathparmetis.h
168 lines (136 loc) · 6.26 KB
/
parmetis.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
* Copyright 1997-2003, Regents of the University of Minnesota
*
* parmetis.h
*
* This file contains function prototypes and constrant definitions for
* ParMETIS
*
* Started 7/21/03
* George
*
*/
#ifndef __parmetis_h__
#define __parmetis_h__
#include <mpi.h>
#include <metis.h>
#ifndef _MSC_VER
#define __cdecl
#endif
#if IDXTYPEWIDTH == 32
/*#define IDX_T MPI_INT32_T */
#define IDX_T MPI_INT
#define KEEP_BIT 0x40000000L
#elif IDXTYPEWIDTH == 64
/*#define IDX_T MPI_INT64_T */
#define IDX_T MPI_LONG_LONG_INT
#define KEEP_BIT 0x4000000000000000LL
#else
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
#endif
#if REALTYPEWIDTH == 32
#define REAL_T MPI_FLOAT
#elif REALTYPEWIDTH == 64
#define REAL_T MPI_DOUBLE
#else
#error "Incorrect user-supplied value fo REALTYPEWIDTH"
#endif
/*************************************************************************
* Constants
**************************************************************************/
#define PARMETIS_MAJOR_VERSION 4
#define PARMETIS_MINOR_VERSION 0
#define PARMETIS_SUBMINOR_VERSION 3
/*************************************************************************
* Function prototypes
**************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*-------------------------------------------------------------------
* API Introduced with Release 3.0 (current API)
*--------------------------------------------------------------------*/
int __cdecl ParMETIS_V3_PartKway(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts,
real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part,
MPI_Comm *comm);
int __cdecl ParMETIS_V3_PartGeomKway(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ndims, real_t *xyz,
idx_t *ncon, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options,
idx_t *edgecut, idx_t *part, MPI_Comm *comm);
int __cdecl ParMETIS_V3_PartGeom(
idx_t *vtxdist, idx_t *ndims, real_t *xyz, idx_t *part, MPI_Comm *comm);
int __cdecl ParMETIS_V3_RefineKway(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *nparts,
real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut,
idx_t *part, MPI_Comm *comm);
int __cdecl ParMETIS_V3_AdaptiveRepart(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *vsize, idx_t *adjwgt, idx_t *wgtflag, idx_t *numflag, idx_t *ncon,
idx_t *nparts, real_t *tpwgts, real_t *ubvec, real_t *ipc2redist,
idx_t *options, idx_t *edgecut, idx_t *part, MPI_Comm *comm);
int __cdecl ParMETIS_V3_Mesh2Dual(
idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *numflag,
idx_t *ncommonnodes, idx_t **xadj, idx_t **adjncy, MPI_Comm *comm);
int __cdecl ParMETIS_V3_PartMeshKway(
idx_t *elmdist, idx_t *eptr, idx_t *eind, idx_t *elmwgt,
idx_t *wgtflag, idx_t *numflag, idx_t *ncon, idx_t *ncommonnodes, idx_t *nparts,
real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *edgecut, idx_t *part,
MPI_Comm *comm);
int __cdecl ParMETIS_V3_NodeND(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag,
idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
int __cdecl ParMETIS_V32_NodeND(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *vwgt,
idx_t *numflag, idx_t *mtype, idx_t *rtype, idx_t *p_nseps, idx_t *s_nseps,
real_t *ubfrac, idx_t *seed, idx_t *dbglvl, idx_t *order,
idx_t *sizes, MPI_Comm *comm);
int __cdecl ParMETIS_SerialNodeND(
idx_t *vtxdist, idx_t *xadj, idx_t *adjncy, idx_t *numflag,
idx_t *options, idx_t *order, idx_t *sizes, MPI_Comm *comm);
#ifdef __cplusplus
}
#endif
/*------------------------------------------------------------------------
* Enum type definitions
*-------------------------------------------------------------------------*/
/*! Operation type codes */
typedef enum {
PARMETIS_OP_KMETIS,
PARMETIS_OP_GKMETIS,
PARMETIS_OP_GMETIS,
PARMETIS_OP_RMETIS,
PARMETIS_OP_AMETIS,
PARMETIS_OP_OMETIS,
PARMETIS_OP_M2DUAL,
PARMETIS_OP_MKMETIS
} pmoptype_et;
/*************************************************************************
* Various constants used for the different parameters
**************************************************************************/
/* Matching types */
#define PARMETIS_MTYPE_LOCAL 1 /* Restrict matching to within processor vertices */
#define PARMETIS_MTYPE_GLOBAL 2 /* Remote vertices can be matched */
/* Separator refinement types */
#define PARMETIS_SRTYPE_GREEDY 1 /* Vertices are visted from highest to lowest gain */
#define PARMETIS_SRTYPE_2PHASE 2 /* Separators are refined in a two-phase fashion using
PARMETIS_SRTYPE_GREEDY for the 2nd phase */
/* Coupling types for ParMETIS_V3_RefineKway & ParMETIS_V3_AdaptiveRepart */
#define PARMETIS_PSR_COUPLED 1 /* # of partitions == # of processors */
#define PARMETIS_PSR_UNCOUPLED 2 /* # of partitions != # of processors */
/* Debug levels (fields should be ORed) */
#define PARMETIS_DBGLVL_TIME 1 /* Perform timing analysis */
#define PARMETIS_DBGLVL_INFO 2 /* Perform timing analysis */
#define PARMETIS_DBGLVL_PROGRESS 4 /* Show the coarsening progress */
#define PARMETIS_DBGLVL_REFINEINFO 8 /* Show info on communication during folding */
#define PARMETIS_DBGLVL_MATCHINFO 16 /* Show info on matching */
#define PARMETIS_DBGLVL_RMOVEINFO 32 /* Show info on communication during folding */
#define PARMETIS_DBGLVL_REMAP 64 /* Determines if remapping will take place */
#define PARMETIS_DBGLVL_TWOHOP 128 /* Performs a 2-hop matching */
#define PARMETIS_DBGLVL_DROPEDGES 256 /* Drop edges during coarsening */
#define PARMETIS_DBGLVL_FAST 512 /* Reduces #trials for various steps */
#define PARMETIS_DBGLVL_ONDISK 1024 /* Saves non-active graphs to disk */
#endif