From 47fe9e7aad850bf2d650b33e5faa32cb7fe312a4 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Thu, 13 Jul 2017 08:14:15 -0600 Subject: Adding OpenMP variant to Trilinos. Also building NetCDF with PNetCDF directly, for Trilinos. (#4687) * Adding OpenMP variant to Trilinos. Also building NetCDF with PNetCDF in Trilinos when necessary. * Adding runtime error for PNetCDF variant in Trilinos when necessary. Omitting unnecessary openmp variant for Trilinos in Nalu. * Changing variant checks to conflicts statements. * Adding comments to Trilinos package. --- .../repos/builtin/packages/trilinos/package.py | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index f3d1f61111..74022f0833 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -151,6 +151,8 @@ class Trilinos(CMakePackage): description='Enable DataTransferKit') variant('fortrilinos', default=False, description='Enable ForTrilinos') + variant('openmp', default=False, + description='Enable OpenMP') resource(name='dtk', git='https://github.com/ornl-cees/DataTransferKit', @@ -167,6 +169,13 @@ class Trilinos(CMakePackage): conflicts('+fortrilinos', when='~fortran') conflicts('+fortrilinos', when='@:99') conflicts('+fortrilinos', when='@master') + # Can only use one type of SuperLU + conflicts('+superlu-dist', when='+superlu') + # For Trilinos v11 we need to force SuperLUDist=OFF, since only the + # deprecated SuperLUDist v3.3 together with an Amesos patch is working. + conflicts('+superlu-dist', when='@:11.14.3') + # PnetCDF was only added after v12.10.1 + conflicts('+pnetcdf', when='@:12.10.1') # ###################### Dependencies ########################## @@ -183,9 +192,9 @@ class Trilinos(CMakePackage): # MPI related dependencies depends_on('mpi') - depends_on('netcdf+mpi') - depends_on('parallel-netcdf', when="+pnetcdf@master") - depends_on('parallel-netcdf', when="+pnetcdf@12.10.2:") + depends_on('netcdf+mpi', when="~pnetcdf") + depends_on('netcdf+mpi+parallel-netcdf', when="+pnetcdf@master") + depends_on('netcdf+mpi+parallel-netcdf', when="+pnetcdf@12.10.2:") depends_on('parmetis', when='+metis') # Trilinos' Tribits config system is limited which makes it very tricky to # link Amesos with static MUMPS, see @@ -218,23 +227,8 @@ class Trilinos(CMakePackage): url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-{0}.tar.gz" return url.format(version.dashed) - # check that the combination of variants makes sense - def variants_check(self): - if ('+superlu-dist' in self.spec and - self.spec.satisfies('@11.14.1:11.14.3')): - # For Trilinos v11 we need to force SuperLUDist=OFF, since only the - # deprecated SuperLUDist v3.3 together with an Amesos patch is - # working. - raise RuntimeError('The superlu-dist variant can only be used' + - ' with Trilinos @12.0.1:') - if '+superlu-dist' in self.spec and '+superlu' in self.spec: - # Only choose one type of superlu - raise RuntimeError('The superlu-dist and superlu variant' + - ' cannot be used together') - def cmake_args(self): spec = self.spec - self.variants_check() cxx_flags = [] options = [] @@ -346,7 +340,8 @@ class Trilinos(CMakePackage): '-DTrilinos_ENABLE_SEACASEpu:BOOL=ON', '-DTrilinos_ENABLE_SEACASExodiff:BOOL=ON', '-DTrilinos_ENABLE_SEACASNemspread:BOOL=ON', - '-DTrilinos_ENABLE_SEACASNemslice:BOOL=ON' + '-DTrilinos_ENABLE_SEACASNemslice:BOOL=ON', + '-DTrilinos_ENABLE_SEACASIoss:BOOL=ON' ]) else: options.extend([ @@ -527,6 +522,17 @@ class Trilinos(CMakePackage): # ################# Miscellaneous Stuff ###################### + # OpenMP + if '+openmp' in spec: + options.extend([ + '-DTrilinos_ENABLE_OpenMP:BOOL=ON', + '-DKokkos_ENABLE_OpenMP:BOOL=ON' + ]) + if '+tpetra' in spec: + options.extend([ + '-DTpetra_INST_OPENMP:BOOL=ON' + ]) + # Fortran lib if '+fortran' in spec: if spec.satisfies('%gcc') or spec.satisfies('%clang'): -- cgit v1.2.3-70-g09d2