petsc: fix unit tests
This commit is contained in:
parent
081918d71a
commit
c096bb332a
@ -149,20 +149,22 @@ def install(self, spec, prefix):
|
|||||||
make("install")
|
make("install")
|
||||||
|
|
||||||
# solve Poisson equation in 2D to make sure nothing is broken:
|
# solve Poisson equation in 2D to make sure nothing is broken:
|
||||||
|
if ('mpi' in spec) and self.run_tests:
|
||||||
with working_dir('src/ksp/ksp/examples/tutorials'):
|
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
|
env['PETSC_DIR'] = self.prefix
|
||||||
os.system('%s ex50.c -I%s -L%s -lpetsc -o ex50' % (
|
cc = Executable(spec['mpi'].mpicc)
|
||||||
cc, prefix.include, prefix.lib))
|
cc('ex50.c', '-I%s' % prefix.include, '-L%s' % prefix.lib,
|
||||||
ex50 = Executable('./ex50')
|
'-lpetsc', '-o', 'ex50')
|
||||||
ex50('-da_grid_x', '4', '-da_grid_y', '4')
|
run = Executable(join_path(spec['mpi'].prefix.bin, 'mpirun'))
|
||||||
|
run('ex50', '-da_grid_x', '4', '-da_grid_y', '4')
|
||||||
if 'superlu-dist' in spec:
|
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
|
run('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:
|
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
|
run('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:
|
if 'hypre' in spec:
|
||||||
ex50('-da_grid_x', '4', '-da_grid_y', '4', '-pc_type', 'hypre', '-pc_hypre_type', 'boomeramg') # NOQA: ignore=E501
|
run('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):
|
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
|
||||||
# set up PETSC_DIR for everyone using PETSc package
|
# set up PETSC_DIR for everyone using PETSc package
|
||||||
|
Loading…
Reference in New Issue
Block a user