@@ -18,6 +18,7 @@ class ScalingConfig(object):
1818 tasks_time = 1
1919 max_steps_space = None
2020 max_steps_space_weak = None
21+ sbatch_options = []
2122
2223 def __init__ (self , space_time_parallel ):
2324 if space_time_parallel in ['False' , False ]:
@@ -36,9 +37,9 @@ def run_scaling_test(self, strong=True):
3637 for i in range (max_steps ):
3738 res , procs = self .get_resolution_and_tasks (strong , i )
3839
39- sbatch_options = [f'-n { np .prod (procs )} ' , f'-p { self .partition } ' ]
40+ sbatch_options = [f'-n { np .prod (procs )} ' , f'-p { self .partition } ' ] + self . sbatch_options
4041 if self .useGPU :
41- srun_options = ['--cpus-per-task=4' , '--gpus-per-task=1' ]
42+ srun_options = ['--cpus-per-task=4' , '--gpus-per-task=1' ] + self . sbatch_options
4243 sbatch_options += ['--cpus-per-task=4' , '--gpus-per-task=1' ]
4344 else :
4445 srun_options = []
@@ -51,7 +52,7 @@ def run_scaling_test(self, strong=True):
5152
5253 write_jobscript (sbatch_options , srun_options , command , self .cluster )
5354
54- def plot_scaling_test (self , strong , ax , plot_ideal = False , ** plotting_params ):
55+ def plot_scaling_test (self , strong , ax , plot_ideal = False , ** plotting_params ): # pragma: no cover
5556 timings = {}
5657
5758 max_steps = self .max_steps_space if strong else self .max_steps_space_weak
@@ -63,12 +64,15 @@ def plot_scaling_test(self, strong, ax, plot_ideal=False, **plotting_params):
6364 config = get_config (args )
6465
6566 path = f'data/{ config .get_path (ranks = [me - 1 for me in procs ])} -stats-whole-run.pickle'
66- with open (path , 'rb' ) as file :
67- stats = pickle .load (file )
67+ try :
68+ with open (path , 'rb' ) as file :
69+ stats = pickle .load (file )
6870
69- timing_step = get_sorted (stats , type = 'timing_step' )
71+ timing_step = get_sorted (stats , type = 'timing_step' )
7072
71- timings [np .prod (procs ) / self .tasks_per_node ] = np .mean ([me [1 ] for me in timing_step ])
73+ timings [np .prod (procs ) / self .tasks_per_node ] = np .mean ([me [1 ] for me in timing_step ])
74+ except FileNotFoundError :
75+ pass
7276
7377 ax .loglog (timings .keys (), timings .values (), ** plotting_params )
7478 if plot_ideal :
@@ -86,7 +90,8 @@ def plot_scaling_test(self, strong, ax, plot_ideal=False, **plotting_params):
8690class CPUConfig (ScalingConfig ):
8791 cluster = 'jusuf'
8892 partition = 'batch'
89- tasks_per_node = 128
93+ tasks_per_node = 16
94+ sbatch_options = ['--tasks-per-node=16' ]
9095
9196
9297class GPUConfig (ScalingConfig ):
@@ -97,7 +102,7 @@ class GPUConfig(ScalingConfig):
97102
98103
99104class GrayScottSpaceScalingCPU (CPUConfig , ScalingConfig ):
100- base_resolution = 2048
105+ base_resolution = 4096
101106 base_resolution_weak = 256
102107 config = 'GS_scaling'
103108 max_steps_space = 10
@@ -106,15 +111,15 @@ class GrayScottSpaceScalingCPU(CPUConfig, ScalingConfig):
106111
107112
108113class GrayScottSpaceScalingGPU (GPUConfig , ScalingConfig ):
109- base_resolution_weak = 256 * 32
110- base_resolution = 2048
114+ base_resolution_weak = 256 * 2
115+ base_resolution = 4096
111116 config = 'GS_scaling'
112- max_steps_space = 4
117+ max_steps_space = 6
113118 max_steps_space_weak = 4
114119 tasks_time = 3
115120
116121
117- def plot_scalings (strong , problem , kwargs ):
122+ def plot_scalings (strong , problem , kwargs ): # pragma: no cover
118123 if problem == 'GS' :
119124 fig , ax = plt .subplots ()
120125
0 commit comments