From 5f8c518802fcd25f8eedf68773f82339de1ada65 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 21 Aug 2018 09:15:26 +0200 Subject: [PATCH] Adapt libsci_resolve test to PE 18.07 * Adapt to new regression test syntax. * Adapt to build systems. --- cscs-checks/compile/libsci_resolve.py | 55 +++++++++++---------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/cscs-checks/compile/libsci_resolve.py b/cscs-checks/compile/libsci_resolve.py index 72a902c29f..3c634ea9d5 100644 --- a/cscs-checks/compile/libsci_resolve.py +++ b/cscs-checks/compile/libsci_resolve.py @@ -1,30 +1,26 @@ -import os - +import reframe as rfm import reframe.utility.sanity as sn -from reframe.core.pipeline import CompileOnlyRegressionTest -class LibSciResolveBaseTest(CompileOnlyRegressionTest): - def __init__(self, name, **kwargs): - super().__init__(name, os.path.dirname(__file__), **kwargs) +class LibSciResolveBaseTest(rfm.CompileOnlyRegressionTest): + def __init__(self): + super().__init__() self.sourcesdir = 'src/libsci_resolve' self.sourcepath = 'libsci_resolve.f90' self.valid_systems = ['daint:login', 'dom:login'] + self.modules = ['craype-haswell'] self.maintainers = ['AJ'] self.tags = {'production'} - def compile(self): - self.current_environ.fflags = self.flags - super().compile() - +@rfm.parameterized_test(['craype-accel-nvidia20'], ['craype-accel-nvidia35'], + ['craype-accel-nvidia60']) class Nvidia35ResolveTest(LibSciResolveBaseTest): - def __init__(self, module_name, **kwargs): - super().__init__('accel_nvidia35_resolves_to_libsci_acc_%s' % - module_name.replace('-', '_'), **kwargs) - + def __init__(self, module_name): + super().__init__() self.descr = 'Module %s resolves libsci_acc' % module_name - self.flags = ' -Wl,-ypdgemm_ ' + self.build_system = 'SingleSource' + self.build_system.fflags = ['-Wl,-ypdgemm_'] self.module_name = module_name self.module_version = { @@ -37,7 +33,10 @@ def __init__(self, module_name, **kwargs): 'daint': '49', } self.compiler_version_default = '49' - self.modules = [module_name] + self.modules = ['craype-haswell', module_name] + if module_name == 'craype-accel-nvidia20': + self.modules += ['cray-libsci_acc/17.03.1'] + self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu'] self.prgenv_names = { @@ -52,7 +51,6 @@ def setup(self, partition, environ, **job_opts): # libsci_acc_cray_nv35.so regex = (r'libsci_acc_(?P[A-Za-z]+)_((?P[A-Za-z0-9]+)_)?' r'(?P\S+)(?=(\.a)|(\.so))') - prgenv = self.prgenv_names[self.current_environ.name] cver = self.compiler_version.get(self.current_system.name, self.compiler_version_default) @@ -73,16 +71,14 @@ def setup(self, partition, environ, **job_opts): ]) +@rfm.simple_test class MKLResolveTest(LibSciResolveBaseTest): - def __init__(self, **kwargs): - super().__init__('mkl_resolves_to_mkl_intel', **kwargs) - + def __init__(self): + super().__init__() self.descr = '-mkl Resolves to MKL' - self.flags = ' -Wl,-ydgemm_ -mkl' - self.valid_prog_environs = ['PrgEnv-intel'] - self.maintainers = ['AJ'] - self.tags = {'production'} + self.build_system = 'SingleSource' + self.build_system.fflags = ['-Wl,-ydgemm_', '-mkl'] # interesting enough, on Dora the linking here is static. # So there is REAL need for the end term (?=(.a)|(.so)). @@ -96,12 +92,5 @@ def __init__(self, **kwargs): sn.extractsingle(regex, self.stderr, 'version'), 'lp64') ]) - -def _get_checks(**kwargs): - ret = [MKLResolveTest(**kwargs)] - nvidia_modules = ['craype-accel-nvidia20', 'craype-accel-nvidia35', - 'craype-accel-nvidia60'] - for module_name in nvidia_modules: - ret.append(Nvidia35ResolveTest(module_name, **kwargs)) - - return ret + self.maintainers = ['AJ'] + self.tags = {'production'}