metisDecomp compile error
When compiling OpenFOAM v1606, the following compilation error appears:
metisDecomp.C:211:9: error: cannot convert ‘Foam::UList<float>::iterator {aka float*}’ to ‘real_t* {aka double*}’ for argument ‘9’ to ‘int METIS_PartGraphRecursive(idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, real_t*, real_t*, idx_t*, idx_t*, idx_t*)’
metisDecomp.C:230:9: error: cannot convert ‘Foam::UList<float>::iterator {aka float*}’ to ‘real_t* {aka double*}’ for argument ‘9’ to ‘int METIS_PartGraphKway(idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, idx_t*, real_t*, real_t*, idx_t*, idx_t*, idx_t*)’
It seems that REALTYPEWIDTH 64
in metis.h should correspond to Field<scalar> processorWeights
in metisDecomp.C, while REALTYPEWIDTH 32
corresponds to Field<floatScalar> processorWeights
. So, in order to compile metisDecomp, I changed metisDecomp.C to have Field<scalar>
instead of Field<floatScalar>
(see below).
$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/metis-5.1.0/include/metis.h
#define REALTYPEWIDTH 64
$WM_PROJECT_DIR/src/parallel/decompose/metisDecomp/metisDecomp.C
Field<scalar> processorWeights
For reference: this problem appears to be related to the bug report on the OpenFOAM fork's website: http://bugs.openfoam.org/view.php?id=2085.