Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/boussinesq_2d_imex/HookClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):

# add figure object for further use
# self.fig = plt.figure(figsize=(18,6))
self.fig = plt.figure(figsize=(15,5))
#self.fig = plt.figure(figsize=(15,5))
self.counter = 0

def dump_step(self,status):
Expand Down
2 changes: 1 addition & 1 deletion examples/boussinesq_2d_imex/ProblemClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def solve_system(self,rhs,factor,u0,t):
sol, info = LA.gmres( self.Id - factor*self.M, b, x0=u0.values.flatten(), tol=self.gmres_tol, restart=self.gmres_restart, maxiter=self.gmres_maxiter, callback=cb)
# If this is a dummy call with factor==0.0, do not log because it should not be counted as a solver call
if factor!=0.0:
print("Number of GMRES iterations: %3i --- Final residual: %6.3e" % ( cb.getcounter(), cb.getresidual() ))
#print("Number of GMRES iterations: %3i --- Final residual: %6.3e" % ( cb.getcounter(), cb.getresidual() ))
self.logger.add(cb.getcounter())
me = mesh(self.nvars)
me.values = unflatten(sol, 4, self.N[0], self.N[1])
Expand Down
14 changes: 7 additions & 7 deletions examples/boussinesq_2d_imex/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
# set global logger (remove this if you do not want the output at all)
logger = Log.setup_custom_logger('root')

num_procs = 8
num_procs = 16

# This comes as read-in for the level class
lparams = {}
lparams['restol'] = 1E-8
lparams['restol'] = 5E-6

swparams = {}
swparams['collocation_class'] = collclass.CollGaussLobatto
swparams['num_nodes'] = 3
swparams['do_LU'] = True

sparams = {}
sparams['maxiter'] = 12
sparams['maxiter'] = 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this fixed at 16? The thing is that for FT we need to keep this free, otherwise we cannot estimate the overhead..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you can set this to whatever value you want. The only problem is that with too few iterations, PFASST can become unstable over the course of the simulation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so PFASST will reasonably converge with the residual criterion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, yes. You might have to tweak the tolerance a bit, PFASST takes quite long to reach very fine residuals. I tried to go for something between 1e-5 and 1e-6. The residual after the first iteration is already 1e-4, so larger values do not make much sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a reasonable tolerance to get approx. 10-20 iterations per block, then? Does this change during the simulation or is it more or less constant?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try 1e-6 or 1e-7... for 16 processors, this might already give you quite a lot of iterations. It seems not to change too much over the simulation, but I did not take a systematic look at it.


# setup parameters "in time"
t0 = 0
Tend = 3000
Nsteps = 500
Tend = 384
Nsteps = 128
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GS example takes 640 steps.. can you extend this a little bit? We have randomized fault injections, so we need many steps to get good statistics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just increase Tend and Nsteps by constant factors, so e.g. Tend = 768 and Nsteps = 1000 or so. Only increasing Nsteps would also work, a finer resolution might help PFASST converge better.

#Tend = 30
#Nsteps = 5
dt = Tend/float(Nsteps)
Expand All @@ -57,8 +57,8 @@
pparams['order'] = [4, 2] # [fine_level, coarse_level]
pparams['order_upw'] = [5, 1]
pparams['gmres_maxiter'] = [50, 50]
pparams['gmres_restart'] = [20, 20]
pparams['gmres_tol'] = [1e-8, 1e-8]
pparams['gmres_restart'] = [10, 10]
pparams['gmres_tol'] = [1e-10, 1e-10]

# This comes as read-in for the transfer operations
tparams = {}
Expand Down