meld.vault

Classes

DataStore(n_atoms, n_replicas, pdb_writer[, …])

Class to handle storing data from MELD runs.

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

close()[source]

Close the DataStore

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.

iterate_positions(start=None, end=None)[source]

Iterate over the positions 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_alphas()[source]

Load all alphas from disk.

Warning, this could use a lot of memory.

load_all_energies()[source]

Load all energies from disk.

Warning, this could use 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_box_vectors(stage)[source]

Load box_vectors from disk.

Parameters

stage – int stage to load

load_communicator()[source]

Load the communicator from disk

classmethod load_data_store(load_backup=False)[source]

Load the DataStore object from disk.

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(stage)[source]

Load positions from disk.

Parameters

stage – int stage to load

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_remd_runner()[source]

Load replica runner from disk

load_states(stage)[source]

Load states from disk

Parameters

stage – integer stage to load

Returns

list of SystemState objects

load_velocities(stage)[source]

Load velocities from disk.

Parameters

stage – int stage to load

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_box_vectors(box_vectors, stage)[source]

Save the box_vectors to disk.

Parameters
  • positions – n_replicas x n_atoms x 3 array

  • stage – int stage to store

save_communicator(comm)[source]

Save the communicator to disk

save_data_store()[source]

Save this object to disk.

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

save_remd_runner(runner)[source]

Save replica runner to disk

save_states(states, stage)[source]

Save states to disk.

Parameters
  • states – list of SystemStage objects to store

  • stage – int stage to store

save_velocities(velocities, stage)[source]

Save velocities to disk.

Parameters
  • velocities – n_replicas x n_atoms x 3 array

  • stage – int stage to store