Skip to content

Commit 3a29632

Browse files
author
Thomas Baumann
committed
Stuff
#!!!!!! WARNING: FLAKEHEAVEN FAILED !!!!!!: #:
1 parent 6422569 commit 3a29632

File tree

4 files changed

+113
-79
lines changed

4 files changed

+113
-79
lines changed

pySDC/implementations/problem_classes/RayleighBenard3D.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ def u_exact(self, t=0, noise_level=1e-3, seed=99):
293293
if self.spectral_space:
294294
me_hat = self.spectral.u_init_forward
295295
me_hat[:] = self.transform(me)
296+
print(
297+
f'{self.comm.rank} has {me.size} dofs in physical space and {me_hat.size} dofs in spectral space',
298+
flush=True,
299+
)
296300
return me_hat
297301
else:
298302
return me

pySDC/projects/GPU/analysis_scripts/RBC3d.py

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@
3939
profiles = {key: [] for key in ['T', 'u', 'v', 'w']}
4040
rms_profiles = {key: [] for key in profiles.keys()}
4141
spectrum = []
42+
spectrum_all = []
4243
# Re = []
4344
# CFL = []
4445

4546
X, Y = P.X[:, :, -1], P.Y[:, :, -1]
4647

4748

4849
# try to load time averaged values
49-
u_mean_profile = P.u_init_physical
50+
u_mean_profile = P.u_exact()
5051
if os.path.isfile(path):
5152
with open(path, 'rb') as file:
5253
avg_data = pickle.load(file)
@@ -71,15 +72,15 @@
7172

7273
t.append(_t)
7374

74-
u_mean = P.xp.mean(u[0])
75-
v_mean = P.xp.mean(u[1])
76-
w_mean = P.xp.mean(u[P.index('w')])
77-
u_max = P.xp.max(u[0].real)
78-
v_max = P.xp.max(u[1].real)
79-
w_max = P.xp.max(u[P.index('w')].real)
80-
u_min = P.xp.min(u[0].real)
81-
v_min = P.xp.min(u[1].real)
82-
w_min = P.xp.min(u[P.index('w')].real)
75+
# u_mean = P.xp.mean(u[0])
76+
# v_mean = P.xp.mean(u[1])
77+
# w_mean = P.xp.mean(u[P.index('w')])
78+
# u_max = P.xp.max(u[0].real)
79+
# v_max = P.xp.max(u[1].real)
80+
# w_max = P.xp.max(u[P.index('w')].real)
81+
# u_min = P.xp.min(u[0].real)
82+
# v_min = P.xp.min(u[1].real)
83+
# w_min = P.xp.min(u[P.index('w')].real)
8384
# print(f'Mean/max/min velocity at t={t[-1]:.2f}: u:{u_mean:.1e}/{u_max:.1e}/{u_min:.1e} v:{v_mean:.1e}/{v_max:.1e}/{v_min:.1e} w:{w_mean:.1e}/{w_max:.1e}/{w_min:.1e}', flush=True)
8485
if PLOT:
8586
if PADDING != 1:
@@ -97,7 +98,7 @@
9798
plt.pause(1e-9)
9899

99100
_profiles = P.get_vertical_profiles(u, list(profiles.keys()))
100-
_rms_profiles = P.get_vertical_profiles(xp.sqrt((u - u_mean_profile) ** 2), list(profiles.keys()))
101+
_rms_profiles = P.get_vertical_profiles((u - u_mean_profile) ** 2, list(profiles.keys()))
101102
for key in profiles.keys():
102103
profiles[key].append(_profiles[key])
103104
rms_profiles[key].append(_rms_profiles[key])
@@ -106,6 +107,7 @@
106107

107108
k, s = P.get_frequency_spectrum(u)
108109
spectrum.append(s[0, 0])
110+
spectrum_all.append(s)
109111
# plt.loglog(k[s[0,0]>1e-15], s[0,0][s[0,0]>1e-15])
110112
# # plt.ylim(1e-10, 1e1)
111113
# plt.pause(1e-9)
@@ -115,6 +117,9 @@
115117
t = xp.array(t)
116118
z = P.axes[-1].get_1dgrid()
117119

120+
if config.converged == 0:
121+
print('Warning: no convergence has been set for this configuration!')
122+
118123

119124
fig, axs = plt.subplots(1, 4, figsize=(18, 4))
120125
for key in Nu.keys():
@@ -151,7 +156,7 @@
151156
avg_rms_profiles = {}
152157
for key, values in rms_profiles.items():
153158
values_from_convergence = [values[i] for i in range(len(values)) if t[i] >= config.converged]
154-
avg_rms_profiles[key] = xp.mean(values_from_convergence, axis=0)
159+
avg_rms_profiles[key] = xp.sqrt(xp.mean(values_from_convergence, axis=0))
155160

156161

