From 2d6be1f8975cc6fa5c4fff4a6f2a02ccc8a408ef Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Mon, 20 Aug 2018 07:54:11 +0200 Subject: [PATCH 1/4] Adapt trilinos to build systems --- .../libraries/math/trilinos_compile_run.py | 54 ++++++++----------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 3d6ae95a4d..935bba3992 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -1,28 +1,13 @@ import os -import reframe.utility.sanity as sn - -from reframe.core.pipeline import RegressionTest +import reframe as rfm +import reframe.utility.sanity as sn -class TrilinosTest(RegressionTest): - def __init__(self, linkage, **kwargs): - super().__init__('trilinos_compile_run_%s' % linkage, - os.path.dirname(__file__), **kwargs) - - self.flags = ' -DHAVE_MPI -DEPETRA_MPI -lparmetis -%s ' % linkage - self.prgenv_flags = { - 'PrgEnv-cray': ' -homp -hstd=c++11 -hmsglevel_4 ', - 'PrgEnv-gnu': ' -fopenmp -std=c++11 -w -fpermissive ', - 'PrgEnv-intel': ' -qopenmp -w -std=c++11 ', - 'PrgEnv-pgi': ' -mp -w ' - } - self.descr = 'Trilinos ' + linkage.capitalize() - self.sourcepath = 'example_AmesosFactory_HB.cpp' - #self.sourcepath = 'trilinos_compile_run.cpp' - self.input_file = os.path.join(self.current_system.resourcesdir, - 'Trilinos', 'trilinos_compile_run.rua') - self.executable_opts = self.input_file.split() +@rfm.parameterized_test(['static'], ['dynamic']) +class TrilinosTest(rfm.RegressionTest): + def __init__(self, linkage): + super().__init__() self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] @@ -33,6 +18,21 @@ def __init__(self, linkage, **kwargs): self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel'] + self.build_system = 'SingleSource' + self.build_system.ldflags = ['-%s' % linkage] + self.build_system.cppflags = ['-DHAVE_MPI', '-DEPETRA_MPI'] + self.build_system.cxxflags = ['-lparmetis'] + self.prgenv_flags = { + 'PrgEnv-cray': ['-homp', '-hstd=c++11', '-hmsglevel_4'], + 'PrgEnv-gnu': ['-fopenmp', '-std=c++11', '-w', '-fpermissive'], + 'PrgEnv-intel': ['-qopenmp', '-w', '-std=c++11'], + 'PrgEnv-pgi': ['-mp', '-w'] + } + self.sourcepath = 'example_AmesosFactory_HB.cpp' + # self.sourcepath = 'trilinos_compile_run.cpp' + input_file = os.path.join(self.current_system.resourcesdir, + 'Trilinos', 'trilinos_compile_run.rua') + self.executable_opts = input_file.split() self.modules = ['cray-mpich', 'cray-hdf5-parallel', 'cray-tpsl', 'cray-trilinos'] self.num_tasks = 2 @@ -45,18 +45,10 @@ def __init__(self, linkage, **kwargs): self.tags = {'production'} def setup(self, partition, environ, **job_opts): + prgenv_flags = self.prgenv_flags[environ.name] + self.build_system.cxxflags += prgenv_flags if environ.name == 'PrgEnv-intel': # CrayBug/836679 self.modules += ['gcc/4.9.3'] super().setup(partition, environ, **job_opts) - - def compile(self): - prgenv_flags = self.prgenv_flags[self.current_environ.name] - self.current_environ.cxxflags = self.flags + prgenv_flags - super().compile() - - -def _get_checks(**kwargs): - return [TrilinosTest('dynamic', **kwargs), - TrilinosTest('static', **kwargs)] From 0a1304ccd06bceada62961f9a78f23c0bd6bf5bc Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Wed, 19 Sep 2018 10:31:36 +0200 Subject: [PATCH 2/4] Change the cray-trilinos module version --- cscs-checks/libraries/math/trilinos_compile_run.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 935bba3992..0e8623c4f9 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -11,10 +11,11 @@ def __init__(self, linkage): self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] - # Removed CRAY env in dynamic because of CrayBug/809265 - if linkage == 'dynamic': + # NOTE: PrgEnv-cray in dynamic does not work because of CrayBug/809265 + # PrgEnv-cray seg faults for cray-trilinos/12.12.1.1 + if linkage == 'static': self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-intel'] - elif linkage == 'static': + else: self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel'] @@ -29,12 +30,13 @@ def __init__(self, linkage): 'PrgEnv-pgi': ['-mp', '-w'] } self.sourcepath = 'example_AmesosFactory_HB.cpp' - # self.sourcepath = 'trilinos_compile_run.cpp' input_file = os.path.join(self.current_system.resourcesdir, 'Trilinos', 'trilinos_compile_run.rua') self.executable_opts = input_file.split() + + # NOTE: default cray-trilinos module in PE/18.08 does not work self.modules = ['cray-mpich', 'cray-hdf5-parallel', - 'cray-tpsl', 'cray-trilinos'] + 'cray-tpsl', 'cray-trilinos/12.12.1.1'] self.num_tasks = 2 self.num_tasks_per_node = 2 self.variables = {'OMP_NUM_THREADS': '1'} @@ -49,6 +51,6 @@ def setup(self, partition, environ, **job_opts): self.build_system.cxxflags += prgenv_flags if environ.name == 'PrgEnv-intel': # CrayBug/836679 - self.modules += ['gcc/4.9.3'] + self.modules += ['gcc'] super().setup(partition, environ, **job_opts) From d7b550dd421de87999ee654de73320370a62101e Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Wed, 19 Sep 2018 13:10:17 +0200 Subject: [PATCH 3/4] Address PR comments --- cscs-checks/libraries/math/trilinos_compile_run.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 0e8623c4f9..1111edb30d 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -12,7 +12,6 @@ def __init__(self, linkage): 'dom:gpu', 'dom:mc'] # NOTE: PrgEnv-cray in dynamic does not work because of CrayBug/809265 - # PrgEnv-cray seg faults for cray-trilinos/12.12.1.1 if linkage == 'static': self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-intel'] else: @@ -20,9 +19,8 @@ def __init__(self, linkage): 'PrgEnv-intel'] self.build_system = 'SingleSource' - self.build_system.ldflags = ['-%s' % linkage] + self.build_system.ldflags = ['-%s' % linkage, '-lparmetis'] self.build_system.cppflags = ['-DHAVE_MPI', '-DEPETRA_MPI'] - self.build_system.cxxflags = ['-lparmetis'] self.prgenv_flags = { 'PrgEnv-cray': ['-homp', '-hstd=c++11', '-hmsglevel_4'], 'PrgEnv-gnu': ['-fopenmp', '-std=c++11', '-w', '-fpermissive'], @@ -32,7 +30,7 @@ def __init__(self, linkage): self.sourcepath = 'example_AmesosFactory_HB.cpp' input_file = os.path.join(self.current_system.resourcesdir, 'Trilinos', 'trilinos_compile_run.rua') - self.executable_opts = input_file.split() + self.executable_opts = [input_file] # NOTE: default cray-trilinos module in PE/18.08 does not work self.modules = ['cray-mpich', 'cray-hdf5-parallel', @@ -48,7 +46,7 @@ def __init__(self, linkage): def setup(self, partition, environ, **job_opts): prgenv_flags = self.prgenv_flags[environ.name] - self.build_system.cxxflags += prgenv_flags + self.build_system.cxxflags = prgenv_flags if environ.name == 'PrgEnv-intel': # CrayBug/836679 self.modules += ['gcc'] From 105fd917bf689ec39d885a9a8e866ff01a17cdab Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 20 Sep 2018 09:02:24 +0200 Subject: [PATCH 4/4] Allow static compilation check for PrgEnv-cray --- cscs-checks/libraries/math/trilinos_compile_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/libraries/math/trilinos_compile_run.py b/cscs-checks/libraries/math/trilinos_compile_run.py index 1111edb30d..3b4b7b5878 100644 --- a/cscs-checks/libraries/math/trilinos_compile_run.py +++ b/cscs-checks/libraries/math/trilinos_compile_run.py @@ -12,7 +12,7 @@ def __init__(self, linkage): 'dom:gpu', 'dom:mc'] # NOTE: PrgEnv-cray in dynamic does not work because of CrayBug/809265 - if linkage == 'static': + if linkage == 'dynamic': self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-intel'] else: self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',