tlm_adjoint.checkpoint_schedules.h_revolve

Module Contents

class tlm_adjoint.checkpoint_schedules.h_revolve.HRevolveCheckpointSchedule(max_n, snapshots_in_ram, snapshots_on_disk, *, wvect=(0.0, 0.1), rvect=(0.0, 0.1), uf=1.0, ub=2.0, **kwargs)

An H-Revolve checkpointing schedule.

Converts from schedules as generated by the H-Revolve library, for the case of two storage levels: RAM and disk.

Offline, one adjoint calculation permitted.

Parameters:
  • max_n – The number of forward steps in the initial forward calculation.

  • snapshots_in_ram – The maximum number of forward restart checkpoints to store in memory.

  • snapshots_on_disk – The maximum number of forward restart checkpoints to store on disk.

  • wvect – A two element tuple defining the write cost associated with saving a forward restart checkpoint to RAM (first element) and disk (second element).

  • rvect – A two element tuple defining the read cost associated with loading a forward restart checkpoint from RAM (first element) and disk (second element).

  • uf – The cost of advancing the forward one step.

  • bf – The cost of advancing the forward one step, storing non-linear dependency data, and then advancing the adjoint over that step.

Remaining keyword arguments are passed to hrevolve.hrevolve.

The argument names snaps_in_ram and snaps_on_disk originate from the corresponding arguments for the dolfin_adjoint.solving.adj_checkpointing function in dolfin-adjoint (see e.g. version 2017.1.0).

property is_exhausted

Whether the schedule has concluded. Note that some schedules permit multiple adjoint calculation, and may never conclude.

property uses_disk_storage

Whether the schedule may use disk storage. If False then no disk storage is required.

iter()

A generator which should be overridden in derived classes in order to define a checkpointing schedule.