From 7998363a0c4f3a7300ab63c13808079fcdaa9835 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 3 Aug 2018 11:40:49 +0200 Subject: [PATCH 1/2] Adapt dgemm test to use build systems * Adapt dgemm test to use the build systems future. * Adapt dgemm to the new syntax. --- cscs-checks/libraries/math/dgemm.py | 37 ++++++++++++----------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/cscs-checks/libraries/math/dgemm.py b/cscs-checks/libraries/math/dgemm.py index c28ffcb103..e7f70c2768 100644 --- a/cscs-checks/libraries/math/dgemm.py +++ b/cscs-checks/libraries/math/dgemm.py @@ -1,31 +1,30 @@ -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, name): + super().__init__() + self.name = 'DGEMM_' + name self.descr = 'DGEMM performance test' self.sourcepath = 'dgemm.c' self.executable_opts = ['5000', '5000', '5000'] - self.cflags = None - self.ldflags = None + self.build_system = 'SingleSource' + self.build_system.cflags = self.cflags + self.build_system.ldflags = self.ldflags 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): + self.cflags = ['-O3', '-I$EBROOTOPENBLAS/include'] + self.ldflags = ['-L$EBROOTOPENBLAS/lib', '-lopenblas', '-lpthread', + '-lgfortran'] + super().__init__('Monch') self.tags = {'monch_acceptance'} self.valid_systems = ['monch:compute'] self.valid_prog_environs = ['PrgEnv-gnu'] @@ -35,8 +34,6 @@ 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' @@ -52,7 +49,3 @@ def __init__(self, **kwargs): 'perf': (350, -0.1, None) } } - - -def _get_checks(**kwargs): - return [DGEMMTestMonch(**kwargs)] From 7fd3c4a226ae68ba536bb061096e4965c8afdef1 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 9 Aug 2018 10:53:36 +0200 Subject: [PATCH 2/2] Address PR comments --- cscs-checks/libraries/math/dgemm.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cscs-checks/libraries/math/dgemm.py b/cscs-checks/libraries/math/dgemm.py index e7f70c2768..852bc90b3d 100644 --- a/cscs-checks/libraries/math/dgemm.py +++ b/cscs-checks/libraries/math/dgemm.py @@ -3,15 +3,11 @@ class DGEMMTest(rfm.RegressionTest): - def __init__(self, name): + def __init__(self): super().__init__() - self.name = 'DGEMM_' + name self.descr = 'DGEMM performance test' self.sourcepath = 'dgemm.c' self.executable_opts = ['5000', '5000', '5000'] - self.build_system = 'SingleSource' - self.build_system.cflags = self.cflags - self.build_system.ldflags = self.ldflags self.sanity_patterns = sn.assert_found( r'Time for \d+ DGEMM operations', self.stdout) self.maintainers = ['AJ'] @@ -21,10 +17,7 @@ def __init__(self, name): @rfm.simple_test class DGEMMTestMonch(DGEMMTest): def __init__(self): - self.cflags = ['-O3', '-I$EBROOTOPENBLAS/include'] - self.ldflags = ['-L$EBROOTOPENBLAS/lib', '-lopenblas', '-lpthread', - '-lgfortran'] - super().__init__('Monch') + super().__init__() self.tags = {'monch_acceptance'} self.valid_systems = ['monch:compute'] self.valid_prog_environs = ['PrgEnv-gnu'] @@ -38,6 +31,10 @@ def __init__(self): '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+',