wepy.reporter.walker_pkl module

class wepy.reporter.walker_pkl.WalkerPklReporter(save_dir='./', freq=100, num_backups=2)[source]

Bases: Reporter

Construct a reporter.

Void constructor for the Reporter base class.

Parameters:

**kwargs (key-value pairs) – Ignored kwargs, but accepts them from subclass calls for compatibility.

init(*args, **kwargs)[source]

Initialization routines for the reporter at simulation runtime.

Initialize I/O connections including file descriptors, database connections, timers, stdout/stderr etc.

Void method for reporter base class.

Reporters can expect to have the following key word arguments passed to them during a simulation by the sim_manager in this call.

Parameters:
  • init_walkers (list of Walker objects) – The initial walkers for the simulation.

  • runner (Runner object) – The runner that will be used in the simulation.

  • resampler (Resampler object) – The resampler that will be used in the simulation.

  • boundary_conditions (BoundaryConditions object) – The boundary conditions taht will be used in the simulation.

  • work_mapper (WorkMapper object) – The work mapper that will be used in the simulation.

  • reporters (list of Reporter objects) – The list of reporters that are in the simulation.

  • continue_run (int) – The index of the run that is being continued within this same file.

report(cycle_idx=None, new_walkers=None, **kwargs)[source]

Given data concerning the main simulation components state, perform I/O operations to persist that data.

Void method for reporter base class.

Reporters can expect to have the following key word arguments passed to them during a simulation by the sim_manager.

Parameters:
  • cycle_idx (int)

  • new_walkers (list of Walker objects) – List of walkers that were produced from running their dynamics by the runner.

  • warp_data (list of dict of str : value) – List of dict-like records for each warping event from the last cycle.

  • bc_data (list of dict of str : value) – List of dict-like records specifying the changes to the state of the boundary conditions in the last cycle.

  • progress_data (dict str : list) – A record indicating the progress values for each walker in the last cycle.

  • resampling_data (list of dict of str : value) – List of records specifying the resampling to occur at this cycle.

  • resampler_data (list of dict of str : value) – List of records specifying the changes to the state of the resampler in the last cycle.

  • n_segment_steps (int) – The number of dynamics steps that were completed in the last cycle

  • worker_segment_times (dict of int : list of float) – Mapping worker index to the times they took for each segment they processed.

  • cycle_runner_time (float) – Total time runner took in last cycle.

  • cycle_bc_time (float) – Total time boundary conditions took in last cycle.

  • cycle_resampling_time (float) – Total time resampler took in last cycle.

  • resampled_walkers (list of Walker objects) – List of walkers that were produced from the new_walkers from applying resampling and boundary conditions.

cleanup(**kwargs)

Teardown routines for the reporter at the end of the simulation.

Use to cleanly and safely close I/O connections or other cleanup I/O.

Use to close file descriptors, database connections etc.

Reporters can expect to have the following key word arguments passed to them during a simulation by the sim_manager.

Parameters:
  • runner (Runner object) – The runner at the end of the simulation

  • work_mapper (WorkeMapper object) – The work mapper at the end of the simulation

  • resampler (Resampler object) – The resampler at the end of the simulation

  • boundary_conditions (BoundaryConditions object) – The boundary conditions at the end of the simulation

  • reporters (list of Reporter objects) – The list of reporters at the end of the simulation