Skip to content
Snippets Groups Projects
Commit 04300070 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: metisDecomp compile failure for WM_DP (closes #232)

- spurious use of floatScalar instead of scalar for processor weights.

STYLE: partially updated dummy metis.h to reflect metis-5.1.0 API
parent 4ea16136
Branches
Tags
No related merge requests found
#ifndef METIS_H
#define METIS_H 1
#define METIS_H
/* *** DUMMY VERSION of metis.h - this file should not be included if you have metis
* installed in the correct position in $WM_THIRD_PARTY_DIR - see
......@@ -8,39 +8,52 @@
#warning "Dummy metis.h - gets included since it cannot find metis installation."
#define IDXTYPEWIDTH 32
// Integer type: OpenFOAM uses WM_LABEL_SIZE, metis.h uses IDXTYPEWIDTH
#if WM_LABEL_SIZE == 32
typedef int32_t idx_t;
/*------------------------------------------------------------------------
* Undefine the following #define in order to use short idxtype as the idxtype
*-------------------------------------------------------------------------*/
#if IDXTYPEWIDTH == 32
#define IDXTYPEWIDTH 32
#define SCNIDX SCNd32
#define PRIIDX PRId32
#elif WM_LABEL_SIZE == 64
typedef int64_t idx_t;
typedef int32_t idxtype;
#elif IDXTYPEWIDTH == 64
#define IDXTYPEWIDTH 64
#define SCNIDX SCNd64
#define PRIIDX PRId64
typedef int64_t idxtype;
#else
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
#error "Incorrect user-supplied value for WM_LABEL_SIZE (metis IDXTYPEWIDTH)"
#endif
void METIS_WPartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
idxtype *options, idxtype *edgecut, idxtype *part);
void METIS_PartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
idxtype *edgecut, idxtype *part);
void METIS_WPartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
idxtype *options, idxtype *edgecut, idxtype *part);
void METIS_PartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
idxtype *edgecut, idxtype *part);
// Float type: OpenFOAM uses WM_SP, WM_DP, metis.h uses REALTYPEWIDTH
#if defined(WM_SP)
typedef float real_t;
#define REALTYPEWIDTH 32
#elif defined(WM_DP)
typedef double real_t;
#define REALTYPEWIDTH 64
#else
#error "Incorrect user-supplied value for WM_SP / WM_DP (metis REALTYPEWIDTH)"
#endif
#ifdef __cplusplus
extern "C" {
#endif
int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj,
idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt,
idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options,
idx_t *edgecut, idx_t *part);
int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj,
idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt,
idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options,
idx_t *edgecut, idx_t *part);
#ifdef __cplusplus
}
#endif
#endif
......@@ -67,7 +67,7 @@ Foam::label Foam::metisDecomp::decompose
// processor weights initialised with no size, only used if specified in
// a file
Field<floatScalar> processorWeights;
Field<scalar> processorWeights;
// cell weights (so on the vertices of the dual)
List<label> cellWeights;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment