From 6995fed23e7c6dbd0306dc00827e66fa49ab882a Mon Sep 17 00:00:00 2001 From: jgp Date: Wed, 5 Jun 2019 16:37:54 +0200 Subject: [PATCH 1/3] jacobi --- .../tools/profiling_and_debugging/notool.py | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/cscs-checks/tools/profiling_and_debugging/notool.py b/cscs-checks/tools/profiling_and_debugging/notool.py index e043ff89f7..8874d0a7dd 100644 --- a/cscs-checks/tools/profiling_and_debugging/notool.py +++ b/cscs-checks/tools/profiling_and_debugging/notool.py @@ -5,14 +5,12 @@ from reframe.core.fields import ScopedDict -@rfm.required_version('>=2.14') @rfm.parameterized_test(['C++'], ['F90']) class JacobiNoToolHybrid(rfm.RegressionTest): def __init__(self, lang): super().__init__() - self.name = '%s_%s' % (type(self).__name__, lang.replace('+', 'p')) self.descr = 'Jacobi (without tool) %s check' % lang - self.language = lang + self.name = '%s_%s' % (type(self).__name__, lang.replace('+', 'p')) self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] @@ -23,8 +21,8 @@ def __init__(self, lang): 'PrgEnv-pgi': ['-O2', '-g', '-mp'] } self.sourcesdir = os.path.join('src', lang) - self.executable = './jacobi' self.build_system = 'Make' + self.executable = './jacobi' # NOTE: Restrict concurrency to allow creation of Fortran modules if lang == 'F90': self.build_system.max_concurrency = 1 @@ -32,57 +30,70 @@ def __init__(self, lang): self.num_tasks = 3 self.num_tasks_per_node = 3 self.num_cpus_per_task = 4 - self.num_iterations = 200 + self.num_tasks_per_core = 1 + self.use_multithreading = False + self.num_iterations = 100 self.variables = { 'OMP_NUM_THREADS': str(self.num_cpus_per_task), 'ITERATIONS': str(self.num_iterations), 'OMP_PROC_BIND': 'true', 'CRAYPE_LINK_TYPE': 'dynamic' } + # OpenMP support varies between compilers: self.openmp_versions = ScopedDict({ 'PrgEnv-cray': {'version': 201511}, 'PrgEnv-gnu': {'version': 201511}, 'PrgEnv-intel': {'version': 201611}, 'PrgEnv-pgi': {'version': 201307}, }) - # a scopedict is better than this: - # if (self.language == 'C++' and + self.lang = lang + # The scopedict (above) is better than this: + # if (self.lang == 'C++' and # self.current_environ.name == 'PrgEnv-pgi'): # self.omp_versions['PrgEnv-pgi'] = '200805' - + self.maintainers = ['JG', 'MK'] + self.tags = {'production'} + if self.current_system.name in {'dom', 'daint'}: + # get general info about the environment: + self.post_run = ['module list -t'] self.perf_patterns = { 'elapsed_time': sn.extractsingle(r'Elapsed Time\s*:\s+(\S+)', self.stdout, 1, float) } - self.reference_prgenv = { - 'PrgEnv-gnu': (0.90, -0.6, None), - 'PrgEnv-cray': (0.90, -0.6, None), - 'PrgEnv-intel': (0.90, -0.6, None), - 'PrgEnv-pgi': (18.0, -0.6, None), - } self.reference = { '*': { - 'elapsed_time': (0, None, None) + 'elapsed_time': (0, None, None, 'seconds') } } - self.post_run = ['module list -t'] - - self.maintainers = ['JG', 'MK'] - self.tags = {'production'} + if lang == 'C++': + self.reference_prgenv = { + 'PrgEnv-cray': (0.38, -0.6, None, 'seconds'), + 'PrgEnv-gnu': (0.38, -0.6, None, 'seconds'), + 'PrgEnv-intel': (0.38, -0.6, None, 'seconds'), + 'PrgEnv-pgi': (18.0, -0.6, None, 'seconds'), + } + elif lang == 'F90': + self.reference_prgenv = { + 'PrgEnv-cray': (0.17, -0.6, None, 'seconds'), + 'PrgEnv-gnu': (0.17, -0.6, None, 'seconds'), + 'PrgEnv-intel': (0.17, -0.6, None, 'seconds'), + 'PrgEnv-pgi': (18.0, -0.6, None, 'seconds'), + } def setup(self, partition, environ, **job_opts): super().setup(partition, environ, **job_opts) - environ_name = self.current_environ.name - prgenv_flags = self.prgenv_flags[environ_name] + envname = self.current_environ.name + prgenv_flags = self.prgenv_flags[envname] self.build_system.cflags = prgenv_flags self.build_system.cxxflags = prgenv_flags self.build_system.fflags = prgenv_flags self.build_system.ldflags = ['-lm'] - found_version = sn.extractsingle( - r'OpenMP-\s*(\d+)', self.stdout, 1, int) - ompversion_key = '%s:%s:version' % (environ_name, self.language) + found_version = sn.extractsingle(r'OpenMP-\s*(\d+)', self.stdout, 1, + int) + ompversion_key = '%s:%s:version' % (envname, self.lang) self.sanity_patterns = sn.all([ sn.assert_eq(found_version, self.openmp_versions[ompversion_key]), sn.assert_found('SUCCESS', self.stdout), ]) - self.reference['*:elapsed_time'] = self.reference_prgenv[environ_name] + if self.current_system.name in {'dom', 'daint'}: + self.reference['*:elapsed_time'] = self.reference_prgenv[envname] From 7924290da6343608a367f6192468344aa004528b Mon Sep 17 00:00:00 2001 From: jgp Date: Thu, 6 Jun 2019 10:27:28 +0200 Subject: [PATCH 2/3] fix for reviewer --- .../tools/profiling_and_debugging/notool.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cscs-checks/tools/profiling_and_debugging/notool.py b/cscs-checks/tools/profiling_and_debugging/notool.py index 8874d0a7dd..09f1f7dbcd 100644 --- a/cscs-checks/tools/profiling_and_debugging/notool.py +++ b/cscs-checks/tools/profiling_and_debugging/notool.py @@ -62,28 +62,28 @@ def __init__(self, lang): } self.reference = { '*': { - 'elapsed_time': (0, None, None, 'seconds') + 'elapsed_time': (0, None, None, 's') } } if lang == 'C++': self.reference_prgenv = { - 'PrgEnv-cray': (0.38, -0.6, None, 'seconds'), - 'PrgEnv-gnu': (0.38, -0.6, None, 'seconds'), - 'PrgEnv-intel': (0.38, -0.6, None, 'seconds'), - 'PrgEnv-pgi': (18.0, -0.6, None, 'seconds'), + 'PrgEnv-cray': (0.38, -0.6, None, 's'), + 'PrgEnv-gnu': (0.38, -0.6, None, 's'), + 'PrgEnv-intel': (0.38, -0.6, None, 's'), + 'PrgEnv-pgi': (18.0, -0.6, None, 's'), } elif lang == 'F90': self.reference_prgenv = { - 'PrgEnv-cray': (0.17, -0.6, None, 'seconds'), - 'PrgEnv-gnu': (0.17, -0.6, None, 'seconds'), - 'PrgEnv-intel': (0.17, -0.6, None, 'seconds'), - 'PrgEnv-pgi': (18.0, -0.6, None, 'seconds'), + 'PrgEnv-cray': (0.17, -0.6, None, 's'), + 'PrgEnv-gnu': (0.17, -0.6, None, 's'), + 'PrgEnv-intel': (0.17, -0.6, None, 's'), + 'PrgEnv-pgi': (18.0, -0.6, None, 's'), } def setup(self, partition, environ, **job_opts): super().setup(partition, environ, **job_opts) envname = self.current_environ.name - prgenv_flags = self.prgenv_flags[envname] + prgenv_flags = self.prgenv_flags.get(envname, ['-g']) self.build_system.cflags = prgenv_flags self.build_system.cxxflags = prgenv_flags self.build_system.fflags = prgenv_flags From 5ed0e4596193b844d4c1ed492ee10255b2f5c77d Mon Sep 17 00:00:00 2001 From: jgp Date: Thu, 6 Jun 2019 10:50:12 +0200 Subject: [PATCH 3/3] fix for reviewer --- cscs-checks/tools/profiling_and_debugging/notool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cscs-checks/tools/profiling_and_debugging/notool.py b/cscs-checks/tools/profiling_and_debugging/notool.py index 09f1f7dbcd..e4ac6e2bcb 100644 --- a/cscs-checks/tools/profiling_and_debugging/notool.py +++ b/cscs-checks/tools/profiling_and_debugging/notool.py @@ -83,6 +83,7 @@ def __init__(self, lang): def setup(self, partition, environ, **job_opts): super().setup(partition, environ, **job_opts) envname = self.current_environ.name + # if generic, falls back to -g: prgenv_flags = self.prgenv_flags.get(envname, ['-g']) self.build_system.cflags = prgenv_flags self.build_system.cxxflags = prgenv_flags