Skip to content

Commit

Permalink
Added parameters for GSSDC resilience
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen committed Oct 29, 2024
1 parent d05ec87 commit 8a0da4c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions pySDC/projects/Resilience/fault_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,8 +1672,8 @@ def compare_adaptivity_modes():

def main():
kwargs = {
'prob': run_GS,
'num_procs': 1,
'prob': run_RBC,
'num_procs': 4,
'mode': 'default',
'runs': 2000,
'reload': False,
Expand Down
17 changes: 10 additions & 7 deletions pySDC/projects/Resilience/paper_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,10 @@ def work_precision(): # pragma: no cover

def plot_recovery_rate_per_acceptance_threshold(problem): # pragma no cover
stats_analyser = get_stats(problem)
fig, ax = plt.subplots(figsize=figsize_by_journal(JOURNAL, 0.8, 0.4))

stats_analyser.plot_recovery_thresholds(thresh_range=np.linspace(0.5, 1.5, 1000), recoverable_only=True)
stats_analyser.plot_recovery_thresholds(thresh_range=np.linspace(1.0, 2.0, 1000), recoverable_only=True, ax=ax)
savefig(fig, 'recovery_rate_per_thresh')


def make_plots_for_TIME_X_website(): # pragma: no cover
Expand Down Expand Up @@ -781,13 +783,13 @@ def make_plots_for_adaptivity_paper(): # pragma: no cover


def make_plots_for_resilience_paper(): # pragma: no cover
plot_Lorenz_solution()
plot_fault_Lorenz(0)
plot_fault_Lorenz(20)
plot_RBC_solution()
compare_recovery_rate_problems(target='resilience', num_procs=1, strategy_type='SDC')
# plot_Lorenz_solution()
# plot_fault_Lorenz(0)
# plot_fault_Lorenz(20)
# plot_RBC_solution()
# compare_recovery_rate_problems(target='resilience', num_procs=1, strategy_type='SDC')
# plot_recovery_rate(get_stats(run_Lorenz))
# plot_recovery_rate_per_acceptance_threshold(run_Lorenz)
plot_recovery_rate_per_acceptance_threshold(run_Lorenz)
plt.show()


Expand Down Expand Up @@ -830,6 +832,7 @@ def make_plots_for_thesis(): # pragma: no cover

# plot_adaptivity_stuff()
compare_recovery_rate_problems(target='thesis', num_procs=1, strategy_type='SDC')
plot_recovery_rate_per_acceptance_threshold(run_Lorenz)


if __name__ == "__main__":
Expand Down
19 changes: 11 additions & 8 deletions pySDC/projects/Resilience/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def get_base_parameters(self, problem, num_procs=1):
}
custom_description['level_params'] = {'restol': -1, 'dt': 0.1 * eps**2}
elif problem.__name__ == 'run_RBC':
custom_description['level_params']['dt'] = 5e-2
custom_description['level_params']['dt'] = 2.5e-2 if num_procs == 4 else 5e-2
custom_description['step_params'] = {'maxiter': 5}
elif problem.__name__ == 'run_GS':
custom_description['level_params']['dt'] = 1.0
Expand Down Expand Up @@ -571,7 +571,10 @@ def get_custom_description(self, problem, num_procs):
e_tol = 1e-7
# dt_max = 0.1 * base_params['problem_params']['eps'] ** 2
elif problem.__name__ == 'run_RBC':
e_tol = 1e-4
if num_procs == 4:
e_tol = 2e-2
else:
e_tol = 1e-4
dt_slope_min = 1
beta = 0.5
elif problem.__name__ == 'run_GS':
Expand Down Expand Up @@ -877,14 +880,14 @@ def get_custom_description(self, problem, num_procs, *args, **kwargs):
desc['level_params']['restol'] = 1e-9
return desc

def get_custom_description_for_faults(self, problem, *args, **kwargs):
desc = self.get_custom_description(problem, *args, **kwargs)
def get_custom_description_for_faults(self, problem, num_procs, *args, **kwargs):
desc = self.get_custom_description(problem, num_procs, *args, **kwargs)
if problem.__name__ == 'run_quench':
desc['level_params']['dt'] = 5.0
elif problem.__name__ == 'run_AC':
desc['level_params']['dt'] = 5e-4
elif problem.__name__ == 'run_RBC':
desc['level_params']['restol'] = 1e-6
desc['level_params']['restol'] = 1e-3 if num_procs == 4 else 1e-6
return desc

def get_reference_value(self, problem, key, op, num_procs=1):
Expand Down Expand Up @@ -979,7 +982,7 @@ def get_custom_description(self, problem, num_procs):
HotRod_tol = 9.564437e-06
maxiter = 6
elif problem.__name__ == 'run_RBC':
HotRod_tol = 6.34e-6
HotRod_tol = 3e-4 if num_procs == 4 else 6.34e-6
maxiter = 6
elif problem.__name__ == 'run_GS':
HotRod_tol = 3.22e-5
Expand Down Expand Up @@ -1960,10 +1963,10 @@ def get_custom_description(self, problem, num_procs):
restol_rel = 1e-3
# dt_max = 0.1 * base_params['problem_params']['eps'] ** 2
elif problem.__name__ == "run_RBC":
e_tol = 5e-3
e_tol = 5e-2 if num_procs == 4 else 5e-3
dt_slope_min = 1.0
abort_at_growing_residual = False
restol_rel = 1e-4
restol_rel = 1e-2 if num_procs == 4 else 1e-4
restol_max = 1e-1
restol_min = 5e-8
self.max_slope = 4
Expand Down

0 comments on commit 8a0da4c

Please sign in to comment.