mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
59
src/dummyThirdParty/metisDecomp/metis.h
vendored
59
src/dummyThirdParty/metisDecomp/metis.h
vendored
@ -1,5 +1,5 @@
|
|||||||
#ifndef METIS_H
|
#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
|
/* *** 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
|
* 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."
|
#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;
|
||||||
|
|
||||||
/*------------------------------------------------------------------------
|
#define IDXTYPEWIDTH 32
|
||||||
* Undefine the following #define in order to use short idxtype as the idxtype
|
|
||||||
*-------------------------------------------------------------------------*/
|
|
||||||
#if IDXTYPEWIDTH == 32
|
|
||||||
#define SCNIDX SCNd32
|
#define SCNIDX SCNd32
|
||||||
#define PRIIDX PRId32
|
#define PRIIDX PRId32
|
||||||
|
#elif WM_LABEL_SIZE == 64
|
||||||
|
typedef int64_t idx_t;
|
||||||
|
|
||||||
typedef int32_t idxtype;
|
#define IDXTYPEWIDTH 64
|
||||||
#elif IDXTYPEWIDTH == 64
|
|
||||||
#define SCNIDX SCNd64
|
#define SCNIDX SCNd64
|
||||||
#define PRIIDX PRId64
|
#define PRIIDX PRId64
|
||||||
|
|
||||||
typedef int64_t idxtype;
|
|
||||||
#else
|
#else
|
||||||
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
|
#error "Incorrect user-supplied value for WM_LABEL_SIZE (metis IDXTYPEWIDTH)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void METIS_WPartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
// Float type: OpenFOAM uses WM_SP, WM_DP, metis.h uses REALTYPEWIDTH
|
||||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
|
#if defined(WM_SP)
|
||||||
idxtype *options, idxtype *edgecut, idxtype *part);
|
typedef float real_t;
|
||||||
void METIS_PartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
#define REALTYPEWIDTH 32
|
||||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
|
#elif defined(WM_DP)
|
||||||
idxtype *edgecut, idxtype *part);
|
typedef double real_t;
|
||||||
void METIS_WPartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
#define REALTYPEWIDTH 64
|
||||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
|
#else
|
||||||
idxtype *options, idxtype *edgecut, idxtype *part);
|
#error "Incorrect user-supplied value for WM_SP / WM_DP (metis REALTYPEWIDTH)"
|
||||||
void METIS_PartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
#endif
|
||||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
|
|
||||||
idxtype *edgecut, idxtype *part);
|
|
||||||
|
|
||||||
|
|
||||||
|
#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
|
#endif
|
||||||
|
|||||||
@ -67,7 +67,7 @@ Foam::label Foam::metisDecomp::decompose
|
|||||||
|
|
||||||
// processor weights initialised with no size, only used if specified in
|
// processor weights initialised with no size, only used if specified in
|
||||||
// a file
|
// a file
|
||||||
Field<floatScalar> processorWeights;
|
Field<scalar> processorWeights;
|
||||||
|
|
||||||
// cell weights (so on the vertices of the dual)
|
// cell weights (so on the vertices of the dual)
|
||||||
List<label> cellWeights;
|
List<label> cellWeights;
|
||||||
|
|||||||
Reference in New Issue
Block a user