157162
# average T
@@ -170,7 +175,7 @@
170175
print(f'Thermal boundary layer of thickness {boundary_layer:.2f} is resolved with {res_in_boundary_layer} points')
171176
axs[2].axhline(z[max_idx], color='black')
172177
axs[2].plot(avg_T, z)
173-
axs[2].scatter(avg_T, z)
178+
axs[2].scatter(avg_T, z)
174179
axs[2].set_xlabel(r'$T_\text{rms}$')
175180
axs[2].set_ylabel('$z$')
176181

@@ -189,7 +194,10 @@
189194
'std_Nu': std_Nu,
190195
'z': P.axes[-1].get_1dgrid(),
191196
'k': k,
192-
'spectrum': avg_spectrum,
197+
'spectrum': spectrum_all,
198+
'avg_spectrum': avg_spectrum,
199+
'boundary_layer_thickness': boundary_layer,
200+
'res_in_boundary_layer': res_in_boundary_layer,
193201
}
194202
for key, values in avg_profiles.items():
195203
write_data[f'profile_{key}'] = values

pySDC/projects/GPU/analysis_scripts/parallel_scaling.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,17 @@ class RayleighBenard3DSpaceScalingGPU(GPUConfig):
372372
class RayleighBenard3DSpaceScalingGPUG4(RayleighBenard3DSpaceScalingGPU):
373373
config = 'RBC3DscalingG4R2'
374374
experiments = [
375-
Experiment(res=64, PinT=False, start=4, stop=16, marker='.'),
376-
Experiment(res=64, PinT=True, start=4, stop=32, marker='.'),
377-
Experiment(res=128, PinT=False, start=8, stop=128, marker='^'),
378-
Experiment(res=128, PinT=True, start=32, stop=256, marker='^'),
379-
Experiment(res=256, PinT=False, start=64, stop=512, marker='x'),
380-
Experiment(res=256, PinT=True, start=256, stop=1024, marker='x'),
381-
Experiment(res=384, PinT=False, start=216, stop=864, marker='o'),
382-
Experiment(res=384, PinT=True, start=864, stop=3456, marker='o'),
375+
# Experiment(res=64, PinT=False, start=4, stop=16, marker='.'),
376+
# Experiment(res=64, PinT=True, start=4, stop=32, marker='.'),
377+
# Experiment(res=128, PinT=False, start=8, stop=128, marker='^'),
378+
# Experiment(res=128, PinT=True, start=32, stop=256, marker='^'),
379+
# Experiment(res=256, PinT=False, start=64, stop=512, marker='x'),
380+
# Experiment(res=256, PinT=True, start=256, stop=1024, marker='x'),
381+
# Experiment(res=384, PinT=False, start=216, stop=864, marker='o'),
382+
# Experiment(res=384, PinT=True, start=864, stop=3456, marker='o'),
383+
Experiment(res=378, PinT=False, start=216, stop=216, marker='o'),
384+
# Experiment(res=384, PinT=False, start=216, stop=864, marker='o'),
385+
# Experiment(res=384, PinT=True, start=864, stop=3456, marker='o'),
383386
]
384387

385388
# config = 'RBC3DscalingG4'

pySDC/projects/GPU/configs/RBC3D_configs.py

Lines changed: 76 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ class RBC3DscalingG4(RBC3Dscaling):
237237
res_ratio = 4
238238
gamma = 4
239239

240+
240241
class RBC3DscalingG4R2(RBC3Dscaling):
241242
res_ratio = 2
242243
gamma = 4
@@ -527,26 +528,35 @@ class RBC3DRa1e6(RBC3Dverification):
527528

528529

529530
class RBC3DG4Ra1e5(RBC3DverificationGamma4):
530-
Tend = 300
531-
dt = 8e-2 # I think limit..?
531+
Tend = 200
532+
dt = 8e-2
532533
ic_config = None
533534
res = 32
534535
converged = 50
535536

536537

538+
class RBC3DG4RKRa1e5(RBC3DverificationRKGamma4):
539+
Tend = 200
540+
dt = 7e-2
541+
ic_config = None
542+
res = 32
543+
# converged = 50
544+
545+
537546
class RBC3DG4Ra1e6(RBC3DverificationGamma4):
538547
Tend = 120
539-
converged = 50
548+
converged = 40
540549
dt = 4e-2 # limit
541-
ic_config = None
550+
ic_config = RBC3DG4Ra1e5
542551
res = 48
543552

553+
544554
class RBC3DG4RKRa1e6(RBC3DverificationRKGamma4):
545555
# at res48 with dt4e-2 crash at t=15
546-
converged = 35
556+
converged = 30
547557
Tend = 120
548558
dt = 3e-2 # limit
549-
ic_config = None
559+
ic_config = RBC3DG4Ra1e5
550560
res = 48
551561

552562

@@ -559,70 +569,79 @@ class RBC3DG44Ra1e7(RBC3DverificationGamma4):
559569
res = 32
560570
converged = 30
561571

