Name

CheckpointHandler — Class for representing the parameters used for saving the configuration and calculator at regular intervals during self-consistent iterations.

Synopsis

Namespace: NanoLanguage
CheckpointHandler(
file_name,
time_interval
)

Description

CheckpointHandler Arguments

file_name

The name of the checkpoint file.

Type: String. Can either be given as absolute path or a relative path (interpreted as relative to the temporary folder on the computer). The absolute path of the checkpoint file is written in the output of the calculator.

Default: File of the form: 'TEMP/checkpointXXXXXXXXXXXXXXXX.nc', where TEMP means the temporary folder on the computer and X means a random digit.
time_interval

The approximate time between saving. The program will check if the time since last save is exceeds the time interval after each self-consistent iteration.

Type: PhysicalQuantity with a time unit - e.g 1*Hour.

Default: 0.5*Hour

CheckpointHandler Methods

A CheckpointHandler object provides the following methods:

  • fileName(): Returns the name of the checkpoint file.

  • timeInterval(): Returns the length of the time interval.

Usage Examples

Set the checkpoint file to "/home/checkpoint.nc" and tell the calculator to store itself every 20 minutes.

   checkpoint_handler = CheckpointHandler('/home/checkpoint.nc', 20*Minute)

   calculator = LCAOCalculator(checkpoint_handler=checkpoint_handler)