# magni.cs.phase_transition._backup module¶

Module providing backup capabilities for the monte carlo simulations.

The backup stores the simulation results and the simulation timings pointwise for the points in the delta-rho simulation grid. The set function targets a specific point while the get function targets the entire grid in order to keep the overhead low.

## Routine listings¶

create(path)
Create the HDF5 backup database with the required arrays.
get(path)
Return which of the results have been stored.
set(path, ij_tuple, stat_time, stat_dist)
Store the simulation data of a specified point.

magni.cs.phase_transition.config
Configuration options.

Notes

In practice, the backup database includes an additional array for tracking for which points data has been stored. By first storing the data and then modifying this array, the data is guaranteed to have been stored, when the array is modified.

magni.cs.phase_transition._backup.create(path)[source]

Create the HDF5 backup database with the required arrays.

The required arrays are an array for the simulation results, an array for the simulation timings, and an array for tracking the status.

Parameters: path (str) – The path of the HDF5 backup database.

magni.cs.phase_transition.config()
Configuration options.
magni.cs.phase_transition._backup.get(path)[source]

Return which of the results have been stored.

The returned value is a copy of the boolean status array indicating which of the results have been stored.

Parameters: path (str) – The path of the HDF5 backup database. status (ndarray) – The boolean status array.
magni.cs.phase_transition._backup.set(path, ij_tuple, stat_time, stat_dist, stat_mse, stat_norm)[source]

Store the simulation data of a specified point.

Parameters: path (str) – The path of the HDF5 backup database. ij_tuple (tuple) – A tuple (i, j) containing the parameters i, j as listed below. i (int) – The delta-index of the point in the delta-rho grid. j (int) – The rho-index of the point in the delta-rho grid. stat_dist (ndarray) – The simulation results of the specified point. stat_time (ndarray) – The simulation timings of the specified point. stat_mse (ndarray) – The simulation mean squared error of the specified point. stat_norm (ndarray) – The simulation true vector 2-norm.