Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
lara committed Apr 3, 2024
1 parent 78c3780 commit 332c5fd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions eessi/testsuite/tests/apps/lammps/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from eessi.testsuite import hooks, utils
from eessi.testsuite.constants import * # noqa


@rfm.simple_test
class EESSI_LAMMPS(rfm.RunOnlyRegressionTest):
scale = parameter(SCALES.keys())
Expand All @@ -27,7 +28,7 @@ class EESSI_LAMMPS(rfm.RunOnlyRegressionTest):
def assert_lammps_openmp_treads(self):
'''Assert that OpenMP thread(s) per MPI task is set'''
n_threads = sn.extractsingle(
'^ using (?P<threads>[0-9]+) OpenMP thread\(s\) per MPI task', self.stdout, 'threads', int)
r'^ using (?P<threads>[0-9]+) OpenMP thread\(s\) per MPI task', self.stdout, 'threads', int)

return sn.assert_eq(n_threads, self.num_cpus_per_task)

Expand All @@ -44,10 +45,9 @@ def assert_lammps_processor_grid(self):
def assert_total_nr_neigbors(self):
'''Assert that the test calulated the right number of neighbours'''
n_neighbours = sn.extractsingle(
'^Total \# of neighbors \= (?P<neighbours>\S+)', self.stdout, 'neighbours', int)

return sn.assert_eq(n_neighbours, 1202833)
r'^Total # of neighbors = (?P<neighbours>\S+)', self.stdout, 'neighbours', int)

return sn.assert_eq(n_neighbours, 1202833)

@sanity_function
def assert_sanity(self):
Expand All @@ -58,7 +58,6 @@ def assert_sanity(self):
self.assert_total_nr_neigbors(),
])


@performance_function('img/s')
def perf(self):
regex = r'^(?P<perf>[.0-9]+)% CPU use with [0-9]+ MPI tasks x [0-9]+ OpenMP threads'
Expand Down

0 comments on commit 332c5fd

Please sign in to comment.