meld.vault¶
- class meld.vault.DataStore(n_atoms, n_replicas, pdb_writer, block_size=100)[source]¶
Class to handle storing data from MELD runs.
Parameters: - n_atoms – number of atoms
- n_replicas – number of replicas
- block_size – size of netcdf blocks and frequency to do backups
Data will be stored in the ‘Data’ subdirectory. Backups will be stored in ‘Data/Backup’.
Some information is stored as python pickled files:
- data_store.dat – the DataStore object
- communicator.dat – the MPICommunicator object
- remd_runner.dat – the MasterReplicaExchangeRunner object
Other data (positions, velocities, etc) is stored in the results.nc file.
- backup(stage)[source]¶
Backup all files to Data/Backup.
Parameters: stage – int stage Backup will occur if stage % backup_freq == 0
- initialize(mode)[source]¶
Prepare to use the DataStore object.
Parameters: mode – mode to open in. Available modes are:
- ‘w’ – create a new directory structure and initialize the hd5 file
- ‘a’ – append to the existing files
- ‘r’ – open the file in read-only mode
- iterate_permutation_vectors(start=None, end=None)[source]¶
Iterate over the permutation vectors from disk.
- load_acceptance_probabilities(stage)[source]¶
Load acceptance probability vector from disk.
Parameters: stage – int stage to load Returns: n_replica_pairs array of int
- load_all_acceptance_probabilities()[source]¶
Load all acceptance probabilities from disk
Warning, this might take a lot of memory
- load_all_permutation_vectors()[source]¶
Load all permutation vector from disk.
Warning, this might take a lot of memory
- load_all_positions()[source]¶
Load all positions from disk.
Warning, this could use a lot of memory.
- load_all_velocities()[source]¶
Load all velocities from disk.
Warning, this could use a lot of memory.
- load_alphas(stage)[source]¶
Load alphas from disk.
Parameters: stage – int stage to load from disk Returns: n_replicas array
- load_energies(stage)[source]¶
Load energies from disk.
Parameters: stage – int stage to load Returns: n_replicas array
- load_permutation_vector(stage)[source]¶
Load permutation vector from disk.
Parameters: stage – int stage to load Returns: n_replicas array of int
- load_positions_random_access(stage)[source]¶
Load positions from disk.
Parameters: stage – int stage to load This differs from load_positions() in that you can positions from any stage, while load_positions() can only move forward in time. However, this comes at a performance penalty.
- load_states(stage)[source]¶
Load states from disk
Parameters: stage – integer stage to load Returns: list of SystemState objects
- save_acceptance_probabilities(accept_probs, stage)[source]¶
Save acceptance probabilities vector to disk.
Parameters: - accept_probs – n_replicas array of int
- stage – int stage to store
- save_alphas(alphas, stage)[source]¶
Save alphas to disk.
Parameters: - alphas – n_replicas array
- stage – int stage to store
- save_energies(energies, stage)[source]¶
Save energies to disk.
Parameters: - energies – n_replicas array
- stage – int stage to save
- save_permutation_vector(perm_vec, stage)[source]¶
Save permutation vector to disk.
Parameters: - perm_vec – n_replicas array of int
- stage – int stage to store
- save_positions(positions, stage)[source]¶
Save the positions to disk.
Parameters: - positions – n_replicas x n_atoms x 3 array
- stage – int stage to store