Skip to content

Commit 3ed3d6d

Browse files
committed
fix comments
1 parent 2f5f2e1 commit 3ed3d6d

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

cscs-checks/system/slurm/slurm.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@ def assert_found_oom(self):
214214

215215
@run_before('performance')
216216
def set_perf_patterns(self):
217-
regex = (r'^Eating \d+ MB\/mpi \*\d+mpi = -\d+ MB memory from \/proc\/'
218-
r'meminfo: total: \d+ GB, free: \d+ GB, avail: \d+ GB, using:'
219-
r' (\d+) GB')
220-
self.perf_patterns = {
221-
'max_cn_memory': sn.getattr(self, 'reference_meminfo'),
222-
'max_allocated_memory': sn.max(sn.extractall(regex, self.stdout,
223-
1, int)),
224-
}
225217
no_limit = (0, None, None, 'GB')
226218
self.reference = {
227219
'*': {
@@ -232,6 +224,17 @@ def set_perf_patterns(self):
232224
}
233225
}
234226

227+
@performance_function('GB')
228+
def max_cn_memory(self):
229+
return sn.getattr(self, 'reference_meminfo')
230+
231+
@performance_function('GB')
232+
def max_allocated_memory(self):
233+
regex = (r'^Eating \d+ MB\/mpi \*\d+mpi = -\d+ MB memory from \/proc\/'
234+
r'meminfo: total: \d+ GB, free: \d+ GB, avail: \d+ GB, using:'
235+
r' (\d+) GB')
236+
return sn.max(sn.extractall(regex, self.stdout, 1, int))
237+
235238
@run_before('run')
236239
def set_tasks(self):
237240
tasks_per_node = {
@@ -290,9 +293,7 @@ def set_exec_opts(self):
290293
def assert_exitcode_zero(self):
291294
return sn.assert_eq(self.job.exitcode, 0)
292295

293-
@run_before('performance')
294-
def set_perf_patterns(self):
295-
self.perf_patterns = {
296-
'real_time': sn.extractsingle(r'real (?P<real_time>\S+)',
297-
self.stderr, 'real_time', float)
298-
}
296+
@performance_function('s')
297+
def real_time(self):
298+
return sn.extractsingle(r'real (?P<real_time>\S+)', self.stderr,
299+
'real_time', float)

0 commit comments

Comments
 (0)