Skip to content

Commit 7a7f2c9

Browse files
author
Thomas Baumann
committed
Fixed resilience notebook
1 parent 9fd0308 commit 7a7f2c9

File tree

4 files changed

+39
-31
lines changed

4 files changed

+39
-31
lines changed

pySDC/implementations/hooks/log_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def post_step(self, step, level_number):
1919

2020
self.add_to_stats(
2121
process=step.status.slot,
22-
time=L.time,
22+
time=L.time + L.dt,
2323
level=L.level_index,
2424
iter=step.status.iter,
2525
sweep=L.status.sweep,
@@ -46,7 +46,7 @@ def post_step(self, step, level_number):
4646

4747
self.add_to_stats(
4848
process=step.status.slot,
49-
time=L.time,
49+
time=L.time + L.dt,
5050
level=L.level_index,
5151
iter=step.status.iter,
5252
sweep=L.status.sweep,

pySDC/projects/Resilience/ResilienceStatistics.ipynb

Lines changed: 16 additions & 16 deletions
Large diffs are not rendered by default.

pySDC/projects/Resilience/fault_stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ def scrutinize_visual(self, strategy, run, faults, ax=None, k_ax=None, ls='-', p
603603
run=run,
604604
faults=faults,
605605
force_params=force_params,
606-
hook_class=hook_collection + [LogLocalError],
606+
hook_class=hook_collection + [LogLocalError, LogData],
607607
)
608608

609609
# plot the local error
610-
e_loc = get_sorted(stats, type='e_loc', recomputed=False)
610+
e_loc = get_sorted(stats, type='e_local', recomputed=False)
611611
ax.plot([me[0] for me in e_loc], [me[1] for me in e_loc], color=strategy.color, ls=ls)
612612

613613
# plot the iterations
@@ -1505,6 +1505,7 @@ def main():
15051505
stats_analyser.run_stats_generation(runs=5000, step=50)
15061506
mask = None
15071507

1508+
stats_analyser.compare_strategies()
15081509
stats_analyser.plot_things_per_things(
15091510
'recovered', 'node', False, op=stats_analyser.rec_rate, mask=mask, args={'ylabel': 'recovery rate'}
15101511
)
@@ -1536,7 +1537,6 @@ def main():
15361537
)
15371538

15381539
stats_analyser.plot_recovery_thresholds()
1539-
stats_analyser.compare_strategies()
15401540

15411541

15421542
if __name__ == "__main__":

pySDC/projects/Resilience/hook.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,24 @@ def post_step(self, step, level_number):
4040
value=int(step.status.get('restart')),
4141
)
4242
# add the following with two names because I use both in different projects -.-
43-
for k in ['sweeps', 'k']:
44-
self.increment_stats(
45-
process=step.status.slot,
46-
time=L.time,
47-
level=L.level_index,
48-
iter=step.status.iter,
49-
sweep=L.status.sweep,
50-
type=k,
51-
value=step.status.iter,
52-
)
43+
self.increment_stats(
44+
process=step.status.slot,
45+
time=L.time,
46+
level=L.level_index,
47+
iter=step.status.iter,
48+
sweep=L.status.sweep,
49+
type='sweeps',
50+
value=step.status.iter,
51+
)
52+
self.increment_stats(
53+
process=step.status.slot,
54+
time=L.time + L.dt,
55+
level=L.level_index,
56+
iter=step.status.iter,
57+
sweep=L.status.sweep,
58+
type='k',
59+
value=step.status.iter,
60+
)
5361

5462

5563
class LogUold(hooks):

0 commit comments

Comments
 (0)