88
99
1010class VASPCheck (rfm .RunOnlyRegressionTest ):
11- def __init__ (self ):
11+ keep_files = ['OUTCAR' ]
12+ maintainers = ['LM' ]
13+ tags = {'scs' }
14+ strict_check = False
15+ modules = ['VASP' ]
16+ extra_resources = {
17+ 'switches' : {
18+ 'num_switches' : 1
19+ }
20+ }
21+
22+ @run_after ('init' )
23+ def setup_by_system (self ):
1224 if self .current_system .name in ['eiger' , 'pilatus' ]:
1325 self .valid_prog_environs = ['cpeIntel' ]
1426 else :
1527 self .valid_prog_environs = ['builtin' ]
1628
17- self .modules = ['VASP' ]
29+ @sanity_function
30+ def assert_reference (self ):
1831 force = sn .extractsingle (r'1 F=\s+(?P<result>\S+)' ,
1932 self .stdout , 'result' , float )
20- self .sanity_patterns = sn .assert_reference (
21- force , - .85026214E+03 , - 1e-5 , 1e-5
22- )
23- self .keep_files = ['OUTCAR' ]
24- self .perf_patterns = {
25- 'time' : sn .extractsingle (r'Total CPU time used \(sec\):'
26- r'\s+(?P<time>\S+)' , 'OUTCAR' ,
27- 'time' , float )
28- }
29- self .maintainers = ['LM' ]
30- self .tags = {'scs' }
31- self .strict_check = False
32- self .extra_resources = {
33- 'switches' : {
34- 'num_switches' : 1
35- }
36- }
33+ return sn .assert_reference (force , - .85026214E+03 , - 1e-5 , 1e-5 )
34+
35+ @performance_function ('s' )
36+ def time (self ):
37+ return sn .extractsingle (r'Total CPU time used \(sec\):'
38+ r'\s+(?P<time>\S+)' , 'OUTCAR' ,
39+ 'time' , float )
3740
3841
39- @rfm .parameterized_test ( * ([ v ] for v in [ 'maint' , 'prod' ]))
42+ @rfm .simple_test
4043class VASPCpuCheck (VASPCheck ):
41- def __init__ (self , variant ):
42- super ().__init__ ()
43- self .descr = f'VASP CPU check (variant: { variant } )'
44- self .valid_systems = ['daint:mc' , 'dom:mc' , 'eiger:mc' , 'pilatus:mc' ]
44+ variant = parameter (['maint' , 'prod' ])
45+ valid_systems = ['daint:mc' , 'dom:mc' , 'eiger:mc' , 'pilatus:mc' ]
46+ executable = 'vasp_std'
47+ references_by_variant = {
48+ 'maint' : {
49+ 'dom:mc' : {'time' : (148.7 , None , 0.05 , 's' )},
50+ 'daint:mc' : {'time' : (105.3 , None , 0.20 , 's' )},
51+ 'eiger:mc' : {'time' : (100.0 , None , 0.10 , 's' )},
52+ 'pilatus:mc' : {'time' : (100.0 , None , 0.10 , 's' )}
53+ },
54+ 'prod' : {
55+ 'dom:mc' : {'time' : (148.7 , None , 0.05 , 's' )},
56+ 'daint:mc' : {'time' : (105.3 , None , 0.20 , 's' )},
57+ 'eiger:mc' : {'time' : (100.0 , None , 0.10 , 's' )},
58+ 'pilatus:mc' : {'time' : (100.0 , None , 0.10 , 's' )}
59+ }
60+ }
61+
62+ @run_after ('init' )
63+ def setup_by_variant (self ):
64+ self .descr = f'VASP CPU check (variant: { self .variant } )'
4565
46- self .executable = 'vasp_std'
4766 if self .current_system .name == 'dom' :
4867 self .num_tasks = 72
4968 self .num_tasks_per_node = 12
@@ -65,22 +84,9 @@ def __init__(self, variant):
6584 self .num_tasks_per_node = 2
6685 self .use_multithreading = True
6786
68- references = {
69- 'maint' : {
70- 'dom:mc' : {'time' : (148.7 , None , 0.05 , 's' )},
71- 'daint:mc' : {'time' : (105.3 , None , 0.20 , 's' )},
72- 'eiger:mc' : {'time' : (100.0 , None , 0.10 , 's' )},
73- 'pilatus:mc' : {'time' : (100.0 , None , 0.10 , 's' )}
74- },
75- 'prod' : {
76- 'dom:mc' : {'time' : (148.7 , None , 0.05 , 's' )},
77- 'daint:mc' : {'time' : (105.3 , None , 0.20 , 's' )},
78- 'eiger:mc' : {'time' : (100.0 , None , 0.10 , 's' )},
79- 'pilatus:mc' : {'time' : (100.0 , None , 0.10 , 's' )}
80- }
81- }
82- self .reference = references [variant ]
83- self .tags |= {'maintenance' if variant == 'maint' else 'production' }
87+ self .reference = self .references_by_variant [self .variant ]
88+ self .tags |= {'maintenance'
89+ if self .variant == 'maint' else 'production' }
8490
8591 @run_before ('run' )
8692 def set_task_distribution (self ):
@@ -91,31 +97,34 @@ def set_cpu_binding(self):
9197 self .job .launcher .options = ['--cpu-bind=cores' ]
9298
9399
94- @rfm .parameterized_test ( * ([ v ] for v in [ 'maint' , 'prod' ]))
100+ @rfm .simple_test
95101class VASPGpuCheck (VASPCheck ):
96- def __init__ (self , variant ):
97- super ().__init__ ()
98- self .descr = f'VASP GPU check (variant: { variant } )'
99- self .valid_systems = ['daint:gpu' , 'dom:gpu' ]
100- self .executable = 'vasp_gpu'
101- self .variables = {'CRAY_CUDA_MPS' : '1' }
102- self .num_gpus_per_node = 1
102+ variant = parameter (['maint' , 'prod' ])
103+ valid_systems = ['daint:gpu' , 'dom:gpu' ]
104+ executable = 'vasp_gpu'
105+ variables = {'CRAY_CUDA_MPS' : '1' }
106+ num_gpus_per_node = 1
107+ references_by_variant = {
108+ 'maint' : {
109+ 'dom:gpu' : {'time' : (61.0 , None , 0.10 , 's' )},
110+ 'daint:gpu' : {'time' : (46.7 , None , 0.20 , 's' )},
111+ },
112+ 'prod' : {
113+ 'dom:gpu' : {'time' : (61.0 , None , 0.10 , 's' )},
114+ 'daint:gpu' : {'time' : (46.7 , None , 0.20 , 's' )},
115+ }
116+ }
117+
118+ @run_after ('init' )
119+ def setup_by_variant (self ):
120+ self .descr = f'VASP GPU check (variant: { self .variant } )'
103121 if self .current_system .name == 'dom' :
104122 self .num_tasks = 6
105123 self .num_tasks_per_node = 1
106124 else :
107125 self .num_tasks = 16
108126 self .num_tasks_per_node = 1
109127
110- references = {
111- 'maint' : {
112- 'dom:gpu' : {'time' : (61.0 , None , 0.10 , 's' )},
113- 'daint:gpu' : {'time' : (46.7 , None , 0.20 , 's' )},
114- },
115- 'prod' : {
116- 'dom:gpu' : {'time' : (61.0 , None , 0.10 , 's' )},
117- 'daint:gpu' : {'time' : (46.7 , None , 0.20 , 's' )},
118- }
119- }
120- self .reference = references [variant ]
121- self .tags |= {'maintenance' if variant == 'maint' else 'production' }
128+ self .reference = self .references_by_variant [self .variant ]
129+ self .tags |= {'maintenance'
130+ if self .variant == 'maint' else 'production' }
0 commit comments