From badd11e71c2656b601398b10253158c9fc21c031 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 30 Jul 2020 04:45:40 +0200 Subject: [PATCH] openfoam package updates, scotch version update (#17731) * openfoam: use MPI 'headers' property (fixes #17730) * openfoam: +spdp variant, usable for OpenFOAM 1906 and later in contrast to +float32, which uses single-precision throughout, +spdp uses the following: - single-precision for most internals - double-precision for linear solver * openfoam: add m4 as build dependency * scotch: update to 6.0.9 released Oct 2019 Co-authored-by: Mark Olesen --- .../repos/builtin/packages/openfoam/package.py | 17 ++++++++++------- .../repos/builtin/packages/scotch/package.py | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py index 3b9ff8a7dd..1d04ecd02e 100644 --- a/var/spack/repos/builtin/packages/openfoam/package.py +++ b/var/spack/repos/builtin/packages/openfoam/package.py @@ -214,11 +214,12 @@ def mplib_content(spec, pre=None): """The mpi settings (from spack) for the OpenFOAM wmake includes, which allows later reuse within OpenFOAM. - Optional parameter 'pre' to provide alternative prefix + Optional parameter 'pre' to provide alternative prefix for + bin and lib directories. """ mpi_spec = spec['mpi'] bin = mpi_spec.prefix.bin - inc = mpi_spec.prefix.include + inc = mpi_spec.headers.directories[0] # Currently only need first one lib = pkglib(mpi_spec) libname = 'mpi' @@ -283,6 +284,8 @@ class Openfoam(Package): variant('float32', default=False, description='Use single-precision') + variant('spdp', default=False, + description='Use single/double mixed precision') variant('int64', default=False, description='With 64-bit labels') variant('knl', default=False, @@ -317,6 +320,7 @@ class Openfoam(Package): # introduced by the restriction within scotch! depends_on('flex@:2.6.1,2.6.4:') depends_on('cmake', type='build') + depends_on('m4', type='build') # Require scotch with ptscotch - corresponds to standard OpenFOAM setup depends_on('scotch~metis+mpi~int64', when='+scotch~int64') @@ -848,7 +852,7 @@ def __init__(self, spec, **kwargs): self.compiler = None # <- %compiler self.arch_option = '' # Eg, -march=knl self.label_size = None # <- +int64 - self.precision_option = 'DP' # <- +float32 + self.precision_option = 'DP' # <- +float32 | +spdp self.compile_option = kwargs.get('compile-option', '-spack') self.arch = None self.options = None @@ -860,12 +864,11 @@ def __init__(self, spec, **kwargs): elif kwargs.get('label-size', True): self.label_size = '32' - if '+float32' in spec: + if '+spdp' in spec: + self.precision_option = 'SPDP' + elif '+float32' in spec: self.precision_option = 'SP' - # TDB: mixed precision? - # self.precision_option = 'SPDP' - # Processor/architecture-specific optimizations if '+knl' in spec: self.arch_option = '-march=knl' diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index f2ba07a94b..fb8dc08b92 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -14,6 +14,7 @@ class Scotch(Package): url = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.4.tar.gz" list_url = "http://gforge.inria.fr/frs/?group_id=248" + version('6.0.9', sha256='622b4143cf01c480bb15708b3651b29c25e4aeb00c8c6447ff196aca2eca5c93') version('6.0.8', sha256='0ba3f145026174304f910c8770a3cbb034f213c91d939573751cfbb4fd46d45e') version('6.0.6', sha256='686f0cad88d033fe71c8b781735ff742b73a1d82a65b8b1586526d69729ac4cf') version('6.0.5a', sha256='5b21b95e33acd5409d682fa7253cefbdffa8db82875549476c006d8cbe7c556f')