Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openmmtools/integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ def __init__(self, timestep=1.0 * unit.femtoseconds, tolerance=None, alpha=0.1,
self.addGlobalVariable("delta_t", timestep.value_in_unit_system(unit.md_unit_system))

# Update context state.
self.addUpdateContextState()
#self.addUpdateContextState()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this as I had seen this (openmm/openmm#1237 (comment)), but in test calculations I don't see crashes if we update the context state so this may not be necessary?


# Assess convergence
# TODO: Can we more closely match the OpenMM criterion here?
Expand Down
9 changes: 9 additions & 0 deletions openmmtools/multistate/multistatesampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,12 @@ def _minimize_replica(self, replica_id, tolerance, max_iterations):
# Retrieve thermodynamic and sampler states.
thermodynamic_state_id = self._replica_thermodynamic_states[replica_id]
thermodynamic_state = self._thermodynamic_states[thermodynamic_state_id]

# Temporarily disable the barostat during minimization.
# Otherwise, the minimizer will modify the box
# vectors and may cause instabilities.
pressure = thermodynamic_state.pressure
thermodynamic_state.pressure = None
sampler_state = self._sampler_states[replica_id]

# Use the FIRE minimizer
Expand Down Expand Up @@ -1397,6 +1403,9 @@ def _minimize_replica(self, replica_id, tolerance, max_iterations):

# Get the minimized positions.
sampler_state.update_from_context(context)

# Restore the barostat
thermodynamic_state.pressure = pressure

# Compute the final energy of the system for logging.
final_energy = thermodynamic_state.reduced_potential(sampler_state)
Expand Down