ENH: simplify check for metis sizes (issue #290)

- Now that the metisDecomp uses the metis definition for float/double,
  do not need to verify the scalar sizes.

Note:
- could drop precision qualifier for metis, scotch installation
  (include, lib) as being unneeded, but it is simpler to keep them
  and continue to use the FOAM_EXT_LIBBIN path
  (in case other ThirdParty software is compiled with different
  precisions).
This commit is contained in:
Mark Olesen
2016-11-13 19:53:11 +01:00
parent 0b4ff45541
commit 704620aea1
2 changed files with 4 additions and 25 deletions

View File

@ -28,7 +28,7 @@
# Setup file for scotch include/libraries.
# Sourced during wmake process only.
#
# Normally used to specify the metis version and location for a
# Normally used to specify the scotch version and location for a
# ThirdParty installation.
#
# If using system-wide installations, use the following setting:

View File

@ -4,19 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Extract an integer value from '#define NAME ...'
getIntDefine()
{
local name="$1"
local file="$2"
local val=$(sed -ne \
's/^[ tab]*#[ tab]*define[ tab][ tab]*'"$name"'[ tab][ tab]*\([1-9][0-9]\).*/\1/p' \
"$file")
echo "${val:-0}"
}
# Test for metis.
# - return 0 and export METIS_ARCH_PATH on success
hasMetis()
@ -62,24 +49,16 @@ hasMetis()
}
# Ensure consistent sizes between OpenFOAM and metis header
local label=$(getIntDefine IDXTYPEWIDTH $header)
local scalar=$(getIntDefine REALTYPEWIDTH $header)
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
local label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
[ "$WM_LABEL_SIZE" = "$label" ] || {
echo " skipping - label=$WM_LABEL_SIZE, metis.h has '$label'"
echo
return 1
}
[ "$WM_PRECISION_OPTION" = SP -a "$scalar" = 32 ] || \
[ "$WM_PRECISION_OPTION" = DP -a "$scalar" = 64 ] || {
echo " skipping - scalar='$WM_PRECISION_OPTION', metis.h has '$scalar'"
echo
return 1
}
echo "using METIS_ARCH_PATH=$METIS_ARCH_PATH"
echo " label=$label, scalar=$scalar"
echo " label=$label"
echo
export METIS_ARCH_PATH
return 0 # success