From 7d13178627b5616f61f3cecdba401b6aa1e75d75 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 28 Jun 2018 09:51:00 +0200 Subject: [PATCH 1/3] [test] Create flexible cuda-memtest check --- cscs-checks/cuda/cuda_memtest_check.py | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 cscs-checks/cuda/cuda_memtest_check.py diff --git a/cscs-checks/cuda/cuda_memtest_check.py b/cscs-checks/cuda/cuda_memtest_check.py new file mode 100644 index 0000000000..732d36bdc0 --- /dev/null +++ b/cscs-checks/cuda/cuda_memtest_check.py @@ -0,0 +1,46 @@ +import reframe as rfm +import reframe.utility.sanity as sn + + +@rfm.simple_test +class FlexibleCudaMemtest(rfm.RegressionTest): + def __init__(self): + super().__init__() + self.valid_systems = ['daint:gpu', 'dom:gpu'] + self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', + 'PrgEnv-intel', 'PrgEnv-pgi'] + self.descr = 'Flexible Cuda Memtest' + self.executable = 'osu_alltoall' + self.maintainers = ['TM', 'VK'] + self.tags = {'maintenance'} + self.num_tasks_per_node = 1 + self.num_tasks = 0 + self.num_gpus_per_node = 1 + self.modules = ['cudatoolkit'] + self.sourcesdir = None + src_url = ('https://downloads.sourceforge.net/project/cudagpumemtest/' + 'cuda_memtest-1.2.3.tar.gz') + self.prebuild_cmd = ['wget %s' % src_url, + 'tar -xzf cuda_memtest-1.2.3.tar.gz ' + '--strip-components=1'] + self.executable = 'cuda_memtest_sm20' + self.executable_opts = ['--disable_test', '6', '--num_passes', '1'] + + valid_test_ids = [i for i in range(11) if i not in {6, 9}] + assert_finished_tests = [sn.assert_eq(sn.count(sn.findall( + 'Test%s finished' % test_id, self.stdout)), + self.num_tasks_assigned) for test_id in valid_test_ids] + self.sanity_patterns = sn.all([ + *assert_finished_tests, + sn.assert_not_found('(?i)ERROR', self.stdout), + sn.assert_not_found('(?i)ERROR', self.stderr)]) + + @property + @sn.sanity_function + def num_tasks_assigned(self): + return self.job.num_tasks + + def compile(self): + # Here we set the target executable since by default the Makefile + # builds both cuda_memtest_sm13 and cuda_memtest_sm20 + super().compile(options='cuda_memtest_sm20') From 32da0fffb516fc359e577287fdd15665db1cd135 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 28 Jun 2018 13:11:57 +0200 Subject: [PATCH 2/3] Address PR comments --- cscs-checks/cuda/cuda_memtest_check.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cscs-checks/cuda/cuda_memtest_check.py b/cscs-checks/cuda/cuda_memtest_check.py index 732d36bdc0..48f90a116b 100644 --- a/cscs-checks/cuda/cuda_memtest_check.py +++ b/cscs-checks/cuda/cuda_memtest_check.py @@ -10,9 +10,7 @@ def __init__(self): self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] self.descr = 'Flexible Cuda Memtest' - self.executable = 'osu_alltoall' self.maintainers = ['TM', 'VK'] - self.tags = {'maintenance'} self.num_tasks_per_node = 1 self.num_tasks = 0 self.num_gpus_per_node = 1 @@ -20,16 +18,20 @@ def __init__(self): self.sourcesdir = None src_url = ('https://downloads.sourceforge.net/project/cudagpumemtest/' 'cuda_memtest-1.2.3.tar.gz') - self.prebuild_cmd = ['wget %s' % src_url, - 'tar -xzf cuda_memtest-1.2.3.tar.gz ' - '--strip-components=1'] + self.prebuild_cmd = [ + 'wget %s' % src_url, + 'tar -xzf cuda_memtest-1.2.3.tar.gz --strip-components=1' + ] self.executable = 'cuda_memtest_sm20' self.executable_opts = ['--disable_test', '6', '--num_passes', '1'] - valid_test_ids = [i for i in range(11) if i not in {6, 9}] - assert_finished_tests = [sn.assert_eq(sn.count(sn.findall( - 'Test%s finished' % test_id, self.stdout)), - self.num_tasks_assigned) for test_id in valid_test_ids] + valid_test_ids = {i for i in range(11) if i not in {6, 9}} + assert_finished_tests = [ + sn.assert_eq( + sn.count(sn.findall('Test%s finished' % test_id, self.stdout)), + self.num_tasks_assigned) + for test_id in valid_test_ids + ] self.sanity_patterns = sn.all([ *assert_finished_tests, sn.assert_not_found('(?i)ERROR', self.stdout), From df90773327fbf51e3afadb9631e87f7bb7b5f83e Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 28 Jun 2018 15:23:27 +0200 Subject: [PATCH 3/3] Address PR comments (version 2) --- cscs-checks/cuda/cuda_memtest_check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cscs-checks/cuda/cuda_memtest_check.py b/cscs-checks/cuda/cuda_memtest_check.py index 48f90a116b..8eebc1daf2 100644 --- a/cscs-checks/cuda/cuda_memtest_check.py +++ b/cscs-checks/cuda/cuda_memtest_check.py @@ -7,8 +7,7 @@ class FlexibleCudaMemtest(rfm.RegressionTest): def __init__(self): super().__init__() self.valid_systems = ['daint:gpu', 'dom:gpu'] - self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', - 'PrgEnv-intel', 'PrgEnv-pgi'] + self.valid_prog_environs = ['PrgEnv-cray'] self.descr = 'Flexible Cuda Memtest' self.maintainers = ['TM', 'VK'] self.num_tasks_per_node = 1 @@ -44,5 +43,6 @@ def num_tasks_assigned(self): def compile(self): # Here we set the target executable since by default the Makefile - # builds both cuda_memtest_sm13 and cuda_memtest_sm20 + # builds both cuda_memtest_sm13 and cuda_memtest_sm20. + # sm20 is the maximum gpu architecture supported by cuda memtest. super().compile(options='cuda_memtest_sm20')