From d7e84fe07c748206afa25e8e45a2ebfac71c7cdf Mon Sep 17 00:00:00 2001 From: Ali Dorostkar Date: Mon, 30 May 2016 14:03:27 +0200 Subject: [PATCH 1/5] dealii, test for specific version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specified that test case “step-40” is only to be run when using dealii version 8.4.0 or later --- .../repos/builtin/packages/dealii/package.py | 93 ++++++++++--------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 9c09b205a8..c871059075 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -228,54 +228,55 @@ def install(self, spec, prefix): # take step-40 which can use both PETSc and Trilinos # FIXME: switch step-40 to MPI run - with working_dir('examples/step-40'): - print('=====================================') - print('========== Step-40 PETSc ============') - print('=====================================') - # list the number of cycles to speed up - filter_file(r'(const unsigned int n_cycles = 8;)', - ('const unsigned int n_cycles = 2;'), 'step-40.cc') - cmake('.') - if '^petsc' in spec: - make('release') - make('run', parallel=False) + if spec.satisfies('@8.4.0:'): + with working_dir('examples/step-40'): + print('=====================================') + print('========== Step-40 PETSc ============') + print('=====================================') + # list the number of cycles to speed up + filter_file(r'(const unsigned int n_cycles = 8;)', + ('const unsigned int n_cycles = 2;'), 'step-40.cc') + cmake('.') + if '^petsc' in spec: + make('release') + make('run', parallel=False) + + print('=====================================') + print('========= Step-40 Trilinos ==========') + print('=====================================') + # change Linear Algebra to Trilinos + filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', + ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') + if '^trilinos+hypre' in spec: + make('release') + make('run', parallel=False) - print('=====================================') - print('========= Step-40 Trilinos ==========') - print('=====================================') - # change Linear Algebra to Trilinos - filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', - ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') - if '^trilinos+hypre' in spec: - make('release') - make('run', parallel=False) + print('=====================================') + print('=== Step-40 Trilinos SuperluDist ====') + print('=====================================') + # change to direct solvers + filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') # NOQA: ignore=E501 + filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', + (''), 'step-40.cc') + filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', + (''), 'step-40.cc') + filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', + (''), 'step-40.cc') + filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') # NOQA: ignore=E501 + filter_file(r'(preconditioner\);)', (''), 'step-40.cc') + if '^trilinos+superlu-dist' in spec: + make('release') + make('run', paralle=False) - print('=====================================') - print('=== Step-40 Trilinos SuperluDist ====') - print('=====================================') - # change to direct solvers - filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') # NOQA: ignore=E501 - filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', - (''), 'step-40.cc') - filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', - (''), 'step-40.cc') - filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', - (''), 'step-40.cc') - filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') # NOQA: ignore=E501 - filter_file(r'(preconditioner\);)', (''), 'step-40.cc') - if '^trilinos+superlu-dist' in spec: - make('release') - make('run', paralle=False) - - print('=====================================') - print('====== Step-40 Trilinos MUMPS =======') - print('=====================================') - # switch to Mumps - filter_file(r'(Amesos_Superludist)', - ('Amesos_Mumps'), 'step-40.cc') - if '^trilinos+mumps' in spec: - make('release') - make('run', parallel=False) + print('=====================================') + print('====== Step-40 Trilinos MUMPS =======') + print('=====================================') + # switch to Mumps + filter_file(r'(Amesos_Superludist)', + ('Amesos_Mumps'), 'step-40.cc') + if '^trilinos+mumps' in spec: + make('release') + make('run', parallel=False) print('=====================================') print('============ Step-36 ================') From 4f591a6fe3f2fc1477d5b740d1eb9e56a37d56b3 Mon Sep 17 00:00:00 2001 From: Ali Dorostkar Date: Mon, 30 May 2016 16:42:24 +0200 Subject: [PATCH 2/5] Step-40 test for 8.3.0 and earlier Integrated part of step-40 to be tested for earlier versions of dealii --- .../repos/builtin/packages/dealii/package.py | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index c871059075..e83347409e 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -228,29 +228,33 @@ def install(self, spec, prefix): # take step-40 which can use both PETSc and Trilinos # FIXME: switch step-40 to MPI run - if spec.satisfies('@8.4.0:'): - with working_dir('examples/step-40'): - print('=====================================') - print('========== Step-40 PETSc ============') - print('=====================================') - # list the number of cycles to speed up - filter_file(r'(const unsigned int n_cycles = 8;)', - ('const unsigned int n_cycles = 2;'), 'step-40.cc') - cmake('.') - if '^petsc' in spec: - make('release') - make('run', parallel=False) - - print('=====================================') - print('========= Step-40 Trilinos ==========') - print('=====================================') - # change Linear Algebra to Trilinos + with working_dir('examples/step-40'): + print('=====================================') + print('========== Step-40 PETSc ============') + print('=====================================') + # list the number of cycles to speed up + filter_file(r'(const unsigned int n_cycles = 8;)', + ('const unsigned int n_cycles = 2;'), 'step-40.cc') + cmake('.') + if '^petsc' in spec: + make('release') + make('run', parallel=False) + + print('=====================================') + print('========= Step-40 Trilinos ==========') + print('=====================================') + # change Linear Algebra to Trilinos + if spec.satisfies('@8.4.0:'): filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') - if '^trilinos+hypre' in spec: - make('release') - make('run', parallel=False) + else: + filter_file(r'(#define USE_PETSC_LA.*)', + ('// #define USE_PETSC_LA'), 'step-40.cc') + if '^trilinos+hypre' in spec: + make('release') + make('run', parallel=False) + if spec.satisfies('@8.4.0:'): print('=====================================') print('=== Step-40 Trilinos SuperluDist ====') print('=====================================') From c4d5bd13c7596577bef119dcac2b83e213a92ce5 Mon Sep 17 00:00:00 2001 From: Ali Dorostkar Date: Mon, 30 May 2016 18:11:34 +0200 Subject: [PATCH 3/5] dealii, Added comment Added comment for why step-40 is done differently for dealii 8.4.0 and later --- var/spack/repos/builtin/packages/dealii/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index e83347409e..2b148da074 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -244,6 +244,8 @@ def install(self, spec, prefix): print('========= Step-40 Trilinos ==========') print('=====================================') # change Linear Algebra to Trilinos + # The below filter_file should be different for versions + # before and after 8.4.0 if spec.satisfies('@8.4.0:'): filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') @@ -254,6 +256,8 @@ def install(self, spec, prefix): make('release') make('run', parallel=False) + # the rest of the tests on step 40 only works for + # dealii version 8.4.0 and after if spec.satisfies('@8.4.0:'): print('=====================================') print('=== Step-40 Trilinos SuperluDist ====') From e82fb5b58f4ccdf7a4bfcda0331b4649dec3de75 Mon Sep 17 00:00:00 2001 From: Ali Dorostkar Date: Tue, 31 May 2016 08:44:46 +0200 Subject: [PATCH 4/5] Fixed spacing Replaced tabs with spaces --- var/spack/repos/builtin/packages/dealii/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 2b148da074..35658c75a0 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -244,8 +244,8 @@ def install(self, spec, prefix): print('========= Step-40 Trilinos ==========') print('=====================================') # change Linear Algebra to Trilinos - # The below filter_file should be different for versions - # before and after 8.4.0 + # The below filter_file should be different for versions + # before and after 8.4.0 if spec.satisfies('@8.4.0:'): filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') @@ -256,8 +256,8 @@ def install(self, spec, prefix): make('release') make('run', parallel=False) - # the rest of the tests on step 40 only works for - # dealii version 8.4.0 and after + # the rest of the tests on step 40 only works for + # dealii version 8.4.0 and after if spec.satisfies('@8.4.0:'): print('=====================================') print('=== Step-40 Trilinos SuperluDist ====') From 6f96484f83dff008ef8712c63202ee140000ff22 Mon Sep 17 00:00:00 2001 From: Ali Dorostkar Date: Tue, 31 May 2016 09:58:29 +0200 Subject: [PATCH 5/5] Spacing correction More spacing correction --- var/spack/repos/builtin/packages/dealii/package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 35658c75a0..54b6426d36 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -244,8 +244,8 @@ def install(self, spec, prefix): print('========= Step-40 Trilinos ==========') print('=====================================') # change Linear Algebra to Trilinos - # The below filter_file should be different for versions - # before and after 8.4.0 + # The below filter_file should be different for versions + # before and after 8.4.0 if spec.satisfies('@8.4.0:'): filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') @@ -256,8 +256,8 @@ def install(self, spec, prefix): make('release') make('run', parallel=False) - # the rest of the tests on step 40 only works for - # dealii version 8.4.0 and after + # the rest of the tests on step 40 only works for + # dealii version 8.4.0 and after if spec.satisfies('@8.4.0:'): print('=====================================') print('=== Step-40 Trilinos SuperluDist ====')