From 702824145533e3de37d0cc5458fedda593a00859 Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Tue, 24 Aug 2021 15:26:32 +0200 Subject: [PATCH 1/4] Update syntax of FFTWTest --- .../microbenchmarks/cpu/fft/fftw_benchmark.py | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py index f1bcbfaa68..3bb0e472bf 100644 --- a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py +++ b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py @@ -7,28 +7,41 @@ import reframe.utility.sanity as sn -@rfm.parameterized_test(['nompi'], ['mpi']) +@rfm.simple_test class FFTWTest(rfm.RegressionTest): - def __init__(self, exec_mode): - self.sourcepath = 'fftw_benchmark.c' - self.build_system = 'SingleSource' - self.valid_systems = ['daint:gpu', 'dom:gpu'] - - # Cray FFTW library is not officially supported for the PGI - self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu'] - self.modules = ['cray-fftw'] - self.num_tasks_per_node = 12 - self.num_gpus_per_node = 0 - self.sanity_patterns = sn.assert_eq( - sn.count(sn.findall(r'execution time', self.stdout)), 1) - self.build_system.cflags = ['-O2'] + exec_mode = parameter(['nompi', 'mpi']) + sourcepath = 'fftw_benchmark.c' + build_system = 'SingleSource' + valid_systems = ['daint:gpu', 'dom:gpu'] + # Cray FFTW library is not officially supported for the PGI + valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu'] + modules = ['cray-fftw'] + num_tasks_per_node = 12 + num_gpus_per_node = 0 + maintainers = ['AJ'] + tags = {'benchmark', 'scs', 'craype'} + + @run_before('performance') + def set_performance(self): self.perf_patterns = { 'fftw_exec_time': sn.extractsingle( r'execution time:\s+(?P\S+)', self.stdout, 'exec_time', float), } - if exec_mode == 'nompi': + @sanity_function + def found_execution_time(self): + return sn.assert_eq( + sn.count(sn.findall(r'execution time', self.stdout)), 1 + ) + + @run_before('compile') + def set_cflags(self): + self.build_system.cflags = ['-O2'] + + @run_after('init') + def configure_mode(self): + if self.exec_mode == 'nompi': self.num_tasks = 12 self.executable_opts = ['72 12 1000 0'] self.reference = { @@ -51,5 +64,3 @@ def __init__(self, exec_mode): }, } - self.maintainers = ['AJ'] - self.tags = {'benchmark', 'scs', 'craype'} From 965c5e886308491eebe6da6f994a4323038516db Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Wed, 25 Aug 2021 11:50:21 +0200 Subject: [PATCH 2/4] Update performance patterns --- .../microbenchmarks/cpu/fft/fftw_benchmark.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py index 3bb0e472bf..1afc7cf2e0 100644 --- a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py +++ b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py @@ -21,13 +21,12 @@ class FFTWTest(rfm.RegressionTest): maintainers = ['AJ'] tags = {'benchmark', 'scs', 'craype'} - @run_before('performance') - def set_performance(self): - self.perf_patterns = { - 'fftw_exec_time': sn.extractsingle( - r'execution time:\s+(?P\S+)', self.stdout, - 'exec_time', float), - } + @performance_function('s') + def fftw_exec_time(self): + return sn.extractsingle( + r'execution time:\s+(?P\S+)', self.stdout, + 'exec_time', float + ) @sanity_function def found_execution_time(self): From dea458413fc920db30411ede3e4948ceeac9fe90 Mon Sep 17 00:00:00 2001 From: ekouts Date: Wed, 25 Aug 2021 12:54:26 +0200 Subject: [PATCH 3/4] Update cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py Co-authored-by: Theofilos Manitaras --- cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py index 1afc7cf2e0..a871ca7ce9 100644 --- a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py +++ b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py @@ -38,7 +38,7 @@ def found_execution_time(self): def set_cflags(self): self.build_system.cflags = ['-O2'] - @run_after('init') + @run_before('run') def configure_mode(self): if self.exec_mode == 'nompi': self.num_tasks = 12 From 1fc8794d7d4667b6850ab6884c4c4c29e23a3ed2 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Wed, 25 Aug 2021 22:54:06 +0200 Subject: [PATCH 4/4] Minor style enhancements --- cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py index a871ca7ce9..2e9ab0bf72 100644 --- a/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py +++ b/cscs-checks/microbenchmarks/cpu/fft/fftw_benchmark.py @@ -29,7 +29,7 @@ def fftw_exec_time(self): ) @sanity_function - def found_execution_time(self): + def assert_finished(self): return sn.assert_eq( sn.count(sn.findall(r'execution time', self.stdout)), 1 ) @@ -39,7 +39,7 @@ def set_cflags(self): self.build_system.cflags = ['-O2'] @run_before('run') - def configure_mode(self): + def configure_exec_mode(self): if self.exec_mode == 'nompi': self.num_tasks = 12 self.executable_opts = ['72 12 1000 0'] @@ -62,4 +62,3 @@ def configure_mode(self): 'fftw_exec_time': (0.47, None, 0.50, 's'), }, } -