shamrock.utils.SimulationRunner.SimulationRunner#
- class shamrock.utils.SimulationRunner.SimulationRunner(model)#
Bases:
objectSimulationRunner is a base class to declare a simulation with setup & callbacks.
A derived class must define: - t_end: float = <end time of the simulation> - a setup (any function decorated with @simulation_setup)
And can define callbacks (any function decorated with @callback):
< call every tsim = i * time_step > - @callback(time_step=1.0)
- def analysis(self, icallback):
rank_0_print(“analysis”)
< call when tsim = dt_stop, niter_max is reached or walltime_step is reached > - @callback(time_step=dt_stop, niter_max=1000, walltime_step=30*60)
- def do_checkpoint(self, icheckpoint):
self.dump_helper.dump(icheckpoint)
Note that for the last one that this reset the counters until next callback. The trigger conditions are inclusive and reset the counters for all triggers of that callback.
Methods
do_checkpointevolve_untilgoto_run_next_callbackrestore_from_checkpointrunrun_setuptrigger_and_advance_callbacksAttributes
cur_iter_countcur_tdump_prefixt_end