Skip to content

Commit 4f6bf82

Browse files
committed
Merge remote-tracking branch 'thomas/GS_WP' into neuralpint
2 parents e1999ef + 09a7eb6 commit 4f6bf82

File tree

6 files changed

+44
-12
lines changed

6 files changed

+44
-12
lines changed

pySDC/implementations/convergence_controller_classes/step_size_limiter.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,7 @@ def _round_step_size(dt, fac, digits):
192192

193193
def get_new_step_size(self, controller, S, **kwargs):
194194
"""
195-
Enforce an upper and lower limit to the step size here.
196-
Be aware that this is only tested when a new step size has been determined. That means if you set an initial
197-
value for the step size outside of the limits, and you don't do any further step size control, that value will
198-
go through.
199-
Also, the final step is adjusted such that we reach Tend as best as possible, which might give step sizes below
200-
the lower limit set here.
195+
Round step size here
201196
202197
Args:
203198
controller (pySDC.Controller): The controller

pySDC/implementations/problem_classes/RayleighBenard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ def __init__(
131131
self.Dz = S1 @ Dz
132132
self.Dzz = S2 @ Dzz
133133

134-
kappa = (Rayleigh * Prandtl) ** (-1 / 2.0)
135-
nu = (Rayleigh / Prandtl) ** (-1 / 2.0)
134+
# compute rescaled Rayleigh number to extract viscosity and thermal diffusivity
135+
Ra = Rayleigh / (abs(BCs['T_top'] - BCs['T_bottom']) * self.axes[1].L ** 3)
136+
kappa = (Ra * Prandtl) ** (-1 / 2.0)
137+
nu = (Ra / Prandtl) ** (-1 / 2.0)
136138

137139
# construct operators
138140
L_lhs = {

pySDC/projects/GPU/analysis_scripts/parallel_scaling.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def plot_scaling_test(self, ax, quantity='time', **plotting_params): # pragma:
134134
timing_step = get_sorted(stats, type='timing_step')
135135

136136
t_mean = np.mean([me[1] for me in timing_step])
137+
t_min = np.min([me[1] for me in timing_step][1:])
137138

138139
if quantity == 'throughput':
139140
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:
147148
timings[np.prod(procs) / self.tasks_per_node] = t_mean
148149
elif quantity == 'time_per_task':
149150
timings[np.prod(procs)] = t_mean
151+
elif quantity == 'min_time_per_task':
152+
timings[np.prod(procs)] = t_min
150153
else:
151154
raise NotImplementedError
152155
except (FileNotFoundError, ValueError):
@@ -167,6 +170,7 @@ def plot_scaling_test(self, ax, quantity='time', **plotting_params): # pragma:
167170
'throughput_per_task': 'throughput / DoF/s',
168171
'time': r'$t_\mathrm{step}$ / s',
169172
'time_per_task': r'$t_\mathrm{step}$ / s',
173+
'min_time_per_task': r'minimal $t_\mathrm{step}$ / s',
170174
'efficiency': 'efficiency / DoF/s/task',
171175
}
172176
ax.set_ylabel(labels[quantity])
@@ -358,6 +362,7 @@ def plot_scalings(problem, **kwargs): # pragma: no cover
358362
('RBC', 'throughput'): {'x': [1 / 10, 64], 'y': [2e4, 2e4 * 640]},
359363
('RBC', 'time'): {'x': [1 / 10, 64], 'y': [60, 60 / 640]},
360364
('RBC', 'time_per_task'): {'x': [1, 640], 'y': [60, 60 / 640]},
365+
('RBC', 'min_time_per_task'): {'x': [1, 640], 'y': [60, 60 / 640]},
361366
('RBC', 'throughput_per_task'): {'x': [1 / 1, 640], 'y': [2e4, 2e4 * 640]},
362367
}
363368

@@ -373,7 +378,7 @@ def plot_scalings(problem, **kwargs): # pragma: no cover
373378
fig.savefig(path, bbox_inches='tight')
374379
print(f'Saved {path!r}', flush=True)
375380

376-
for quantity in ['time', 'throughput', 'time_per_task', 'throughput_per_task'][::-1]:
381+
for quantity in ['time', 'throughput', 'time_per_task', 'throughput_per_task', 'min_time_per_task'][::-1]:
377382
fig, ax = plt.subplots(figsize=figsize_by_journal('TUHH_thesis', 1, 0.6))
378383
for config in configs:
379384
config.plot_scaling_test(ax=ax, quantity=quantity)

pySDC/projects/GPU/analysis_scripts/plot_RBC_matrix.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,36 @@ def plot_ultraspherical():
6161
plt.show()
6262

6363

64+
def plot_DCT():
65+
fig, axs = plt.subplots(1, 3, figsize=figsize_by_journal('TUHH_thesis', 1, 0.28), sharey=True)
66+
67+
N = 8
68+
color = 'black'
69+
70+
x = np.linspace(0, 3, N)
71+
y = x**3 - 4 * x**2
72+
axs[0].plot(y, marker='o', color=color)
73+
74+
y_m = np.append(y, y[::-1])
75+
axs[1].scatter(np.arange(2 * N)[::2], y_m[::2], marker='<', color=color)
76+
axs[1].scatter(np.arange(2 * N)[1::2], y_m[1::2], marker='>', color=color)
77+
axs[1].plot(np.arange(2 * N), y_m, color=color)
78+
79+
v = y_m[::2]
80+
axs[2].plot(np.arange(N), v, color=color, marker='x')
81+
82+
axs[0].set_title('original')
83+
axs[1].set_title('mirrored')
84+
axs[2].set_title('periodically reordered')
85+
86+
for ax in axs:
87+
# ax.set_xlabel(r'$n$')
88+
ax.set_yticks([])
89+
fig.savefig('plots/DCT_via_FFT.pdf', bbox_inches='tight', dpi=300)
90+
91+
6492
if __name__ == '__main__':
6593
setup_mpl()
66-
plot_ultraspherical()
94+
plot_DCT()
95+
# plot_ultraspherical()
96+
plt.show()

pySDC/projects/GPU/configs/RBC_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def get_controller_params(self, *args, **kwargs):
385385
class RayleighBenard_large(RayleighBenardRegular):
386386
# res_per_plume = 256
387387
# vertical_res = 1024
388-
Ra = 2e7
388+
Ra = 3.2e8
389389
relaxation_steps = 5
390390

391391
def get_description(self, *args, **kwargs):

pySDC/projects/Resilience/RBC.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import numpy as np
1616

17-
PROBLEM_PARAMS = {'Rayleigh': 2e4, 'nx': 256, 'nz': 128, 'max_cached_factorizations': 30}
17+
PROBLEM_PARAMS = {'Rayleigh': 3.2e5, 'nx': 256, 'nz': 128, 'max_cached_factorizations': 30}
1818

1919

2020
def u_exact(self, t, u_init=None, t_init=None, recompute=False, _t0=None):

0 commit comments

Comments
 (0)