25#if defined(HAVE_METIS)
28#if defined(HAVE_PARMETIS)
35#if defined(METIS_USE_DOUBLEPRECISION) || REALTYPEWIDTH == 64
36#error METIS must be compiled in single precision for Octopus.
40const int OCT_METIS_NOPTIONS = METIS_NOPTIONS;
43const int OCT_METIS_OPTION_PTYPE = METIS_OPTION_PTYPE + 1;
44const int OCT_METIS_OPTION_OBJTYPE = METIS_OPTION_OBJTYPE + 1;
45const int OCT_METIS_OPTION_CTYPE = METIS_OPTION_CTYPE + 1;
46const int OCT_METIS_OPTION_IPTYPE = METIS_OPTION_IPTYPE + 1;
47const int OCT_METIS_OPTION_RTYPE = METIS_OPTION_RTYPE + 1;
48const int OCT_METIS_OPTION_DBGLVL = METIS_OPTION_DBGLVL + 1;
49const int OCT_METIS_OPTION_NITER = METIS_OPTION_NITER + 1;
50const int OCT_METIS_OPTION_NCUTS = METIS_OPTION_NCUTS + 1;
51const int OCT_METIS_OPTION_SEED = METIS_OPTION_SEED + 1;
52const int OCT_METIS_OPTION_NO2HOP = METIS_OPTION_NO2HOP + 1;
53const int OCT_METIS_OPTION_MINCONN = METIS_OPTION_MINCONN + 1;
54const int OCT_METIS_OPTION_CONTIG = METIS_OPTION_CONTIG + 1;
55const int OCT_METIS_OPTION_COMPRESS = METIS_OPTION_COMPRESS + 1;
56const int OCT_METIS_OPTION_CCORDER = METIS_OPTION_CCORDER + 1;
57const int OCT_METIS_OPTION_PFACTOR = METIS_OPTION_PFACTOR + 1;
58const int OCT_METIS_OPTION_NSEPS = METIS_OPTION_NSEPS + 1;
59const int OCT_METIS_OPTION_UFACTOR = METIS_OPTION_UFACTOR + 1;
60const int OCT_METIS_OPTION_NUMBERING = METIS_OPTION_NUMBERING + 1;
61const int OCT_METIS_OPTION_HELP = METIS_OPTION_HELP + 1;
62const int OCT_METIS_OPTION_TPWGTS = METIS_OPTION_TPWGTS + 1;
63const int OCT_METIS_OPTION_NCOMMON = METIS_OPTION_NCOMMON + 1;
64const int OCT_METIS_OPTION_NOOUTPUT = METIS_OPTION_NOOUTPUT + 1;
65const int OCT_METIS_OPTION_BALANCE = METIS_OPTION_BALANCE + 1;
66const int OCT_METIS_OPTION_GTYPE = METIS_OPTION_GTYPE + 1;
67const int OCT_METIS_OPTION_UBVEC = METIS_OPTION_UBVEC + 1;
69#if METIS_VER_MAJOR > 5 || (METIS_VER_MAJOR == 5 && METIS_VER_MINOR >= 2)
70const int OCT_METIS_OPTION_NIPARTS = METIS_OPTION_NIPARTS + 1;
71const int OCT_METIS_OPTION_ONDISK = METIS_OPTION_ONDISK + 1;
72const int OCT_METIS_OPTION_DROPEDGES = METIS_OPTION_DROPEDGES + 1;
73const int OCT_METIS_OPTION_TWOHOP = METIS_OPTION_TWOHOP + 1;
74const int OCT_METIS_OPTION_FAST = METIS_OPTION_FAST + 1;
76const int OCT_METIS_OPTION_NIPARTS = -1;
77const int OCT_METIS_OPTION_ONDISK = -1;
78const int OCT_METIS_OPTION_DROPEDGES = -1;
79const int OCT_METIS_OPTION_TWOHOP = -1;
80const int OCT_METIS_OPTION_FAST = -1;
84void FC_FUNC_(oct_metis_setdefaultoptions,
85 OCT_METIS_SETDEFAULTOPTIONS)(idx_t *options) {
86 METIS_SetDefaultOptions(options);
89int FC_FUNC_(oct_metis_partgraphrecursive, OCT_METIS_PARTGRAPHRECURSIVE)(
90 idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *nparts,
91 real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part) {
93 return METIS_PartGraphRecursive(nvtxs, ncon, xadj, adjncy, NULL, NULL, NULL,
94 nparts, tpwgts, ubvec, options, objval, part);
97int FC_FUNC_(oct_metis_partgraphkway, OCT_METIS_PARTGRAPHKWAY)(
98 idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *nparts,
99 real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part) {
101 return METIS_PartGraphKway(nvtxs, ncon, xadj, adjncy, NULL, NULL, NULL,
102 nparts, tpwgts, ubvec, options, objval, part);
106const int OCT_METIS_NOPTIONS = -1;
108const int OCT_METIS_OPTION_PTYPE = -1;
109const int OCT_METIS_OPTION_OBJTYPE = -1;
110const int OCT_METIS_OPTION_CTYPE = -1;
111const int OCT_METIS_OPTION_IPTYPE = -1;
112const int OCT_METIS_OPTION_RTYPE = -1;
113const int OCT_METIS_OPTION_DBGLVL = -1;
114const int OCT_METIS_OPTION_NITER = -1;
115const int OCT_METIS_OPTION_NCUTS = -1;
116const int OCT_METIS_OPTION_SEED = -1;
117const int OCT_METIS_OPTION_NO2HOP = -1;
118const int OCT_METIS_OPTION_MINCONN = -1;
119const int OCT_METIS_OPTION_CONTIG = -1;
120const int OCT_METIS_OPTION_COMPRESS = -1;
121const int OCT_METIS_OPTION_CCORDER = -1;
122const int OCT_METIS_OPTION_PFACTOR = -1;
123const int OCT_METIS_OPTION_NSEPS = -1;
124const int OCT_METIS_OPTION_UFACTOR = -1;
125const int OCT_METIS_OPTION_NUMBERING = -1;
126const int OCT_METIS_OPTION_HELP = -1;
127const int OCT_METIS_OPTION_TPWGTS = -1;
128const int OCT_METIS_OPTION_NCOMMON = -1;
129const int OCT_METIS_OPTION_NOOUTPUT = -1;
130const int OCT_METIS_OPTION_BALANCE = -1;
131const int OCT_METIS_OPTION_GTYPE = -1;
132const int OCT_METIS_OPTION_UBVEC = -1;
133const int OCT_METIS_OPTION_NIPARTS = -1;
134const int OCT_METIS_OPTION_ONDISK = -1;
135const int OCT_METIS_OPTION_DROPEDGES = -1;
136const int OCT_METIS_OPTION_TWOHOP = -1;
137const int OCT_METIS_OPTION_FAST = -1;
142void FC_FUNC_(oct_parmetis_v3_partkway,
143 OCT_PARMETIS_V3_PARTKWAY)(idx_t *vtxdist, idx_t *xadj, idx_t *adjncy,
144 idx_t *ncon, idx_t *nparts, real_t *tpwgts,
145 real_t *ubvec, idx_t *options,
146 idx_t *edgecut, idx_t *part,
148 idx_t wgtflag = 0, numflag = 1;
152 comm = MPI_Comm_f2c(*fcomm);
154 ParMETIS_V3_PartKway(vtxdist, xadj, adjncy, NULL, NULL, &wgtflag, &numflag,
155 ncon, nparts, tpwgts, ubvec, options, edgecut, part,
void FC_FUNC_(clean_clarg, CLEAN_CLARG)()