diff --git a/pySDC/implementations/convergence_controller_classes/step_size_limiter.py b/pySDC/implementations/convergence_controller_classes/step_size_limiter.py index c3c7ede145..10b4cd18b0 100644 --- a/pySDC/implementations/convergence_controller_classes/step_size_limiter.py +++ b/pySDC/implementations/convergence_controller_classes/step_size_limiter.py @@ -192,12 +192,7 @@ def _round_step_size(dt, fac, digits): def get_new_step_size(self, controller, S, **kwargs): """ - Enforce an upper and lower limit to the step size here. - Be aware that this is only tested when a new step size has been determined. That means if you set an initial - value for the step size outside of the limits, and you don't do any further step size control, that value will - go through. - Also, the final step is adjusted such that we reach Tend as best as possible, which might give step sizes below - the lower limit set here. + Round step size here Args: controller (pySDC.Controller): The controller diff --git a/pySDC/implementations/problem_classes/RayleighBenard.py b/pySDC/implementations/problem_classes/RayleighBenard.py index 71e64a5a78..00859ef0b2 100644 --- a/pySDC/implementations/problem_classes/RayleighBenard.py +++ b/pySDC/implementations/problem_classes/RayleighBenard.py @@ -131,8 +131,10 @@ def __init__( self.Dz = S1 @ Dz self.Dzz = S2 @ Dzz - kappa = (Rayleigh * Prandtl) ** (-1 / 2.0) - nu = (Rayleigh / Prandtl) ** (-1 / 2.0) + # compute rescaled Rayleigh number to extract viscosity and thermal diffusivity + Ra = Rayleigh / (abs(BCs['T_top'] - BCs['T_bottom']) * self.axes[1].L ** 3) + kappa = (Ra * Prandtl) ** (-1 / 2.0) + nu = (Ra / Prandtl) ** (-1 / 2.0) # construct operators L_lhs = { diff --git a/pySDC/projects/GPU/analysis_scripts/parallel_scaling.py b/pySDC/projects/GPU/analysis_scripts/parallel_scaling.py index 2a61f9b986..76d593413b 100644 --- a/pySDC/projects/GPU/analysis_scripts/parallel_scaling.py +++ b/pySDC/projects/GPU/analysis_scripts/parallel_scaling.py @@ -134,6 +134,7 @@ def plot_scaling_test(self, ax, quantity='time', **plotting_params): # pragma: timing_step = get_sorted(stats, type='timing_step') t_mean = np.mean([me[1] for me in timing_step]) + t_min = np.min([me[1] for me in timing_step][1:]) if quantity == 'throughput': timings[np.prod(procs) / self.tasks_per_node] = experiment.res**self.ndim / t_mean @@ -147,6 +148,8 @@ def plot_scaling_test(self, ax, quantity='time', **plotting_params): # pragma: timings[np.prod(procs) / self.tasks_per_node] = t_mean elif quantity == 'time_per_task': timings[np.prod(procs)] = t_mean + elif quantity == 'min_time_per_task': + timings[np.prod(procs)] = t_min else: raise NotImplementedError except (FileNotFoundError, ValueError): @@ -167,6 +170,7 @@ def plot_scaling_test(self, ax, quantity='time', **plotting_params): # pragma: 'throughput_per_task': 'throughput / DoF/s', 'time': r'$t_\mathrm{step}$ / s', 'time_per_task': r'$t_\mathrm{step}$ / s', + 'min_time_per_task': r'minimal $t_\mathrm{step}$ / s', 'efficiency': 'efficiency / DoF/s/task', } ax.set_ylabel(labels[quantity]) @@ -358,6 +362,7 @@ def plot_scalings(problem, **kwargs): # pragma: no cover ('RBC', 'throughput'): {'x': [1 / 10, 64], 'y': [2e4, 2e4 * 640]}, ('RBC', 'time'): {'x': [1 / 10, 64], 'y': [60, 60 / 640]}, ('RBC', 'time_per_task'): {'x': [1, 640], 'y': [60, 60 / 640]}, + ('RBC', 'min_time_per_task'): {'x': [1, 640], 'y': [60, 60 / 640]}, ('RBC', 'throughput_per_task'): {'x': [1 / 1, 640], 'y': [2e4, 2e4 * 640]}, } @@ -373,7 +378,7 @@ def plot_scalings(problem, **kwargs): # pragma: no cover fig.savefig(path, bbox_inches='tight') print(f'Saved {path!r}', flush=True) - for quantity in ['time', 'throughput', 'time_per_task', 'throughput_per_task'][::-1]: + for quantity in ['time', 'throughput', 'time_per_task', 'throughput_per_task', 'min_time_per_task'][::-1]: fig, ax = plt.subplots(figsize=figsize_by_journal('TUHH_thesis', 1, 0.6)) for config in configs: config.plot_scaling_test(ax=ax, quantity=quantity) diff --git a/pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py b/pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py index 7fb489d324..7e8b24ddfd 100644 --- a/pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py +++ b/pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py @@ -61,6 +61,36 @@ def plot_ultraspherical(): plt.show() +def plot_DCT(): + fig, axs = plt.subplots(1, 3, figsize=figsize_by_journal('TUHH_thesis', 1, 0.28), sharey=True) + + N = 8 + color = 'black' + + x = np.linspace(0, 3, N) + y = x**3 - 4 * x**2 + axs[0].plot(y, marker='o', color=color) + + y_m = np.append(y, y[::-1]) + axs[1].scatter(np.arange(2 * N)[::2], y_m[::2], marker='<', color=color) + axs[1].scatter(np.arange(2 * N)[1::2], y_m[1::2], marker='>', color=color) + axs[1].plot(np.arange(2 * N), y_m, color=color) + + v = y_m[::2] + axs[2].plot(np.arange(N), v, color=color, marker='x') + + axs[0].set_title('original') + axs[1].set_title('mirrored') + axs[2].set_title('periodically reordered') + + for ax in axs: + # ax.set_xlabel(r'$n$') + ax.set_yticks([]) + fig.savefig('plots/DCT_via_FFT.pdf', bbox_inches='tight', dpi=300) + + if __name__ == '__main__': setup_mpl() - plot_ultraspherical() + plot_DCT() + # plot_ultraspherical() + plt.show() diff --git a/pySDC/projects/GPU/configs/RBC_configs.py b/pySDC/projects/GPU/configs/RBC_configs.py index e61f87d56b..6380a31d36 100644 --- a/pySDC/projects/GPU/configs/RBC_configs.py +++ b/pySDC/projects/GPU/configs/RBC_configs.py @@ -385,7 +385,7 @@ def get_controller_params(self, *args, **kwargs): class RayleighBenard_large(RayleighBenardRegular): # res_per_plume = 256 # vertical_res = 1024 - Ra = 2e7 + Ra = 3.2e8 relaxation_steps = 5 def get_description(self, *args, **kwargs): diff --git a/pySDC/projects/Resilience/RBC.py b/pySDC/projects/Resilience/RBC.py index 943ac45f74..a07588b697 100644 --- a/pySDC/projects/Resilience/RBC.py +++ b/pySDC/projects/Resilience/RBC.py @@ -14,7 +14,7 @@ import numpy as np -PROBLEM_PARAMS = {'Rayleigh': 2e4, 'nx': 256, 'nz': 128, 'max_cached_factorizations': 30} +PROBLEM_PARAMS = {'Rayleigh': 3.2e5, 'nx': 256, 'nz': 128, 'max_cached_factorizations': 30} def u_exact(self, t, u_init=None, t_init=None, recompute=False, _t0=None):