Skip to content
Open
Changes from all 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
32 changes: 21 additions & 11 deletions src/openfe/protocols/openmm_septop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ def _get_ctx_caches(
self,
forcefield_settings: OpenMMSystemGeneratorFFSettings,
engine_settings: OpenMMEngineSettings,
use_dummy: bool = True,
) -> tuple[openmmtools.cache.ContextCache, openmmtools.cache.ContextCache]:
"""
Set the context caches based on the chosen platform
Expand All @@ -993,6 +994,8 @@ def _get_ctx_caches(
----------
forcefield_settings: OpenMMSystemGeneratorFFSettings
engine_settings : OpenMMEngineSettings
use_dummy: bool
Whether to use a dummy context cache

Returns
-------
Expand All @@ -1010,17 +1013,22 @@ def _get_ctx_caches(
restrict_cpu_count=restrict_cpu,
)

energy_context_cache = openmmtools.cache.ContextCache(
capacity=None,
time_to_live=None,
platform=platform,
)
if use_dummy:
energy_context_cache = openmmtools.cache.DummyContextCache(platform=platform)
sampler_context_cache = openmmtools.cache.DummyContextCache(platform=platform)

sampler_context_cache = openmmtools.cache.ContextCache(
capacity=None,
time_to_live=None,
platform=platform,
)
else:
energy_context_cache = openmmtools.cache.ContextCache(
capacity=None,
time_to_live=None,
platform=platform,
)

sampler_context_cache = openmmtools.cache.ContextCache(
capacity=None,
time_to_live=None,
platform=platform,
)

return energy_context_cache, sampler_context_cache

Expand Down Expand Up @@ -1315,7 +1323,9 @@ def run(
try:
# 5. Get context caches
energy_ctx_cache, sampler_ctx_cache = self._get_ctx_caches(
settings["forcefield_settings"], settings["engine_settings"]
settings["forcefield_settings"],
settings["engine_settings"],
use_dummy=True,
)

# 6. Get integrator
Expand Down
Loading