1+ # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
2+ # ReFrame Project Developers. See the top-level LICENSE file for details.
3+ #
4+ # SPDX-License-Identifier: BSD-3-Clause
5+
16import os
27import math
38
1015@rfm .simple_test
1116class SparkAnalyticsCheck (rfm .RunOnlyRegressionTest ):
1217 def __init__ (self ):
13- super ().__init__ ()
1418 self .descr = 'Simple calculation of pi with Spark'
1519 self .valid_systems = ['daint:gpu' , 'daint:mc' ]
1620 self .valid_prog_environs = ['PrgEnv-cray' ]
@@ -21,17 +25,19 @@ def __init__(self):
2125 self .stdout , 'pi' , float )
2226 self .sanity_patterns = sn .assert_lt (sn .abs (pi_value - math .pi ), 0.01 )
2327 self .maintainers = ['TM' , 'TR' ]
24- self .tags = {'production' , ' craype' }
28+ self .tags = {'craype' }
2529
26- def setup (self , partition , environ , ** job_opts ):
27- if partition .fullname == 'daint:gpu' :
30+ @rfm .run_after ('setup' )
31+ def set_num_tasks (self ):
32+ if self .current_partition .fullname == 'daint:gpu' :
2833 self .num_tasks = 48
2934 self .num_tasks_per_node = 12
3035 else :
3136 self .num_tasks = 72
3237 self .num_tasks_per_node = 18
3338
34- super ().setup (partition , environ , ** job_opts )
39+ @rfm .run_before ('run' )
40+ def set_launcher (self ):
3541 # The job launcher has to be changed since the `start_analytics`
3642 # script is not used with srun.
3743 self .job .launcher = getlauncher ('local' )()
0 commit comments