Skip to content

Commit

Permalink
Merge pull request #2351 from rsarm/update-syntax/vasp
Browse files Browse the repository at this point in the history
[test ] Update syntax of VASP check
  • Loading branch information
Vasileios Karakasis authored Dec 20, 2021
2 parents c79d952 + 4e6e0f7 commit c5bb6ab
Showing 1 changed file with 70 additions and 61 deletions.
131 changes: 70 additions & 61 deletions cscs-checks/apps/vasp/vasp_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,61 @@


class VASPCheck(rfm.RunOnlyRegressionTest):
def __init__(self):
keep_files = ['OUTCAR']
maintainers = ['LM']
tags = {'scs'}
strict_check = False
modules = ['VASP']
extra_resources = {
'switches': {
'num_switches': 1
}
}

@run_after('init')
def setup_by_system(self):
if self.current_system.name in ['eiger', 'pilatus']:
self.valid_prog_environs = ['cpeIntel']
else:
self.valid_prog_environs = ['builtin']

self.modules = ['VASP']
@sanity_function
def assert_reference(self):
force = sn.extractsingle(r'1 F=\s+(?P<result>\S+)',
self.stdout, 'result', float)
self.sanity_patterns = sn.assert_reference(
force, -.85026214E+03, -1e-5, 1e-5
)
self.keep_files = ['OUTCAR']
self.perf_patterns = {
'time': sn.extractsingle(r'Total CPU time used \(sec\):'
r'\s+(?P<time>\S+)', 'OUTCAR',
'time', float)
}
self.maintainers = ['LM']
self.tags = {'scs'}
self.strict_check = False
self.extra_resources = {
'switches': {
'num_switches': 1
}
}
return sn.assert_reference(force, -.85026214E+03, -1e-5, 1e-5)

@performance_function('s')
def time(self):
return sn.extractsingle(r'Total CPU time used \(sec\):'
r'\s+(?P<time>\S+)', 'OUTCAR',
'time', float)


@rfm.parameterized_test(*([v] for v in ['maint', 'prod']))
@rfm.simple_test
class VASPCpuCheck(VASPCheck):
def __init__(self, variant):
super().__init__()
self.descr = f'VASP CPU check (variant: {variant})'
self.valid_systems = ['daint:mc', 'dom:mc', 'eiger:mc', 'pilatus:mc']
variant = parameter(['maint', 'prod'])
valid_systems = ['daint:mc', 'dom:mc', 'eiger:mc', 'pilatus:mc']
executable = 'vasp_std'
references_by_variant = {
'maint': {
'dom:mc': {'time': (148.7, None, 0.05, 's')},
'daint:mc': {'time': (105.3, None, 0.20, 's')},
'eiger:mc': {'time': (100.0, None, 0.10, 's')},
'pilatus:mc': {'time': (100.0, None, 0.10, 's')}
},
'prod': {
'dom:mc': {'time': (148.7, None, 0.05, 's')},
'daint:mc': {'time': (105.3, None, 0.20, 's')},
'eiger:mc': {'time': (100.0, None, 0.10, 's')},
'pilatus:mc': {'time': (100.0, None, 0.10, 's')}
}
}

@run_after('init')
def setup_by_variant(self):
self.descr = f'VASP CPU check (variant: {self.variant})'

self.executable = 'vasp_std'
if self.current_system.name == 'dom':
self.num_tasks = 72
self.num_tasks_per_node = 12
Expand All @@ -65,22 +84,9 @@ def __init__(self, variant):
self.num_tasks_per_node = 2
self.use_multithreading = True

references = {
'maint': {
'dom:mc': {'time': (148.7, None, 0.05, 's')},
'daint:mc': {'time': (105.3, None, 0.20, 's')},
'eiger:mc': {'time': (100.0, None, 0.10, 's')},
'pilatus:mc': {'time': (100.0, None, 0.10, 's')}
},
'prod': {
'dom:mc': {'time': (148.7, None, 0.05, 's')},
'daint:mc': {'time': (105.3, None, 0.20, 's')},
'eiger:mc': {'time': (100.0, None, 0.10, 's')},
'pilatus:mc': {'time': (100.0, None, 0.10, 's')}
}
}
self.reference = references[variant]
self.tags |= {'maintenance' if variant == 'maint' else 'production'}
self.reference = self.references_by_variant[self.variant]
self.tags |= {'maintenance'
if self.variant == 'maint' else 'production'}

@run_before('run')
def set_task_distribution(self):
Expand All @@ -91,31 +97,34 @@ def set_cpu_binding(self):
self.job.launcher.options = ['--cpu-bind=cores']


@rfm.parameterized_test(*([v] for v in ['maint', 'prod']))
@rfm.simple_test
class VASPGpuCheck(VASPCheck):
def __init__(self, variant):
super().__init__()
self.descr = f'VASP GPU check (variant: {variant})'
self.valid_systems = ['daint:gpu', 'dom:gpu']
self.executable = 'vasp_gpu'
self.variables = {'CRAY_CUDA_MPS': '1'}
self.num_gpus_per_node = 1
variant = parameter(['maint', 'prod'])
valid_systems = ['daint:gpu', 'dom:gpu']
executable = 'vasp_gpu'
variables = {'CRAY_CUDA_MPS': '1'}
num_gpus_per_node = 1
references_by_variant = {
'maint': {
'dom:gpu': {'time': (61.0, None, 0.10, 's')},
'daint:gpu': {'time': (46.7, None, 0.20, 's')},
},
'prod': {
'dom:gpu': {'time': (61.0, None, 0.10, 's')},
'daint:gpu': {'time': (46.7, None, 0.20, 's')},
}
}

@run_after('init')
def setup_by_variant(self):
self.descr = f'VASP GPU check (variant: {self.variant})'
if self.current_system.name == 'dom':
self.num_tasks = 6
self.num_tasks_per_node = 1
else:
self.num_tasks = 16
self.num_tasks_per_node = 1

references = {
'maint': {
'dom:gpu': {'time': (61.0, None, 0.10, 's')},
'daint:gpu': {'time': (46.7, None, 0.20, 's')},
},
'prod': {
'dom:gpu': {'time': (61.0, None, 0.10, 's')},
'daint:gpu': {'time': (46.7, None, 0.20, 's')},
}
}
self.reference = references[variant]
self.tags |= {'maintenance' if variant == 'maint' else 'production'}
self.reference = self.references_by_variant[self.variant]
self.tags |= {'maintenance'
if self.variant == 'maint' else 'production'}

0 comments on commit c5bb6ab

Please sign in to comment.