Skip to content

Commit e0c4401

Browse files
authored
Merge pull request #618 from sebkelle1/checks/spec-accel
[test] Add tests for SPEC-ACCEL benchmarks
2 parents dd2fdaf + 0b4b60e commit e0c4401

File tree

3 files changed

+200
-0
lines changed

3 files changed

+200
-0
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import os
2+
3+
import reframe as rfm
4+
import reframe.utility.sanity as sn
5+
from reframe.core.launchers.registry import getlauncher
6+
7+
8+
class SpecAccelCheckBase(rfm.RegressionTest):
9+
def __init__(self, prg_envs):
10+
super().__init__()
11+
self.valid_systems = ['daint:gpu', 'dom:gpu']
12+
self.valid_prog_environs = prg_envs
13+
self.modules = ['craype-accel-nvidia60']
14+
15+
self.configs = {
16+
'PrgEnv-gnu': 'cscs-gnu',
17+
'PrgEnv-cray': 'cscs-cray',
18+
}
19+
20+
app_source = os.path.join(self.current_system.resourcesdir,
21+
'SPEC_ACCELv1.2')
22+
self.prebuild_cmd = ['cp -r %s/* .' % app_source,
23+
'./install.sh -d . -f']
24+
25+
# I just want prebuild_cmd, but no action for the build_system
26+
# is not supported, so I find it something useless to do
27+
self.build_system = 'SingleSource'
28+
self.sourcepath = './benchspec/ACCEL/353.clvrleaf/src/timer_c.c'
29+
self.build_system.cflags = ['-c']
30+
31+
self.refs = {
32+
env: {bench_name: (rt, None, 0.1, 'Seconds')
33+
for (bench_name, rt) in
34+
zip(self.benchmarks, self.exec_times[env])}
35+
for env in self.valid_prog_environs
36+
}
37+
38+
self.num_tasks = 1
39+
self.num_tasks_per_node = 1
40+
self.time_limit = (0, 30, 0)
41+
42+
self.executable = 'runspec'
43+
44+
outfile = sn.getitem(sn.glob('result/ACCEL.*.log'), 0)
45+
self.sanity_patterns = sn.all([sn.assert_found(
46+
r'Success.*%s' % bn, outfile) for bn in self.benchmarks])
47+
48+
self.perf_patterns = {
49+
bench_name: sn.avg(sn.extractall(
50+
r'Success.*%s.*runtime=(?P<rt>[0-9.]+)' % bench_name,
51+
outfile, 'rt', float))
52+
for bench_name in self.benchmarks
53+
}
54+
55+
self.maintainers = ['SK']
56+
self.tags = {'diagnostic'}
57+
58+
def setup(self, partition, environ, **job_opts):
59+
self.pre_run = ['source ./shrc', 'mv %s config' %
60+
self.configs[environ.name]]
61+
self.executable_opts = ['--config=%s' % self.configs[environ.name],
62+
'--platform NVIDIA',
63+
'--tune=base',
64+
'--device GPU'] + self.benchmarks
65+
self.reference = {
66+
'dom:gpu': self.refs[environ.name],
67+
'daint:gpu': self.refs[environ.name]
68+
}
69+
70+
super().setup(partition, environ, **job_opts)
71+
# The job launcher has to be changed since the `runspec`
72+
# script is not used with srun.
73+
self.job.launcher = getlauncher('local')()
74+
75+
76+
@rfm.required_version('>=2.16-dev0')
77+
@rfm.simple_test
78+
class SpecAccelCheckOpenCL(SpecAccelCheckBase):
79+
def __init__(self):
80+
self.descr = 'SPEC-accel benchmark OpenCL'
81+
valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-cray']
82+
83+
self.benchmarks = ['systest', 'tpacf', 'stencil', 'lbm', 'fft',
84+
'spmv', 'mriq', 'bfs', 'cutcp', 'kmeans',
85+
'lavamd', 'cfd', 'nw', 'hotspot', 'lud',
86+
'ge', 'srad', 'heartwall', 'bplustree']
87+
88+
self.exec_times = {
89+
'PrgEnv-gnu': [10.7, 13.5, 17.0, 10.9, 11.91, 27.8,
90+
7.0, 23.1, 10.8, 38.4, 8.7, 24.4, 16.2,
91+
15.7, 15.6, 11.1, 20.0, 41.9, 26.2],
92+
'PrgEnv-cray': [10.7, 13.5, 17.0, 10.9, 11.91, 27.8,
93+
7.0, 23.1, 10.8, 24.9, 8.7, 24.4, 16.2,
94+
15.7, 15.6, 11.1, 20.0, 41.9, 26.2],
95+
}
96+
97+
super().__init__(valid_prog_environs)
98+
99+
100+
@rfm.required_version('>=2.16-dev0')
101+
@rfm.simple_test
102+
class SpecAccelCheckOpenACC(SpecAccelCheckBase):
103+
def __init__(self):
104+
self.descr = 'SPEC-accel benchmark OpenACC'
105+
valid_prog_environs = ['PrgEnv-cray']
106+
107+
self.benchmarks = ['ostencil', 'olbm', 'omriq', 'md', 'ep',
108+
'clvrleaf', 'cg', 'seismic', 'sp', 'csp',
109+
'miniGhost', 'ilbdc', 'swim', 'bt']
110+
111+
self.exec_times = {
112+
'PrgEnv-cray': [18, 26, 121, 20, 73, 59, 41,
113+
50, 71, 34, 72, 41, 34, 378]
114+
}
115+
116+
super().__init__(valid_prog_environs)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
ext = compsys
2+
output_format = asc
3+
#table = 0
4+
teeout = no
5+
teerunout = yes
6+
tune = base
7+
8+
######################################################################
9+
# Compiler selection, versions, and dates.
10+
#
11+
# sw_compiler<xx> = additional information describing the compiler
12+
# CC = how the C Compiler is invoked
13+
# FC = how the FORTRAN compiler is invoked
14+
15+
16+
default=default=default=default:
17+
sw_compiler = Computer System Compiler C and Fortran90
18+
CC = cc
19+
CXX = CC
20+
FC = ftn
21+
22+
strict_rundir_verify = 0
23+
24+
#######################################################################
25+
#
26+
# OPTIMIZE = flags applicable to all compilers
27+
# COPTIMIZE = flags applicable to the C compiler
28+
# FOPTIMIZE = flags applicable to the Fortran compiler
29+
#
30+
# See your compiler manual for information on the flags available
31+
# for your compiler
32+
#
33+
34+
OPTIMIZE =
35+
LIBS = -lOpenCL
36+
#EXTRA_LIBS =
37+
EXTRA_CXXFLAGS = -h std=c++03
38+
#EXTRA_CFLAGS =
39+
40+
#######################################################################
41+
# End of user-supplied information.
42+
#######################################################################
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
ext = compsys
2+
output_format = asc
3+
#table = 0
4+
teeout = no
5+
teerunout = yes
6+
tune = base
7+
8+
######################################################################
9+
# Compiler selection, versions, and dates.
10+
#
11+
# sw_compiler<xx> = additional information describing the compiler
12+
# CC = how the C Compiler is invoked
13+
# FC = how the FORTRAN compiler is invoked
14+
15+
16+
default=default=default=default:
17+
sw_compiler = Computer System Compiler C and Fortran90
18+
CC = cc
19+
CXX = CC
20+
FC = ftn
21+
22+
strict_rundir_verify = 0
23+
24+
#######################################################################
25+
#
26+
# OPTIMIZE = flags applicable to all compilers
27+
# COPTIMIZE = flags applicable to the C compiler
28+
# FOPTIMIZE = flags applicable to the Fortran compiler
29+
#
30+
# See your compiler manual for information on the flags available
31+
# for your compiler
32+
#
33+
34+
OPTIMIZE = -O3
35+
LIBS = -lOpenCL
36+
#EXTRA_LIBS =
37+
EXTRA_CXXFLAGS = -std=c++03
38+
#EXTRA_CFLAGS =
39+
40+
#######################################################################
41+
# End of user-supplied information.
42+
#######################################################################

0 commit comments

Comments
 (0)