572+
562573
class RBC3DG4Ra1e7(RBC3DverificationGamma4):
563574
# at res=96: with dt=1e-2 blows up at t=93
564575
Tend = 100
565-
dt = 6e-3
576+
dt = 9e-3 # limit
566577
ic_config = RBC3DG4Ra1e6
567578
res = 96
568-
converged=15
579+
converged = 15
569580

570581

571582
class RBC3DG4RKRa1e7(RBC3DverificationRKGamma4):
572-
# at res=96: with dt=1e-2 blows up at t=67.5
583+
# at res=96: with dt=8e-3 blows up at t=67.5
573584
Tend = 100
574585
dt = 2e-2 # limit
575586
ic_config = RBC3DG4Ra1e6
576587
res = 32
577588

578589

579590
class RBC3DG4Ra1e8(RBC3DverificationGamma4):
580-
# at res=256x256x64, dt=1e-2 seems stable, 2e-2 blow up fast
581-
res_ratio = 4
582-
Tend = 300
583-
dt = 1e-2 # limit
584-
ic_config = RBC3DG4Ra1e7
585-
res = 52
586-
# converged = 20 # TODO: actually, this converges only much later!
587-
588-
589-
class RBC3DG4IRa1e8(RBC3DverificationGamma4Iterative):
590-
res_ratio = 4
591-
Tend = 300
592-
dt = 1e-2
593-
ic_config = RBC3DG4Ra1e7
594-
res = 52
595-
596-
597-
class RBC3DG4FLEXRa1e8(RBC3DverificationGamma4FLEX):
598-
res_ratio = 4
599-
Tend = 300
600-
dt = 2e-2
601-
ic_config = RBC3DG4Ra1e7
602-
res = 52
603-
604-
605-
class RBC3DG4EERa1e8(RBC3DverificationGamma4EE):
606-
res_ratio = 4
607-
Tend = 300
608-
dt = 2e-2
609-
ic_config = RBC3DG4Ra1e7
610-
res = 52
611-
612-
613-
class RBC3DG4EqRa1e8(RBC3DverificationGamma4Equid):
614-
res_ratio = 4
615-
Tend = 300
616-
dt = 2e-2
617-
ic_config = RBC3DG4Ra1e7
618-
res = 52
619-
620-
621-
class RBC3DG4RKRa1e8(RBC3DverificationRKGamma4):
622-
# at res=256x256x64, dt=8e-3 seems stable, 9e-3 and 1e-2 blow up before t=1
623-
# actually, with dt=8e-3, it blows up at t=53.9
624-
Tend = 300
625-
res_ratio = 4
626-
dt = 1e-2 # limit
591+
Tend = 100
592+
dt = 9e-3
627593
ic_config = RBC3DG4Ra1e7
628-
res = 52
594+
res = 96
595+
# converged=15
596+
597+
598+
# class RBC3DG4Ra1e8(RBC3DverificationGamma4):
599+
# # at res=256x256x64, dt=1e-2 seems stable, 2e-2 blow up fast
600+
# res_ratio = 4
601+
# Tend = 300
602+
# dt = 1e-2 # limit
603+
# ic_config = RBC3DG4Ra1e7
604+
# res = 52
605+
# # converged = 20 # TODO: actually, this converges only much later!
606+
#
607+
#
608+
# class RBC3DG4IRa1e8(RBC3DverificationGamma4Iterative):
609+
# res_ratio = 4
610+
# Tend = 300
611+
# dt = 1e-2
612+
# ic_config = RBC3DG4Ra1e7
613+
# res = 52
614+
#
615+
#
616+
# class RBC3DG4FLEXRa1e8(RBC3DverificationGamma4FLEX):
617+
# res_ratio = 4
618+
# Tend = 300
619+
# dt = 2e-2
620+
# ic_config = RBC3DG4Ra1e7
621+
# res = 52
622+
#
623+
#
624+
# class RBC3DG4EERa1e8(RBC3DverificationGamma4EE):
625+
# res_ratio = 4
626+
# Tend = 300
627+
# dt = 2e-2
628+
# ic_config = RBC3DG4Ra1e7
629+
# res = 52
630+
#
631+
#
632+
# class RBC3DG4EqRa1e8(RBC3DverificationGamma4Equid):
633+
# res_ratio = 4
634+
# Tend = 300
635+
# dt = 2e-2
636+
# ic_config = RBC3DG4Ra1e7
637+
# res = 52
638+
#
639+
#
640+
# class RBC3DG4RKRa1e8(RBC3DverificationRKGamma4):
641+
# # at res=256x256x64, dt=8e-3 seems stable, 9e-3 and 1e-2 blow up before t=1
642+
# # actually, with dt=8e-3, it blows up at t=53.9
643+
# Tend = 300
644+
# res_ratio = 4
645+
# dt = 1e-2 # limit
646+
# ic_config = RBC3DG4Ra1e7
647+
# res = 52

0 commit comments

Comments
 (0)