diff --git a/cscs-checks/libraries/math/dgemm.py b/cscs-checks/libraries/math/dgemm.py index c28ffcb103..852bc90b3d 100644 --- a/cscs-checks/libraries/math/dgemm.py +++ b/cscs-checks/libraries/math/dgemm.py @@ -1,31 +1,23 @@ -import os +import reframe as rfm import reframe.utility.sanity as sn -from reframe.core.pipeline import RegressionTest - -class DGEMMTest(RegressionTest): - def __init__(self, name, **kwargs): - super().__init__('DGEMM_' + name, os.path.dirname(__file__), **kwargs) +class DGEMMTest(rfm.RegressionTest): + def __init__(self): + super().__init__() self.descr = 'DGEMM performance test' self.sourcepath = 'dgemm.c' self.executable_opts = ['5000', '5000', '5000'] - self.cflags = None - self.ldflags = None self.sanity_patterns = sn.assert_found( - 'Time for \d+ DGEMM operations', self.stdout) + r'Time for \d+ DGEMM operations', self.stdout) self.maintainers = ['AJ'] self.tags = {'production'} - def compile(self): - self.current_environ.cflags = self.cflags - self.current_environ.ldflags = self.ldflags - super().compile() - +@rfm.simple_test class DGEMMTestMonch(DGEMMTest): - def __init__(self, **kwargs): - super().__init__('Monch', **kwargs) + def __init__(self): + super().__init__() self.tags = {'monch_acceptance'} self.valid_systems = ['monch:compute'] self.valid_prog_environs = ['PrgEnv-gnu'] @@ -35,12 +27,14 @@ def __init__(self, **kwargs): self.num_cpus_per_task = 20 self.num_tasks_per_socket = 10 self.use_multithreading = False - self.cflags = '-O3 -I$EBROOTOPENBLAS/include' - self.ldflags = '-L$EBROOTOPENBLAS/lib -lopenblas -lpthread -lgfortran' self.variables = { 'OMP_NUM_THREADS': str(self.num_cpus_per_task), 'MV2_ENABLE_AFFINITY': '0' } + self.build_system = 'SingleSource' + self.build_system.cflags = ['-O3', '-I$EBROOTOPENBLAS/include'] + self.build_system.ldflags = ['-L$EBROOTOPENBLAS/lib', '-lopenblas', + '-lpthread', '-lgfortran'] self.perf_patterns = { 'perf': sn.max( sn.extractall(r'Run\s\d\s+:\s+(?P\S+)\s\S+', @@ -52,7 +46,3 @@ def __init__(self, **kwargs): 'perf': (350, -0.1, None) } } - - -def _get_checks(**kwargs): - return [DGEMMTestMonch(**kwargs)]