summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-06-30 01:58:35 -0700
committerGitHub <noreply@github.com>2016-06-30 01:58:35 -0700
commita7b8cb6901bd7018cb5f377ee59543530f80b4c6 (patch)
treef70054fc520bb8d91787760d77b604e6c712c453 /var
parentcd943ebe943f651da8fe3eb3e18579b761c807e1 (diff)
parent6f4b0e9bda8a7f1cdc16b5f9af6887aa4cb342d3 (diff)
downloadspack-a7b8cb6901bd7018cb5f377ee59543530f80b4c6.tar.gz
spack-a7b8cb6901bd7018cb5f377ee59543530f80b4c6.tar.bz2
spack-a7b8cb6901bd7018cb5f377ee59543530f80b4c6.tar.xz
spack-a7b8cb6901bd7018cb5f377ee59543530f80b4c6.zip
Merge pull request #1145 from davydden/pkg/petsc_tests
petsc: run a test
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/petsc/package.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py
index 8dd1d8d2b9..6a7bee9788 100644
--- a/var/spack/repos/builtin/packages/petsc/package.py
+++ b/var/spack/repos/builtin/packages/petsc/package.py
@@ -148,6 +148,22 @@ 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'):
+ 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' % (
+ cc, 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)