Skip to content

Commit ecb7518

Browse files
author
Theofilos Manitaras
authored
Merge branch 'master' into update-syntax/vasp
2 parents e68cace + a4f3e80 commit ecb7518

File tree

11 files changed

+244
-149
lines changed

11 files changed

+244
-149
lines changed

config/cscs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
},
292292
{
293293
'type': 'Singularity',
294-
'modules': ['singularity/3.6.4-daint']
294+
'modules': ['singularity/3.8.0-daint']
295295
}
296296
],
297297
'modules': ['daint-gpu'],
@@ -327,7 +327,7 @@
327327
},
328328
{
329329
'type': 'Singularity',
330-
'modules': ['singularity/3.6.4-daint']
330+
'modules': ['singularity/3.8.0-daint']
331331
}
332332
],
333333
'modules': ['daint-mc'],

cscs-checks/apps/lammps/lammps_check.py

Lines changed: 102 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -9,100 +9,137 @@
99
import reframe.utility.sanity as sn
1010

1111

12-
class LAMMPSBaseCheck(rfm.RunOnlyRegressionTest):
13-
def __init__(self):
12+
class LAMMPSCheck(rfm.RunOnlyRegressionTest):
13+
scale = parameter(['small', 'large'])
14+
variant = parameter(['maint', 'prod'])
15+
modules = ['cray-python', 'LAMMPS']
16+
tags = {'scs', 'external-resources'}
17+
maintainers = ['LM']
18+
strict_check = False
19+
extra_resources = {
20+
'switches': {
21+
'num_switches': 1
22+
}
23+
}
24+
25+
@run_after('init')
26+
def setup_by_system(self):
27+
# Reset sources dir relative to the SCS apps prefix
28+
self.sourcesdir = os.path.join(self.current_system.resourcesdir,
29+
'LAMMPS')
1430
if self.current_system.name in ['eiger', 'pilatus']:
1531
self.valid_prog_environs = ['cpeGNU']
1632
else:
1733
self.valid_prog_environs = ['builtin']
18-
self.modules = ['LAMMPS']
1934

