@@ -47,72 +47,73 @@ def is_prime(x):
4747
4848@rfm .simple_test
4949class HPCGCheckRef (rfm .RegressionTest , HPCGHookMixin ):
50- def __init__ (self ):
51- self .descr = 'HPCG reference benchmark'
52- self .valid_systems = ['daint:mc' , 'daint:gpu' , 'dom:gpu' , 'dom:mc' ]
53- self .valid_prog_environs = ['PrgEnv-gnu' ]
50+ descr = 'HPCG reference benchmark'
51+ valid_systems = ['daint:mc' , 'daint:gpu' , 'dom:gpu' , 'dom:mc' ]
52+ valid_prog_environs = ['PrgEnv-gnu' ]
53+ build_system = 'Make'
54+ sourcesdir = 'https://github.com/hpcg-benchmark/hpcg.git'
55+ executable = 'bin/xhpcg'
56+ executable_opts = ['--nx=104' , '--ny=104' , '--nz=104' , '-t2' ]
57+ # use glob to catch the output file suffix dependent on execution time
58+ output_file = sn .getitem (sn .glob ('HPCG*.txt' ), 0 )
59+ num_tasks = 0
60+ num_cpus_per_task = 1
61+
62+ reference = {
63+ 'daint:gpu' : {
64+ 'gflops' : (7.6 , - 0.1 , None , 'Gflop/s' )
65+ },
66+ 'daint:mc' : {
67+ 'gflops' : (13.4 , - 0.1 , None , 'Gflop/s' )
68+ },
69+ 'dom:gpu' : {
70+ 'gflops' : (7.6 , - 0.1 , None , 'Gflop/s' )
71+ },
72+ 'dom:mc' : {
73+ 'gflops' : (13.4 , - 0.1 , None , 'Gflop/s' )
74+ }
75+ }
76+
77+ maintainers = ['SK' , 'EK' ]
78+ tags = {'diagnostic' , 'benchmark' , 'craype' , 'external-resources' }
79+
80+ @run_after ('init' )
81+ def set_modules (self ):
5482 if self .current_system .name in {'daint' , 'dom' }:
5583 self .modules = ['craype-hugepages8M' ]
5684
57- self .build_system = 'Make'
85+ @run_before ('compile' )
86+ def set_build_opts (self ):
5887 self .build_system .options = ['arch=MPI_GCC_OMP' ]
59- self .sourcesdir = 'https://github.com/hpcg-benchmark/hpcg.git'
60- self .executable = 'bin/xhpcg'
61- self .executable_opts = ['--nx=104' , '--ny=104' , '--nz=104' , '-t2' ]
62- # use glob to catch the output file suffix dependent on execution time
63- self .output_file = sn .getitem (sn .glob ('HPCG*.txt' ), 0 )
64-
65- self .num_tasks = 0
66- self .num_cpus_per_task = 1
67- self .system_num_tasks = {
68- 'daint:mc' : 36 ,
69- 'daint:gpu' : 12 ,
70- 'dom:mc' : 36 ,
71- 'dom:gpu' : 12
72- }
7388
74- self .reference = {
75- 'daint:gpu' : {
76- 'gflops' : (7.6 , - 0.1 , None , 'Gflop/s' )
77- },
78- 'daint:mc' : {
79- 'gflops' : (13.4 , - 0.1 , None , 'Gflop/s' )
80- },
81- 'dom:gpu' : {
82- 'gflops' : (7.6 , - 0.1 , None , 'Gflop/s' )
83- },
84- 'dom:mc' : {
85- 'gflops' : (13.4 , - 0.1 , None , 'Gflop/s' )
86- }
87- }
88-
89- self .maintainers = ['SK' , 'EK' ]
90- self .tags = {'diagnostic' , 'benchmark' , 'craype' , 'external-resources' }
9189
9290 @property
93- @sn . sanity_function
91+ @deferrable
9492 def num_tasks_assigned (self ):
9593 return self .job .num_tasks
9694
9795 @run_before ('compile' )
9896 def set_tasks (self ):
99- self .num_tasks_per_node = self .system_num_tasks .get (
100- self .current_partition .fullname , 1
101- )
97+ if self .current_partition .processor .num_cores :
98+ self .num_tasks_per_node = (
99+ self .current_partition .processor .num_cores
100+ )
101+ else :
102+ self .num_tasks_per_node = 1
102103
103- @run_before ( 'performance ' )
104- def set_performance (self ):
105- num_nodes = self .num_tasks_assigned / self .num_tasks_per_node
106- self . perf_patterns = {
107- 'gflops' : sn .extractsingle (
104+ @performance_function ( 'Gflop/s ' )
105+ def gflops (self ):
106+ num_nodes = self .num_tasks_assigned // self .num_tasks_per_node
107+ return (
108+ sn .extractsingle (
108109 r'HPCG result is VALID with a GFLOP\/s rating of=\s*'
109110 r'(?P<perf>\S+)' ,
110111 self .output_file , 'perf' , float ) / num_nodes
111- }
112+ )
112113
113- @run_before ( 'sanity' )
114- def set_sanity (self ):
115- self . sanity_patterns = sn .all ([
114+ @sanity_function
115+ def validate_passed (self ):
116+ return sn .all ([
116117 sn .assert_eq (4 , sn .count (
117118 sn .findall (r'PASSED' , self .output_file ))),
118119 sn .assert_eq (0 , self .num_tasks_assigned % self .num_tasks_per_node )
@@ -121,56 +122,56 @@ def set_sanity(self):
121122
122123@rfm .simple_test
123124class HPCGCheckMKL (rfm .RegressionTest , HPCGHookMixin ):
124- def __init__ (self ):
125- self .descr = 'HPCG benchmark Intel MKL implementation'
126- self .valid_systems = ['daint:mc' , 'dom:mc' , 'daint:gpu' , 'dom:gpu' ]
127- self .valid_prog_environs = ['PrgEnv-intel' ]
128- self .modules = ['craype-hugepages8M' ]
129- self .build_system = 'Make'
130- self .prebuild_cmds = ['cp -r ${MKLROOT}/benchmarks/hpcg/* .' ,
131- 'mv Make.CrayXC setup' , './configure CrayXC' ]
132-
133- self .num_tasks = 0
134- self .problem_size = 104
135-
136- self .variables = {
137- 'HUGETLB_VERBOSE' : '0' ,
138- 'MPICH_MAX_THREAD_SAFETY' : 'multiple' ,
139- 'MPICH_USE_DMAPP_COLL' : '1' ,
140- 'PMI_NO_FORK' : '1' ,
141- 'KMP_AFFINITY' : 'granularity=fine,compact'
142- }
125+ descr = 'HPCG benchmark Intel MKL implementation'
126+ valid_systems = ['daint:mc' , 'dom:mc' , 'daint:gpu' , 'dom:gpu' ]
127+ valid_prog_environs = ['PrgEnv-intel' ]
128+ modules = ['craype-hugepages8M' ]
129+ build_system = 'Make'
130+ prebuild_cmds = ['cp -r ${MKLROOT}/benchmarks/hpcg/* .' ,
131+ 'mv Make.CrayXC setup' , './configure CrayXC' ]
132+
133+ num_tasks = 0
134+ problem_size = 104
135+ variables = {
136+ 'HUGETLB_VERBOSE' : '0' ,
137+ 'MPICH_MAX_THREAD_SAFETY' : 'multiple' ,
138+ 'MPICH_USE_DMAPP_COLL' : '1' ,
139+ 'PMI_NO_FORK' : '1' ,
140+ 'KMP_AFFINITY' : 'granularity=fine,compact'
141+ }
142+
143+ executable = 'bin/xhpcg_avx2'
144+ reference = {
145+ 'dom:mc' : {
146+ 'gflops' : (22 , - 0.1 , None , 'Gflop/s' )
147+ },
148+ 'daint:mc' : {
149+ 'gflops' : (22 , - 0.1 , None , 'Gflop/s' )
150+ },
151+ 'dom:gpu' : {
152+ 'gflops' : (10.7 , - 0.1 , None , 'Gflop/s' )
153+ },
154+ 'daint:gpu' : {
155+ 'gflops' : (10.7 , - 0.1 , None , 'Gflop/s' )
156+ },
157+ }
158+
159+ maintainers = ['SK' ]
160+ tags = {'diagnostic' , 'benchmark' , 'craype' }
143161
144- self .executable = 'bin/xhpcg_avx2'
162+ @run_before ('run' )
163+ def set_exec_opt (self ):
145164 self .executable_opts = [f'--nx={ self .problem_size } ' ,
146165 f'--ny={ self .problem_size } ' ,
147166 f'--nz={ self .problem_size } ' , '-t2' ]
148167
149- self .reference = {
150- 'dom:mc' : {
151- 'gflops' : (22 , - 0.1 , None , 'Gflop/s' )
152- },
153- 'daint:mc' : {
154- 'gflops' : (22 , - 0.1 , None , 'Gflop/s' )
155- },
156- 'dom:gpu' : {
157- 'gflops' : (10.7 , - 0.1 , None , 'Gflop/s' )
158- },
159- 'daint:gpu' : {
160- 'gflops' : (10.7 , - 0.1 , None , 'Gflop/s' )
161- },
162- }
163-
164- self .maintainers = ['SK' ]
165- self .tags = {'diagnostic' , 'benchmark' , 'craype' }
166-
167168 @property
168- @sn . sanity_function
169+ @deferrable
169170 def num_tasks_assigned (self ):
170171 return self .job .num_tasks
171172
172173 @property
173- @sn . sanity_function
174+ @deferrable
174175 def outfile_lazy (self ):
175176 pattern = (f'n{ self .problem_size } -{ self .job .num_tasks } p-'
176177 f'{ self .num_cpus_per_task } t*.*' )
@@ -185,22 +186,22 @@ def set_tasks(self):
185186 self .num_tasks_per_node = 4
186187 self .num_cpus_per_task = 18
187188
188- @run_before ( 'performance ' )
189- def set_performance (self ):
189+ @performance_function ( 'Gflop/s ' )
190+ def gflops (self ):
190191 # since this is a flexible test, we divide the extracted
191192 # performance by the number of nodes and compare
192193 # against a single reference
193- num_nodes = self .num_tasks_assigned / self .num_tasks_per_node
194- self . perf_patterns = {
195- 'gflops' : sn .extractsingle (
194+ num_nodes = self .num_tasks_assigned // self .num_tasks_per_node
195+ return (
196+ sn .extractsingle (
196197 r'HPCG result is VALID with a GFLOP\/s rating of(=|:)\s*'
197198 r'(?P<perf>\S+)' ,
198199 self .outfile_lazy , 'perf' , float ) / num_nodes
199- }
200+ )
200201
201- @run_before ( 'sanity' )
202- def set_sanity (self ):
203- self . sanity_patterns = sn .all ([
202+ @sanity_function
203+ def validate_passed (self ):
204+ return sn .all ([
204205 sn .assert_not_found (
205206 r'invalid because the ratio' ,
206207 self .outfile_lazy ,
@@ -215,21 +216,41 @@ def set_sanity(self):
215216
216217@rfm .simple_test
217218class HPCG_GPUCheck (rfm .RunOnlyRegressionTest , HPCGHookMixin ):
218- def __init__ (self ):
219- self .maintainers = ['SK' , 'VH' ]
220- self .descr = 'HPCG benchmark on GPUs'
219+ descr = 'HPCG benchmark on GPUs'
220+ # there's no binary with support for CUDA 10 yet
221+ valid_systems = []
222+ valid_prog_environs = ['PrgEnv-gnu' ]
223+ modules = ['craype-accel-nvidia60' , 'craype-hugepages8M' ]
224+ executable = 'xhpcg_gpu_3.1'
225+ num_tasks = 0
226+ num_tasks_per_node = 1
227+ output_file = sn .getitem (sn .glob ('*.yaml' ), 0 )
228+ reference = {
229+ 'daint:gpu' : {
230+ 'gflops' : (94.7 , - 0.1 , None , 'Gflop/s' )
231+ },
232+ 'dom:gpu' : {
233+ 'gflops' : (94.7 , - 0.1 , None , 'Gflop/s' )
234+ },
235+ }
236+ maintainers = ['SK' , 'VH' ]
237+
238+ @run_after ('setup' )
239+ def set_num_tasks (self ):
240+ if self .current_partition .processor .num_cores :
241+ self .num_cpus_per_task = (
242+ self .current_partition .processor .num_cores
243+ )
244+ else :
245+ self .skip (msg = 'number of cores is not set in the configuration' )
246+
247+ @run_after ('init' )
248+ def set_sourcedir (self ):
221249 self .sourcesdir = os .path .join (self .current_system .resourcesdir ,
222250 'HPCG' )
223251
224- # there's no binary with support for CUDA 10 yet
225- self .valid_systems = ['daint:gpu' ]
226- self .valid_prog_environs = ['PrgEnv-gnu' ]
227- self .modules = ['craype-accel-nvidia60' , 'craype-hugepages8M' ]
228- self .executable = 'xhpcg_gpu_3.1'
229- self .prerun_cmds = ['chmod +x %s' % self .executable ]
230- self .num_tasks = 0
231- self .num_tasks_per_node = 1
232- self .num_cpus_per_task = 12
252+ @run_after ('init' )
253+ def set_variables (self ):
233254 self .variables = {
234255 'PMI_NO_FORK' : '1' ,
235256 'MPICH_USE_DMAPP_COLL' : '1' ,
@@ -239,32 +260,29 @@ def __init__(self):
239260 'HUGETLB_DEFAULT_PAGE_SIZE' : '8M' ,
240261 }
241262
242- self .output_file = sn .getitem (sn .glob ('*.yaml' ), 0 )
243-
244- self .reference = {
245- 'daint:gpu' : {
246- 'gflops' : (94.7 , - 0.1 , None , 'Gflop/s' )
247- },
248- 'dom:gpu' : {
249- 'gflops' : (94.7 , - 0.1 , None , 'Gflop/s' )
250- },
251- }
252-
253- num_nodes = self .num_tasks_assigned / self .num_tasks_per_node
254- self .perf_patterns = {
255- 'gflops' : sn .extractsingle (
256- r'HPCG result is VALID with a GFLOP\/s rating of:\s*'
257- r'(?P<perf>\S+)' ,
258- self .output_file , 'perf' , float ) / num_nodes
259- }
263+ @run_before ('run' )
264+ def set_exec_permissions (self ):
265+ self .prerun_cmds = ['chmod +x %s' % self .executable ]
260266
261- self .sanity_patterns = sn .all ([
267+ @sanity_function
268+ def validate_passed (self ):
269+ return sn .all ([
262270 sn .assert_eq (4 , sn .count (
263271 sn .findall (r'PASSED' , self .output_file ))),
264272 sn .assert_eq (0 , self .num_tasks_assigned % self .num_tasks_per_node )
265273 ])
266274
275+ @performance_function ('Gflop/s' )
276+ def gflops (self ):
277+ num_nodes = self .num_tasks_assigned // self .num_tasks_per_node
278+ return (
279+ sn .extractsingle (
280+ r'HPCG result is VALID with a GFLOP\/s rating of:\s*'
281+ r'(?P<perf>\S+)' ,
282+ self .output_file , 'perf' , float ) / num_nodes
283+ )
284+
267285 @property
268- @sn . sanity_function
286+ @deferrable
269287 def num_tasks_assigned (self ):
270288 return self .job .num_tasks
0 commit comments