Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions cscs-checks/microbenchmarks/spec-accel/spec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import os

import reframe as rfm
import reframe.utility.sanity as sn
from reframe.core.launchers.registry import getlauncher


class SpecAccelCheckBase(rfm.RegressionTest):
def __init__(self, prg_envs):
super().__init__()
self.valid_systems = ['daint:gpu', 'dom:gpu']
self.valid_prog_environs = prg_envs
self.modules = ['craype-accel-nvidia60']

self.configs = {
'PrgEnv-gnu': 'cscs-gnu',
'PrgEnv-cray': 'cscs-cray',
}

app_source = os.path.join(self.current_system.resourcesdir,
'SPEC_ACCELv1.2')
self.prebuild_cmd = ['cp -r %s/* .' % app_source,
'./install.sh -d . -f']

# I just want prebuild_cmd, but no action for the build_system
# is not supported, so I find it something useless to do
self.build_system = 'SingleSource'
self.sourcepath = './benchspec/ACCEL/353.clvrleaf/src/timer_c.c'
self.build_system.cflags = ['-c']

self.refs = {
env: {bench_name: (rt, None, 0.1, 'Seconds')
for (bench_name, rt) in
zip(self.benchmarks, self.exec_times[env])}
for env in self.valid_prog_environs
}

self.num_tasks = 1
self.num_tasks_per_node = 1
self.time_limit = (0, 30, 0)

self.executable = 'runspec'

outfile = sn.getitem(sn.glob('result/ACCEL.*.log'), 0)
self.sanity_patterns = sn.all([sn.assert_found(
r'Success.*%s' % bn, outfile) for bn in self.benchmarks])

self.perf_patterns = {
bench_name: sn.avg(sn.extractall(
r'Success.*%s.*runtime=(?P<rt>[0-9.]+)' % bench_name,
outfile, 'rt', float))
for bench_name in self.benchmarks
}

self.maintainers = ['SK']
self.tags = {'diagnostic'}

def setup(self, partition, environ, **job_opts):
self.pre_run = ['source ./shrc', 'mv %s config' %
self.configs[environ.name]]
self.executable_opts = ['--config=%s' % self.configs[environ.name],
'--platform NVIDIA',
'--tune=base',
'--device GPU'] + self.benchmarks
self.reference = {
'dom:gpu': self.refs[environ.name],
'daint:gpu': self.refs[environ.name]
}

super().setup(partition, environ, **job_opts)
# The job launcher has to be changed since the `runspec`
# script is not used with srun.
self.job.launcher = getlauncher('local')()


@rfm.required_version('>=2.16-dev0')
@rfm.simple_test
class SpecAccelCheckOpenCL(SpecAccelCheckBase):
def __init__(self):
self.descr = 'SPEC-accel benchmark OpenCL'
valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-cray']

self.benchmarks = ['systest', 'tpacf', 'stencil', 'lbm', 'fft',
'spmv', 'mriq', 'bfs', 'cutcp', 'kmeans',
'lavamd', 'cfd', 'nw', 'hotspot', 'lud',
'ge', 'srad', 'heartwall', 'bplustree']

self.exec_times = {
'PrgEnv-gnu': [10.7, 13.5, 17.0, 10.9, 11.91, 27.8,
7.0, 23.1, 10.8, 38.4, 8.7, 24.4, 16.2,
15.7, 15.6, 11.1, 20.0, 41.9, 26.2],
'PrgEnv-cray': [10.7, 13.5, 17.0, 10.9, 11.91, 27.8,
7.0, 23.1, 10.8, 24.9, 8.7, 24.4, 16.2,
15.7, 15.6, 11.1, 20.0, 41.9, 26.2],
}

super().__init__(valid_prog_environs)


@rfm.required_version('>=2.16-dev0')
@rfm.simple_test
class SpecAccelCheckOpenACC(SpecAccelCheckBase):
def __init__(self):
self.descr = 'SPEC-accel benchmark OpenACC'
valid_prog_environs = ['PrgEnv-cray']

self.benchmarks = ['ostencil', 'olbm', 'omriq', 'md', 'ep',
'clvrleaf', 'cg', 'seismic', 'sp', 'csp',
'miniGhost', 'ilbdc', 'swim', 'bt']

self.exec_times = {
'PrgEnv-cray': [18, 26, 121, 20, 73, 59, 41,
50, 71, 34, 72, 41, 34, 378]
}

super().__init__(valid_prog_environs)
42 changes: 42 additions & 0 deletions cscs-checks/microbenchmarks/spec-accel/src/cscs-cray
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ext = compsys
output_format = asc
#table = 0
teeout = no
teerunout = yes
tune = base

######################################################################
# Compiler selection, versions, and dates.
#
# sw_compiler<xx> = additional information describing the compiler
# CC = how the C Compiler is invoked
# FC = how the FORTRAN compiler is invoked


default=default=default=default:
sw_compiler = Computer System Compiler C and Fortran90
CC = cc
CXX = CC
FC = ftn

strict_rundir_verify = 0

#######################################################################
#
# OPTIMIZE = flags applicable to all compilers
# COPTIMIZE = flags applicable to the C compiler
# FOPTIMIZE = flags applicable to the Fortran compiler
#
# See your compiler manual for information on the flags available
# for your compiler
#

OPTIMIZE =
LIBS = -lOpenCL
#EXTRA_LIBS =
EXTRA_CXXFLAGS = -h std=c++03
#EXTRA_CFLAGS =

#######################################################################
# End of user-supplied information.
#######################################################################
42 changes: 42 additions & 0 deletions cscs-checks/microbenchmarks/spec-accel/src/cscs-gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ext = compsys
output_format = asc
#table = 0
teeout = no
teerunout = yes
tune = base

######################################################################
# Compiler selection, versions, and dates.
#
# sw_compiler<xx> = additional information describing the compiler
# CC = how the C Compiler is invoked
# FC = how the FORTRAN compiler is invoked


default=default=default=default:
sw_compiler = Computer System Compiler C and Fortran90
CC = cc
CXX = CC
FC = ftn

strict_rundir_verify = 0

#######################################################################
#
# OPTIMIZE = flags applicable to all compilers
# COPTIMIZE = flags applicable to the C compiler
# FOPTIMIZE = flags applicable to the Fortran compiler
#
# See your compiler manual for information on the flags available
# for your compiler
#

OPTIMIZE = -O3
LIBS = -lOpenCL
#EXTRA_LIBS =
EXTRA_CXXFLAGS = -std=c++03
#EXTRA_CFLAGS =

#######################################################################
# End of user-supplied information.
#######################################################################