Skip to content

Commit d5e5260

Browse files
committed
increased threshold for testing t < Tend by a factor of 10 (now compares against 10*eps). fixes #47
1 parent 8084f18 commit d5e5260

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pySDC/PFASST_blockwise.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def run_pfasst(MS,u0,t0,dt,Tend):
4848
MS[p].status.step = p
4949

5050
# determine which steps are still active (time < Tend)
51-
active = [MS[p].status.time < Tend - np.finfo(float).eps for p in slots]
51+
active = [MS[p].status.time < Tend - 10*np.finfo(float).eps for p in slots]
52+
5253
# compress slots according to active steps, i.e. remove all steps which have times above Tend
5354
active_slots = list(itertools.compress(slots, active))
5455

@@ -78,7 +79,7 @@ def run_pfasst(MS,u0,t0,dt,Tend):
7879
uend = MS[active_slots[-1]].levels[0].uend
7980

8081
# determine new set of active steps and compress slots accordingly
81-
active = [MS[p].status.time+num_procs*MS[p].status.dt < Tend - np.finfo(float).eps for p in slots]
82+
active = [MS[p].status.time+num_procs*MS[p].status.dt < Tend - 10*np.finfo(float).eps for p in slots]
8283
active_slots = list(itertools.compress(slots, active))
8384

8485
# increment timings for now active steps

pySDC/PFASST_stepwise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def run_pfasst(MS,u0,t0,dt,Tend):
4141
MS[p].status.step = p
4242

4343
# determine which steps are still active (time < Tend)
44-
active = [MS[p].status.time < Tend - np.finfo(float).eps for p in slots]
44+
active = [MS[p].status.time < Tend - 10*np.finfo(float).eps for p in slots]
4545
# compress slots according to active steps, i.e. remove all steps which have times above Tend
4646
active_slots = list(itertools.compress(slots, active))
4747

@@ -66,7 +66,7 @@ def run_pfasst(MS,u0,t0,dt,Tend):
6666
uend = MS[active_slots[-1]].levels[0].uend # FIXME: only true for non-ring-parallelization?
6767

6868
# determine new set of active steps and compress slots accordingly
69-
active = [MS[p].status.time+num_procs*MS[p].status.dt < Tend - np.finfo(float).eps for p in slots]
69+
active = [MS[p].status.time+num_procs*MS[p].status.dt < Tend - 10*np.finfo(float).eps for p in slots]
7070
active_slots = list(itertools.compress(slots, active))
7171

7272
# increment timings for now active steps

0 commit comments

Comments
 (0)