Checkpointing

Configuring checkpointing

Checkpointing is configured using command line options and/or specifying certain parameters in the configuration file. These options are specified in the chapters above. For more detailed information on how to configure checkpointing, read the Simulator chapter (Run the simulator part).

Checkpointing enables the ability to save the state of the simulator multiple times during the simulation itself. The simulator state is saved in a binary format, based on a HDF5 storage format. The format of this file is described below. Checkpointing is configured by 3 parameters: the checkpointing frequency, the checkpointing file and the simulator run mode.

Checkpointing frequency

The amount of times the simulator will be saved, can be set by the checkpointing frequency parameter. This parameter can be set by using a commandline argument or specifying the parameter in the xml configuration file. This are the possible values for the parameter:

  • 0 - Only save the last timestep of the simulation
  • x - Save the simulator state every x timesteps

Checkpointing file

This paramater specifies the name of the checkpointing file. The use for the file depends on the simulator run mode parameter.

Replay timestep

This parameter is used when the run mode is Replay. It specifies the timestep from which you want to start the simulator.

Simulator run mode

The simulator can be run in different modes. Currently, these run modes are supported:

  • Initial - The simulator is built from scratch using the configuration file, and saved every x timesteps according to the checkpointing frequency. If no configuration file is present, the initial saved state in the checkpointing file is used to start the simulation.
  • Extend - The simulation is extended from the last saved checkpoint in the checkpointing file.
  • Replay - The simulation is replayed from a specified timestep.
  • Extract - The configuration files are extracted from the checkpointing file. This mode will not actually run the simulator itself.

Table structure

/configuration rank 1
  dims 1
  dtype ConfDatatype
/track_index_case rank 1
  dims 1
  dtype H5T_NATIVE_INT
/amt_timesteps rank 1
  dims 1
  dtype H5T_NATIVE_UINT
/last_timestep rank 1
  dims 1
  dtype H5T_NATIVE_UINT
/personsTI rank 1
  dims amt_persons
  dtype PersonTIDatatype
/Timestep_n/randomgen rank 1
  dims 1
  dtype StrType
/Timestep_n/PersonTD rank 1
  dims amt_persons
  dtype PersonTDDatatype
/Timestep_n/Calendar rank 1
  dims 1
  dtype CalendarDatatype

Custom datatypes

ConfDatatype

  • StrType (variable length) - conf_content
  • StrType (variable length) - disease_content
  • StrType (variable length) - holidays_content
  • StrType (variable length) - age_contact_content

PersonTIDatatype (time independent)

  • H5T_NATIVE_UINT - ID
  • H5T_NATIVE_DOUBLE - age
  • H5T_NATIVE_CHAR - gender
  • H5T_NATIVE_UINT - household_ID
  • H5T_NATIVE_UINT - school_ID
  • H5T_NATIVE_UINT - work_ID
  • H5T_NATIVE_UINT - prim_comm_ID
  • H5T_NATIVE_UINT - sec_comm_ID
  • H5T_NATIVE_UINT - start_infectiousness
  • H5T_NATIVE_UINT - time_infectiousness
  • H5T_NATIVE_UINT - start_symptomatic
  • H5T_NATIVE_UINT - time_symptomatic

PersonTDDatatype (time dependent)

  • H5T_NATIVE_HBOOL - participant
  • H5T_NATIVE_UINT - health_status
  • H5T_NATIVE_UINT - disease_counter

CalendarDatatype

  • H5T_NATIVE_HSIZE - day
  • StrType (variable length) - date