From 37728afadae43ccf3b5aa47e314b61d517e26c3e Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 30 Jun 2016 00:19:50 +0200 Subject: petsc: run a test --- var/spack/repos/builtin/packages/petsc/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 8dd1d8d2b9..b2fc80e084 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -148,6 +148,21 @@ class Petsc(Package): make('MAKE_NP=%s' % make_jobs, parallel=False) make("install") + # solve Poisson equation in 2D to make sure nothing is broken: + with working_dir('src/ksp/ksp/examples/tutorials'): + os.system('%s ex50.c -I%s -L%s -lpetsc -o ex50' % ( + self.spec['mpi'].mpicc, prefix.include, prefix.lib)) + ex50 = Executable('./ex50') + ex50('-da_grid_x', '4', '-da_grid_y','4') + if 'superlu-dist' in spec: + ex50('-da_grid_x', '4', '-da_grid_y','4','-pc_type','lu', '-pc_factor_mat_solver_package', 'superlu_dist') # NOQA: ignore=E501 + + if 'mumps' in spec: + ex50('-da_grid_x', '4', '-da_grid_y','4','-pc_type','lu', '-pc_factor_mat_solver_package', 'mumps') # NOQA: ignore=E501 + + if 'hypre' in spec: + ex50('-da_grid_x', '4', '-da_grid_y','4', '-pc_type', 'hypre', '-pc_hypre_type', 'boomeramg') # NOQA: ignore=E501 + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): # set up PETSC_DIR for everyone using PETSc package spack_env.set('PETSC_DIR', self.prefix) -- cgit v1.2.3-70-g09d2 From 6f4b0e9bda8a7f1cdc16b5f9af6887aa4cb342d3 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 30 Jun 2016 08:22:01 +0200 Subject: petsc: fix flake8 and ~mpi case in tests --- var/spack/repos/builtin/packages/petsc/package.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index b2fc80e084..6a7bee9788 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -150,18 +150,19 @@ class Petsc(Package): # solve Poisson equation in 2D to make sure nothing is broken: with working_dir('src/ksp/ksp/examples/tutorials'): + cc = os.environ['CC'] if '~mpi' in self.spec else self.spec['mpi'].mpicc # NOQA: ignore=E501 os.system('%s ex50.c -I%s -L%s -lpetsc -o ex50' % ( - self.spec['mpi'].mpicc, prefix.include, prefix.lib)) + cc, prefix.include, prefix.lib)) ex50 = Executable('./ex50') - ex50('-da_grid_x', '4', '-da_grid_y','4') + ex50('-da_grid_x', '4', '-da_grid_y', '4') if 'superlu-dist' in spec: - ex50('-da_grid_x', '4', '-da_grid_y','4','-pc_type','lu', '-pc_factor_mat_solver_package', 'superlu_dist') # NOQA: ignore=E501 + ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'lu', '-pc_factor_mat_solver_package', 'superlu_dist') # NOQA: ignore=E501 if 'mumps' in spec: - ex50('-da_grid_x', '4', '-da_grid_y','4','-pc_type','lu', '-pc_factor_mat_solver_package', 'mumps') # NOQA: ignore=E501 + ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'lu', '-pc_factor_mat_solver_package', 'mumps') # NOQA: ignore=E501 if 'hypre' in spec: - ex50('-da_grid_x', '4', '-da_grid_y','4', '-pc_type', 'hypre', '-pc_hypre_type', 'boomeramg') # NOQA: ignore=E501 + ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'hypre', '-pc_hypre_type', 'boomeramg') # NOQA: ignore=E501 def setup_dependent_environment(self, spack_env, run_env, dependent_spec): # set up PETSC_DIR for everyone using PETSc package -- cgit v1.2.3-70-g09d2