20-
# Reset sources dir relative to the SCS apps prefix
21-
self.sourcesdir = os.path.join(self.current_system.resourcesdir,
22-
'LAMMPS')
35+
@performance_function('timesteps/s')
36+
def perf(self):
37+
return sn.extractsingle(r'\s+(?P<perf>\S+) timesteps/s',
38+
self.stdout, 'perf', float)
39+
40+
@sanity_function
41+
def assert_energy_diff(self):
2342
energy_reference = -4.6195
2443
energy = sn.extractsingle(
2544
r'\s+500000(\s+\S+){3}\s+(?P<energy>\S+)\s+\S+\s\n',
2645
self.stdout, 'energy', float)
27-
self.perf_patterns = {
28-
'perf': sn.extractsingle(r'\s+(?P<perf>\S+) timesteps/s',
29-
self.stdout, 'perf', float),
30-
}
31-
energy_diff = sn.abs(energy-energy_reference)
32-
self.sanity_patterns = sn.all([
46+
energy_diff = sn.abs(energy - energy_reference)
47+
return sn.all([
3348
sn.assert_found(r'Total wall time:', self.stdout),
3449
sn.assert_lt(energy_diff, 6e-4)
3550
])
36-
self.strict_check = False
37-
self.extra_resources = {
38-
'switches': {
39-
'num_switches': 1
51+
52+
53+
@rfm.simple_test
54+
class LAMMPSGPUCheck(LAMMPSCheck):
55+
valid_systems = ['daint:gpu']
56+
executable = 'lmp_mpi'
57+
executable_opts = ['-sf gpu', '-pk gpu 1', '-in in.lj.gpu']
58+
variables = {'CRAY_CUDA_MPS': '1'}
59+
num_gpus_per_node = 1
60+
references_by_variant = {
61+
'maint': {
62+
'small': {
63+
'dom:gpu': {'perf': (3457, -0.10, None, 'timesteps/s')},
64+
'daint:gpu': {'perf': (2524, -0.10, None, 'timesteps/s')}
65+
},
66+
'large': {
67+
'daint:gpu': {'perf': (3832, -0.05, None, 'timesteps/s')}
4068
}
41-
}
69+
},
70+
'prod': {
71+
'small': {
72+
'dom:gpu': {'perf': (3132, -0.05, None, 'timesteps/s')},
73+
'daint:gpu': {'perf': (2400, -0.40, None, 'timesteps/s')}
74+
},
75+
'large': {
76+
'daint:gpu': {'perf': (3260, -0.50, None, 'timesteps/s')}
77+
}
78+
},
79+
}
4280

43-
self.tags = {'scs', 'external-resources'}
44-
self.maintainers = ['VH']
45-
46-
47-
@rfm.parameterized_test(*([s, v]
48-
for s in ['small', 'large']
49-
for v in ['prod', 'maint']))
50-
class LAMMPSGPUCheck(LAMMPSBaseCheck):
51-
def __init__(self, scale, variant):
52-
super().__init__()
53-
self.valid_systems = ['daint:gpu']
54-
self.executable = 'lmp_mpi'
55-
self.executable_opts = ['-sf gpu', '-pk gpu 1', '-in in.lj.gpu']
56-
self.variables = {'CRAY_CUDA_MPS': '1'}
57-
self.num_gpus_per_node = 1
58-
if scale == 'small':
81+
@run_after('init')
82+
def setup_by_variant(self):
83+
self.descr = (f'LAMMPS GPU check (version: {self.scale}, '
84+
f'{self.variant})')
85+
if self.scale == 'small':
5986
self.valid_systems += ['dom:gpu']
6087
self.num_tasks = 12
6188
self.num_tasks_per_node = 2
6289
else:
6390
self.num_tasks = 32
6491
self.num_tasks_per_node = 2
6592

66-
references = {
67-
'maint': {
68-
'small': {
69-
'dom:gpu': {'perf': (3457, -0.10, None, 'timesteps/s')},
70-
'daint:gpu': {'perf': (2524, -0.10, None, 'timesteps/s')}
71-
},
72-
'large': {
73-
'daint:gpu': {'perf': (3832, -0.05, None, 'timesteps/s')}
74-
}
93+
self.reference = self.references_by_variant[self.variant][self.scale]
94+
self.tags |= {
95+
'maintenance' if self.variant == 'maint' else 'production'
96+
}
97+
98+
99+
@rfm.simple_test
100+
class LAMMPSCPUCheck(LAMMPSCheck):
101+
valid_systems = ['daint:mc', 'eiger:mc', 'pilatus:mc']
102+
references_by_variant = {
103+
'maint': {
104+
'small': {
105+
'dom:mc': {'perf': (4394, -0.05, None, 'timesteps/s')},
106+
'daint:mc': {'perf': (3824, -0.10, None, 'timesteps/s')},
107+
'eiger:mc': {'perf': (4500, -0.10, None, 'timesteps/s')},
108+
'pilatus:mc': {'perf': (5000, -0.10, None, 'timesteps/s')}
75109
},
76-
'prod': {
77-
'small': {
78-
'dom:gpu': {'perf': (3132, -0.05, None, 'timesteps/s')},
79-
'daint:gpu': {'perf': (2400, -0.40, None, 'timesteps/s')}
80-
},
81-
'large': {
82-
'daint:gpu': {'perf': (3260, -0.50, None, 'timesteps/s')}
83-
}
110+
'large': {
111+
'daint:mc': {'perf': (5310, -0.65, None, 'timesteps/s')},
112+
'eiger:mc': {'perf': (6500, -0.10, None, 'timesteps/s')},
113+
'pilatus:mc': {'perf': (7500, -0.10, None, 'timesteps/s')}
114+
}
115+
},
116+
'prod': {
117+
'small': {
118+
'dom:mc': {'perf': (4394, -0.05, None, 'timesteps/s')},
119+
'daint:mc': {'perf': (3824, -0.10, None, 'timesteps/s')},
120+
'eiger:mc': {'perf': (4500, -0.10, None, 'timesteps/s')},
121+
'pilatus:mc': {'perf': (5000, -0.10, None, 'timesteps/s')}
84122
},
123+
'large': {
124+
'daint:mc': {'perf': (5310, -0.65, None, 'timesteps/s')},
125+
'eiger:mc': {'perf': (6500, -0.10, None, 'timesteps/s')},
126+
'pilatus:mc': {'perf': (7500, -0.10, None, 'timesteps/s')}
127+
}
85128
}
86-
self.reference = references[variant][scale]
87-
self.tags |= {'maintenance' if variant == 'maint' else 'production'}
129+
}
88130

89-
90-
@rfm.parameterized_test(*([s, v]
91-
for s in ['small', 'large']
92-
for v in ['prod']))
93-
class LAMMPSCPUCheck(LAMMPSBaseCheck):
94-
def __init__(self, scale, variant):
95-
super().__init__()
96-
self.valid_systems = ['daint:mc', 'eiger:mc', 'pilatus:mc']
131+
@run_after('init')
132+
def setup_by_variant(self):
133+
self.descr = (f'LAMMPS CPU check (version: {self.scale}, '
134+
f'{self.variant})')
97135
if self.current_system.name in ['eiger', 'pilatus']:
98136
self.executable = 'lmp_mpi'
99137
self.executable_opts = ['-in in.lj.cpu']
100138
else:
101139
self.executable = 'lmp_omp'
102140
self.executable_opts = ['-sf omp', '-pk omp 1', '-in in.lj.cpu']
103141

104-
self.scale = scale
105-
if scale == 'small':
142+
if self.scale == 'small':
106143
self.valid_systems += ['dom:mc']
107144
self.num_tasks = 216
108145
self.num_tasks_per_node = 36
@@ -114,20 +151,7 @@ def __init__(self, scale, variant):
114151
self.num_tasks_per_node = 128
115152
self.num_tasks = 256 if self.scale == 'small' else 512
116153

117-
references = {
118-
'prod': {
119-
'small': {
120-
'dom:mc': {'perf': (4394, -0.05, None, 'timesteps/s')},
121-
'daint:mc': {'perf': (3824, -0.10, None, 'timesteps/s')},
122-
'eiger:mc': {'perf': (4500, -0.10, None, 'timesteps/s')},
123-
'pilatus:mc': {'perf': (5000, -0.10, None, 'timesteps/s')}
124-
},
125-
'large': {
126-
'daint:mc': {'perf': (5310, -0.65, None, 'timesteps/s')},
127-
'eiger:mc': {'perf': (6500, -0.10, None, 'timesteps/s')},
128-
'pilatus:mc': {'perf': (7500, -0.10, None, 'timesteps/s')}
129-
}
130-
},
154+
self.reference = self.references_by_variant[self.variant][self.scale]
155+
self.tags |= {
156+
'maintenance' if self.variant == 'maint' else 'production'
131157
}
132-
self.reference = references[variant][scale]
133-
self.tags |= {'maintenance' if variant == 'maint' else 'production'}

cscs-checks/microbenchmarks/cpu/dgemm/dgemm.py

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,46 @@
99

1010
@rfm.simple_test
1111
class DGEMMTest(rfm.RegressionTest):
12-
def __init__(self):
13-
self.descr = 'DGEMM performance test'
14-
self.sourcepath = 'dgemm.c'
15-
self.sanity_patterns = self.eval_sanity()
12+
descr = 'DGEMM performance test'
13+
sourcepath = 'dgemm.c'
1614

17-
# the perf patterns are automaticaly generated inside sanity
18-
self.perf_patterns = {}
19-
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc',
20-
'arolla:cn', 'arolla:pn', 'tsa:cn', 'tsa:pn',
21-
'eiger:mc', 'pilatus:mc']
22-
if self.current_system.name in ['daint', 'dom']:
15+
# the perf patterns are automaticaly generated inside sanity
16+
perf_patterns = {}
17+
valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc',
18+
'arolla:cn', 'arolla:pn', 'tsa:cn', 'tsa:pn',
19+
'eiger:mc', 'pilatus:mc']
20+
num_tasks = 0
21+
use_multithreading = False
22+
executable_opts = ['6144', '12288', '3072']
23+
build_system = 'SingleSource'
24+
arch_refs = {
25+
'haswell@12c': (300.0, -0.15, None, 'Gflop/s'),
26+
'broadwell@36c': (1040.0, -0.15, None, 'Gflop/s'),
27+
'zen2@128c': (3200.0, -0.15, None, 'Gflop/s'),
28+
# FIXME: no refs for tsa/arolla
29+
}
30+
maintainers = ['AJ', 'VH']
31+
tags = {'benchmark', 'diagnostic', 'craype'}
32+
33+
@run_after('init')
34+
def setup_filtering_criteria(self):
35+
# FIXME: Revise this as soon as GH #1852 is addressed
36+
if self.current_system.name in ('daint', 'dom'):
2337
self.valid_prog_environs = ['PrgEnv-gnu', 'PrgEnv-intel']
24-
elif self.current_system.name in ['arolla', 'tsa']:
38+
elif self.current_system.name in ('arolla', 'tsa'):
2539
self.valid_prog_environs = ['PrgEnv-gnu-nompi']
26-
elif self.current_system.name in ['eiger', 'pilatus']:
40+
elif self.current_system.name in ('eiger', 'pilatus'):
2741
self.valid_prog_environs = ['PrgEnv-gnu']
2842
else:
2943
self.valid_prog_environs = []
3044

31-
self.num_tasks = 0
32-
self.use_multithreading = False
33-
self.executable_opts = ['6144', '12288', '3072']
34-
self.build_system = 'SingleSource'
35-
self.build_system.cflags = ['-O3']
36-
self.sys_reference = {
37-
'daint:gpu': (300.0, -0.15, None, 'Gflop/s'),
38-
'daint:mc': (1040.0, -0.15, None, 'Gflop/s'),
39-
'dom:gpu': (300.0, -0.15, None, 'Gflop/s'),
40-
'dom:mc': (1040.0, -0.15, None, 'Gflop/s'),
41-
'eiger:mc': (3200.0, -0.15, None, 'Gflop/s'),
42-
'pilatus:mc': (3200.0, -0.15, None, 'Gflop/s'),
43-
}
44-
self.maintainers = ['AJ', 'VH']
45-
self.tags = {'benchmark', 'diagnostic', 'craype'}
46-
4745
@run_before('compile')
48-
def setflags(self):
46+
def set_compile_flags(self):
47+
# FIXME: To avoid using the `startswith()` we can now use the
48+
# environment `extras` to encode the compiler family, if properly
49+
# configured in the environment definitions.
50+
51+
self.build_system.cflags = ['-O3']
4952
if self.current_environ.name.startswith('PrgEnv-gnu'):
5053
self.build_system.cflags += ['-fopenmp']
5154
elif self.current_environ.name.startswith('PrgEnv-intel'):
@@ -57,35 +60,26 @@ def setflags(self):
5760
'-mkl', '-static-intel', '-liomp5', '-lpthread', '-lm', '-ldl'
5861
]
5962

60-
if self.current_partition.fullname in ['arolla:cn', 'arolla:pn',
61-
'tsa:cn', 'tsa:pn']:
63+
if self.current_system.name in ('arolla', 'tsa'):
6264
self.build_system.cflags += ['-I$EBROOTOPENBLAS/include']
6365
self.build_system.ldflags = ['-L$EBROOTOPENBLAS/lib', '-lopenblas',
6466
'-lpthread', '-lgfortran']
6567

6668
@run_before('run')
67-
def set_tasks(self):
68-
if self.current_partition.fullname in ['daint:gpu', 'dom:gpu']:
69-
self.num_cpus_per_task = 12
70-
elif self.current_partition.fullname in ['daint:mc', 'dom:mc']:
71-
self.num_cpus_per_task = 36
72-
elif self.current_partition.fullname in ['arolla:cn', 'tsa:cn']:
73-
self.num_cpus_per_task = 16
74-
elif self.current_partition.fullname in ['arolla:pn', 'tsa:pn']:
75-
self.num_cpus_per_task = 40
76-
elif self.current_partition.fullname in ['eiger:mc', 'pilatus:mc']:
77-
self.num_cpus_per_task = 128
69+
def prepare_run(self):
70+
self.skip_if_no_procinfo()
71+
self.num_cpus_per_task = self.current_partition.processor.num_cores
72+
self.variables = {
73+
'OMP_NUM_THREADS': str(self.num_cpus_per_task),
74+
'OMP_BIND': 'cores',
75+
'OMP_PROC_BIND': 'spread',
76+
'OMP_SCHEDULE': 'static'
77+
}
7878

79-
if self.num_cpus_per_task:
80-
self.variables = {
81-
'OMP_NUM_THREADS': str(self.num_cpus_per_task),
82-
'OMP_BIND': 'cores',
83-
'OMP_PROC_BIND': 'spread',
84-
'OMP_SCHEDULE': 'static'
85-
}
79+
@sanity_function
80+
def validate(self):
81+
# FIXME: This is currently complicated due to GH #2334
8682

87-
@sn.sanity_function
88-
def eval_sanity(self):
8983
all_tested_nodes = sn.evaluate(sn.extractall(
9084
r'(?P<hostname>\S+):\s+Time for \d+ DGEMM operations',
9185
self.stdout, 'hostname'))
@@ -95,14 +89,15 @@ def eval_sanity(self):
9589
sn.evaluate(sn.assert_eq(num_tested_nodes, self.job.num_tasks,
9690
msg=failure_msg))
9791

92+
pname = self.current_partition.fullname
93+
arch = self.current_partition.processor.arch
9894
for hostname in all_tested_nodes:
99-
partition_name = self.current_partition.fullname
100-
ref_name = '%s:%s' % (partition_name, hostname)
101-
self.reference[ref_name] = self.sys_reference.get(
102-
partition_name, (0.0, None, None, 'Gflop/s')
103-
)
95+
key = f'{arch}@{self.num_cpus_per_task}c'
96+
if key in self.arch_refs:
97+
self.reference[f'{pname}:{hostname}'] = self.arch_refs[key]
98+
10499
self.perf_patterns[hostname] = sn.extractsingle(
105-
r'%s:\s+Avg\. performance\s+:\s+(?P<gflops>\S+)'
106-
r'\sGflop/s' % hostname, self.stdout, 'gflops', float)
100+
fr'{hostname}:\s+Avg\. performance\s+:\s+(?P<gflops>\S+)'
101+
fr'\sGflop/s', self.stdout, 'gflops', float)
107102

108103
return True

0 commit comments

Comments
 (0)