From 9591d4c113f169f17b3bb97465af62225421e189 Mon Sep 17 00:00:00 2001 From: jgp Date: Thu, 13 Dec 2018 10:52:54 +0100 Subject: [PATCH 1/5] ipm --- .../profiling_and_debugging/ipm_mpi_omp.py | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py new file mode 100644 index 0000000000..fc93d8ef52 --- /dev/null +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -0,0 +1,79 @@ +import os + +import reframe as rfm +import reframe.utility.sanity as sn + + +@rfm.required_version('>=2.14') +@rfm.parameterized_test(['C'], ['C++'], ['F90']) +class Ipm(rfm.RegressionTest): + def __init__(self, lang): + super().__init__() + self.name = 'IPM_%s' % lang.replace('+', 'p') + self.descr = '%s check' % lang + self.language = lang + self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] + self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', + 'PrgEnv-intel', 'PrgEnv-pgi'] + self.prgenv_flags = { + 'PrgEnv-gnu' : ['-O2 -g -fopenmp'], + 'PrgEnv-cray' : ['-O2 -g -homp'], + 'PrgEnv-intel' : ['-O2 -g -openmp'], + 'PrgEnv-pgi' : ['-O2 -g -mp'] + } + self.ipm_modules = { + 'PrgEnv-gnu' : 'IPM/2.0.6-CrayGNU-18.08', + 'PrgEnv-cray' : 'IPM/2.0.6-CrayCCE-18.08', + 'PrgEnv-intel' : 'IPM/2.0.6-CrayIntel-18.08', + 'PrgEnv-pgi' : 'IPM/2.0.6-CrayPGI-18.08' + } + self.sourcesdir = os.path.join('src', lang) + self.executable = './jacobi' + self.build_system = 'Make' + if lang == 'F90': + self.build_system.max_concurrency = 1 + + self.time_limit = (0,2,0) + self.num_tasks = 3 + self.num_tasks_per_node = 3 + self.num_cpus_per_task = 4 + 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', + 'PKG_CONFIG_PATH': '$PAT_BUILD_PAPI_BASEDIR/lib64/pkgconfig:$PKG_CONFIG_PATH', + 'IPM_HPM': 'PAPI_L1_TCM,PAPI_L2_TCM,PAPI_L3_TCM', + } + self.txtrpt = 'ipm.rpt' + self.post_run = ['ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt] + self.post_run += ['ipm_parse.pl -html *.ipm.xml'] + self.post_run += ['cp *ipm.xml_ipm*/index.html .'] + self.maintainers = ['JG'] + self.tags = {'production'} + + def setup(self, partition, environ, **job_opts): + self.modules = [ self.ipm_modules[environ.name] ] + super().setup(partition, environ, **job_opts) + environ_name = self.current_environ.name + prgenv_flags = self.prgenv_flags[environ_name] + self.build_system.cflags = prgenv_flags + self.build_system.cxxflags = prgenv_flags + self.build_system.fflags = prgenv_flags + self.build_system.ldflags = ['-lm `pkg-config --libs papi` ${IPM}'] + + self.htmlrpt = 'index.html' + self.sanity_patterns = sn.all([ + # check the job: + sn.assert_found('SUCCESS', self.stdout), + # check the txt report: + sn.assert_reference(sn.extractsingle( + r'^#\sPAPI_L1_TCM\s+(?P\S\.\S+)', + self.txtrpt, 'totalmissesL1', float), 91159658, -0.1, 0.1), + # check the html report: + sn.assert_reference(sn.extractsingle( + r'^\sPAPI_L1_TCM\s<\/td>\s(?P\d+)', + self.htmlrpt, 'totalmissesL1', float), 91159658, -0.1, 0.1), + ]) + From f4d7cbb1da9fd5418810699d54a4d24bccfb6c92 Mon Sep 17 00:00:00 2001 From: jgp Date: Thu, 13 Dec 2018 10:59:16 +0100 Subject: [PATCH 2/5] doc --- cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py index fc93d8ef52..6917e072d7 100644 --- a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -44,10 +44,14 @@ def __init__(self, lang): 'OMP_PROC_BIND': 'true', 'CRAYPE_LINK_TYPE': 'dynamic', 'PKG_CONFIG_PATH': '$PAT_BUILD_PAPI_BASEDIR/lib64/pkgconfig:$PKG_CONFIG_PATH', + # The list of hardware performance counters available depend on the cpu type: + # srun -n1 -t1 -Cgpu papi_avail + # More infos: http://ipm-hpc.sourceforge.net/userguide.html 'IPM_HPM': 'PAPI_L1_TCM,PAPI_L2_TCM,PAPI_L3_TCM', } self.txtrpt = 'ipm.rpt' - self.post_run = ['ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt] + self.post_run = ['ipm_parse.pl -h'] + self.post_run += ['ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt] self.post_run += ['ipm_parse.pl -html *.ipm.xml'] self.post_run += ['cp *ipm.xml_ipm*/index.html .'] self.maintainers = ['JG'] From 616d7341caae7982723b131583f2285790ac7cd6 Mon Sep 17 00:00:00 2001 From: jgp Date: Mon, 11 Feb 2019 15:35:07 +0100 Subject: [PATCH 3/5] pep7 --- .../profiling_and_debugging/ipm_mpi_omp.py | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py index 6917e072d7..a2da09560a 100644 --- a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -16,16 +16,16 @@ def __init__(self, lang): self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] self.prgenv_flags = { - 'PrgEnv-gnu' : ['-O2 -g -fopenmp'], - 'PrgEnv-cray' : ['-O2 -g -homp'], - 'PrgEnv-intel' : ['-O2 -g -openmp'], - 'PrgEnv-pgi' : ['-O2 -g -mp'] + 'PrgEnv-gnu': ['-O2 -g -fopenmp'], + 'PrgEnv-cray': ['-O2 -g -homp'], + 'PrgEnv-intel': ['-O2 -g -openmp'], + 'PrgEnv-pgi': ['-O2 -g -mp'] } self.ipm_modules = { - 'PrgEnv-gnu' : 'IPM/2.0.6-CrayGNU-18.08', - 'PrgEnv-cray' : 'IPM/2.0.6-CrayCCE-18.08', - 'PrgEnv-intel' : 'IPM/2.0.6-CrayIntel-18.08', - 'PrgEnv-pgi' : 'IPM/2.0.6-CrayPGI-18.08' + 'PrgEnv-gnu': 'IPM/2.0.6-CrayGNU-18.08', + 'PrgEnv-cray': 'IPM/2.0.6-CrayCCE-18.08', + 'PrgEnv-intel': 'IPM/2.0.6-CrayIntel-18.08', + 'PrgEnv-pgi': 'IPM/2.0.6-CrayPGI-18.08' } self.sourcesdir = os.path.join('src', lang) self.executable = './jacobi' @@ -33,7 +33,7 @@ def __init__(self, lang): if lang == 'F90': self.build_system.max_concurrency = 1 - self.time_limit = (0,2,0) + self.time_limit = (0, 2, 0) self.num_tasks = 3 self.num_tasks_per_node = 3 self.num_cpus_per_task = 4 @@ -43,14 +43,16 @@ def __init__(self, lang): 'ITERATIONS': str(self.num_iterations), 'OMP_PROC_BIND': 'true', 'CRAYPE_LINK_TYPE': 'dynamic', - 'PKG_CONFIG_PATH': '$PAT_BUILD_PAPI_BASEDIR/lib64/pkgconfig:$PKG_CONFIG_PATH', - # The list of hardware performance counters available depend on the cpu type: + 'PKG_CONFIG_PATH': + '$PAT_BUILD_PAPI_BASEDIR/lib64/pkgconfig:$PKG_CONFIG_PATH', + # The list of hardware performance counters available depend + # on the cpu type: # srun -n1 -t1 -Cgpu papi_avail # More infos: http://ipm-hpc.sourceforge.net/userguide.html 'IPM_HPM': 'PAPI_L1_TCM,PAPI_L2_TCM,PAPI_L3_TCM', } self.txtrpt = 'ipm.rpt' - self.post_run = ['ipm_parse.pl -h'] + self.post_run = ['ipm_parse.pl -h'] self.post_run += ['ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt] self.post_run += ['ipm_parse.pl -html *.ipm.xml'] self.post_run += ['cp *ipm.xml_ipm*/index.html .'] @@ -58,7 +60,7 @@ def __init__(self, lang): self.tags = {'production'} def setup(self, partition, environ, **job_opts): - self.modules = [ self.ipm_modules[environ.name] ] + self.modules = [self.ipm_modules[environ.name]] super().setup(partition, environ, **job_opts) environ_name = self.current_environ.name prgenv_flags = self.prgenv_flags[environ_name] @@ -77,7 +79,7 @@ def setup(self, partition, environ, **job_opts): self.txtrpt, 'totalmissesL1', float), 91159658, -0.1, 0.1), # check the html report: sn.assert_reference(sn.extractsingle( - r'^\sPAPI_L1_TCM\s<\/td>\s(?P\d+)', + r'^\sPAPI_L1_TCM\s<\/td>\s' + r'(?P\d+)', self.htmlrpt, 'totalmissesL1', float), 91159658, -0.1, 0.1), ]) - From d8f5aca8e20efb5c1481bea818b7b4d52b43d79b Mon Sep 17 00:00:00 2001 From: jgp Date: Tue, 12 Feb 2019 09:03:01 +0100 Subject: [PATCH 4/5] https://github.com/eth-cscs/reframe/pull/631#pullrequestreview-202143528 --- .../profiling_and_debugging/ipm_mpi_omp.py | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py index a2da09560a..9e9816310f 100644 --- a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -9,23 +9,20 @@ class Ipm(rfm.RegressionTest): def __init__(self, lang): super().__init__() - self.name = 'IPM_%s' % lang.replace('+', 'p') - self.descr = '%s check' % lang - self.language = lang self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] self.prgenv_flags = { - 'PrgEnv-gnu': ['-O2 -g -fopenmp'], - 'PrgEnv-cray': ['-O2 -g -homp'], - 'PrgEnv-intel': ['-O2 -g -openmp'], - 'PrgEnv-pgi': ['-O2 -g -mp'] + 'PrgEnv-gnu': ['-O2', '-g', '-fopenmp'], + 'PrgEnv-cray': ['-O2', '-g', '-homp'], + 'PrgEnv-intel': ['-O2', '-g', '-openmp'], + 'PrgEnv-pgi': ['-O2', '-g', '-mp'] } self.ipm_modules = { - 'PrgEnv-gnu': 'IPM/2.0.6-CrayGNU-18.08', - 'PrgEnv-cray': 'IPM/2.0.6-CrayCCE-18.08', - 'PrgEnv-intel': 'IPM/2.0.6-CrayIntel-18.08', - 'PrgEnv-pgi': 'IPM/2.0.6-CrayPGI-18.08' + 'PrgEnv-gnu': ['IPM/2.0.6-CrayGNU-18.08'], + 'PrgEnv-cray': ['IPM/2.0.6-CrayCCE-18.08'], + 'PrgEnv-intel': ['IPM/2.0.6-CrayIntel-18.08'], + 'PrgEnv-pgi': ['IPM/2.0.6-CrayPGI-18.08'] } self.sourcesdir = os.path.join('src', lang) self.executable = './jacobi' @@ -33,7 +30,6 @@ def __init__(self, lang): if lang == 'F90': self.build_system.max_concurrency = 1 - self.time_limit = (0, 2, 0) self.num_tasks = 3 self.num_tasks_per_node = 3 self.num_cpus_per_task = 4 @@ -45,29 +41,30 @@ def __init__(self, lang): 'CRAYPE_LINK_TYPE': 'dynamic', 'PKG_CONFIG_PATH': '$PAT_BUILD_PAPI_BASEDIR/lib64/pkgconfig:$PKG_CONFIG_PATH', - # The list of hardware performance counters available depend + # The list of available hardware performance counters depends # on the cpu type: # srun -n1 -t1 -Cgpu papi_avail # More infos: http://ipm-hpc.sourceforge.net/userguide.html 'IPM_HPM': 'PAPI_L1_TCM,PAPI_L2_TCM,PAPI_L3_TCM', } self.txtrpt = 'ipm.rpt' - self.post_run = ['ipm_parse.pl -h'] - self.post_run += ['ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt] - self.post_run += ['ipm_parse.pl -html *.ipm.xml'] - self.post_run += ['cp *ipm.xml_ipm*/index.html .'] + self.post_run = ['ipm_parse.pl -h', + 'ipm_parse.pl -full *.ipm.xml &> %s' % self.txtrpt, + 'ipm_parse.pl -html *.ipm.xml', + 'cp *ipm.xml_ipm*/index.html .'] self.maintainers = ['JG'] self.tags = {'production'} def setup(self, partition, environ, **job_opts): - self.modules = [self.ipm_modules[environ.name]] + self.modules = self.ipm_modules[environ.name] super().setup(partition, environ, **job_opts) environ_name = self.current_environ.name prgenv_flags = self.prgenv_flags[environ_name] self.build_system.cflags = prgenv_flags self.build_system.cxxflags = prgenv_flags self.build_system.fflags = prgenv_flags - self.build_system.ldflags = ['-lm `pkg-config --libs papi` ${IPM}'] + self.build_system.ldflags = ['-lm', '`pkg-config --libs papi`', + '${IPM}'] self.htmlrpt = 'index.html' self.sanity_patterns = sn.all([ From b58e447426978fed961a17e220fbc9678795a0fa Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 12 Feb 2019 09:20:53 +0100 Subject: [PATCH 5/5] Replace '+' with 'p' in test name --- cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py index 9e9816310f..5494fcac06 100644 --- a/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/ipm_mpi_omp.py @@ -9,6 +9,7 @@ class Ipm(rfm.RegressionTest): def __init__(self, lang): super().__init__() + self.name = 'Ipm_%s' % 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']