Skip to content

Commit 58e1faa

Browse files
author
Luca
committed
Address comments and update setup
1 parent 3c71eb2 commit 58e1faa

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

cscs-checks/apps/vasp/vasp_check.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
@rfm.simple_test
1111
class VASPCheck(rfm.RunOnlyRegressionTest):
12-
descr = f'VASP check '
1312
modules = ['VASP']
1413
executable = 'vasp_std'
1514
extra_resources = {
@@ -54,7 +53,7 @@ class VASPCheck(rfm.RunOnlyRegressionTest):
5453
}
5554

5655
@performance_function('s')
57-
def time(self):
56+
def elapsed_time(self):
5857
return sn.extractsingle(r'Elapsed time \(sec\):'
5958
r'\s+(?P<time>\S+)', 'OUTCAR',
6059
'time', float)
@@ -68,7 +67,7 @@ def assert_reference(self):
6867

6968
@run_after('init')
7069
def setup_system_filtering(self):
71-
self.descr += f' ({self.num_nodes} node(s))'
70+
self.descr = f'VASP check ({self.num_nodes} node(s))'
7271

7372
# setup system filter
7473
valid_systems = {
@@ -77,10 +76,9 @@ def setup_system_filtering(self):
7776
16: ['daint:gpu', 'daint:mc', 'eiger:mc']
7877
}
7978

80-
try:
81-
self.valid_systems = valid_systems[self.num_nodes]
82-
except KeyError:
83-
self.valid_systems = []
79+
self.skip_if(self.num_nodes not in valid_systems,
80+
f'No valid systems found for {self.num_nodes}(s)')
81+
self.valid_systems = valid_systems[self.num_nodes]
8482

8583
# setup programming environment filter
8684
if self.current_system.name in ['eiger', 'pilatus']:
@@ -92,8 +90,10 @@ def setup_system_filtering(self):
9290
@run_before('run')
9391
def setup_run(self):
9492
# set auto-detected architecture
93+
self.skip_if_no_procinfo()
9594
proc = self.current_partition.processor
9695
arch = proc.arch
96+
9797
# set architecture for GPU partition (no auto-detection)
9898
if self.current_partition.fullname in ('daint:gpu', 'dom:gpu'):
9999
arch = 'sm_60'
@@ -104,27 +104,25 @@ def setup_run(self):
104104
self.skip(f'Configuration with {self.num_nodes} node(s) '
105105
f'is not supported on {arch!r}')
106106

107-
# custom settings for each architecture
108-
if arch == 'sm_60':
109-
self.num_tasks_per_node = 1
110-
elif arch == 'broadwell':
111-
self.num_tasks_per_node = 2
112-
elif arch == 'zen2':
113-
self.num_tasks_per_node = 4
114-
self.variables = {
115-
'MPICH_OFI_STARTUP_CONNECT': '1'
116-
}
117-
118107
# common setup for every architecture
119108
self.job.launcher.options = ['--cpu-bind=cores']
120109
self.job.options = ['--distribution=block:block']
121-
self.num_cpus_per_task = int(proc.num_cores / self.num_tasks_per_node)
110+
self.num_tasks_per_node = proc.num_sockets
111+
self.num_cpus_per_task = proc.num_cores // self.num_tasks_per_node
122112
self.num_tasks = self.num_nodes * self.num_tasks_per_node
123113
self.variables = {
124114
'OMP_NUM_THREADS': str(self.num_cpus_per_task),
125115
'OMP_PLACES': 'cores',
126116
'OMP_PROC_BIND': 'close'
127117
}
128118

119+
# custom settings for selected architectures
120+
if arch == 'sm_60':
121+
self.num_gpus_per_node = 1
122+
elif arch == 'zen2':
123+
self.variables += {
124+
'MPICH_OFI_STARTUP_CONNECT': '1'
125+
}
126+
129127
# setup performance references
130128
self.reference = self.references[self.num_nodes][arch]

0 commit comments

Comments
 (0)