diff --git a/cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py b/cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py index 233d305ae2..ae11f3ac9a 100644 --- a/cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py +++ b/cscs-checks/tools/profiling_and_debugging/scorep_mpi_omp.py @@ -1,35 +1,39 @@ -import os +import reframe as rfm import reframe.utility.sanity as sn -from reframe.core.pipeline import RegressionTest - - -class ScorepHybrid(RegressionTest): - def __init__(self, lang, **kwargs): - super().__init__('scorep_mpi_omp_%s' % lang.replace('+', 'p'), - os.path.dirname(__file__), **kwargs) +@rfm.parameterized_test(['C'], ['C++'], ['F90']) +class ScorepHybrid(rfm.RegressionTest): + def __init__(self, lang): + super().__init__() + self.name = 'scorep_mpi_omp_%s' % lang.replace('+', 'p') self.descr = 'SCORE-P %s check' % lang self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc'] self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] self.scorep_modules = { - 'PrgEnv-gnu': ['Score-P/3.1-CrayGNU-17.08'], - 'PrgEnv-intel': ['Score-P/3.1-CrayIntel-17.08'], - 'PrgEnv-pgi': ['Score-P/3.1-CrayPGI-17.08'] + 'PrgEnv-gnu': ['Score-P/4.0-CrayGNU-18.07'], + 'PrgEnv-intel': ['Score-P/4.0-CrayIntel-18.07'], + 'PrgEnv-pgi': ['Score-P/4.0-CrayPGI-18.07'] } self.prgenv_flags = { - 'PrgEnv-cray': '-g -homp', - 'PrgEnv-gnu': '-g -fopenmp', - 'PrgEnv-intel': '-g -openmp', - 'PrgEnv-pgi': '-g -mp' + 'PrgEnv-cray': ['-g', '-homp'], + 'PrgEnv-gnu': ['-g', '-fopenmp'], + 'PrgEnv-intel': ['-g', '-openmp'], + 'PrgEnv-pgi': ['-g', '-mp'] } self.executable = 'jacobi' - self.makefile = 'Makefile_scorep_mpi_omp' - self.sourcesdir = os.path.join('src', lang) + self.build_system = 'Make' + self.build_system.makefile = 'Makefile_scorep_mpi_omp' + # NOTE: Restrict concurrency to allow creation of Fortran modules + if lang == 'F90': + self.build_system.max_concurrency = 1 + + self.sourcesdir = 'src/%s' % lang + self.build_system.srcdir = self.sourcesdir self.num_tasks = 3 self.num_tasks_per_node = 3 self.num_cpus_per_task = 4 @@ -63,29 +67,19 @@ def __init__(self, lang, **kwargs): 'otf2-print scorep-*/traces.otf2 > %s' % self.otf2_file ] - def compile(self): - prgenv_flags = self.prgenv_flags[self.current_environ.name] - self.current_environ.cflags = prgenv_flags - self.current_environ.cxxflags = prgenv_flags - self.current_environ.fflags = prgenv_flags - self.current_environ.ldflags = '-lm' - super().compile(makefile=self.makefile, - options="PREP='scorep --nopreprocess " - " --mpp=mpi --thread=omp'") - def setup(self, partition, environ, **job_opts): if partition.fullname in ['daint:gpu', 'dom:gpu']: self.scorep_modules['PrgEnv-gnu'] = [ - 'Score-P/3.1-CrayGNU-17.08-cuda-8.0' + 'Score-P/4.0-CrayGNU-18.07-cuda-9.1' ] self.modules = self.scorep_modules[environ.name] super().setup(partition, environ, **job_opts) - - -def _get_checks(**kwargs): - ret = [] - for lang in ['C', 'C++', 'F90']: - ret.append(ScorepHybrid(lang, **kwargs)) - - return ret + prgenv_flags = self.prgenv_flags[self.current_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'] + self.build_system.options = [ + "PREP='scorep --nopreprocess --mpp=mpi --thread=omp'" + ]