-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up global context cache use #968
Comments
related: #963 |
@zhang-ivy Thanks for reporting this. I agree we need to monitor and clean things up to match the current context cache behavior from I believe the issue is not because the global context cache is created but instead, as the error says, it is because it's trying to change its platform after being used (non-empty), but I'd like to confirm this is indeed what's happening. |
The error about changing the platform arises because either 1) the global context cache is being created somewhere else first (where it should not be created) or 2) the global context cache platform is attempting to be changed (where it should not be changed). We will have to discuss this further to identify which one is the problem, as it depends on what we want the desired behavior to be. |
We should remove the manual global context cache configuration in |
@zhang-ivy I'm getting the following error while trying to load your serialized objects Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
Traceback (most recent call last):
File "/home/user/workdir/debugging/perses-968/test.py", line 10, in <module>
htf = pickle.load(f)
File "/home/user/miniconda3/envs/perses-dev/lib/python3.9/site-packages/openmm/openmm.py", line 1916, in __setstate__
system = XmlSerializer.deserialize(serializationString)
File "/home/user/miniconda3/envs/perses-dev/lib/python3.9/site-packages/openmm/openmm.py", line 6928, in deserialize
return XmlSerializer._deserializeForce(inputString)
File "/home/user/miniconda3/envs/perses-dev/lib/python3.9/site-packages/openmm/openmm.py", line 6850, in _deserializeForce
return _openmm.XmlSerializer__deserializeForce(inputString)
openmm.OpenMMException: Unsupported version number Which I presume is because you are probably using a dev version of openmm or similar. Can you share the openmm version you are using? Just to be able to reproduce and test the solution to this issue. Thanks. |
Yes its the nightly dev version. Here is the commit hash: bbd751bf1a8db98c65d856c1159bf79c8bec2e15 You can also use this test which builds the htf for you: https://github.com/choderalab/perses/blob/rest-over-protocol/perses/tests/test_relative.py#L1025 in the |
@ijpulidos : I just realized that the openmm version I used here is not from one of the nightly dev builds. I built one of Peter's branches from source (before he merged it into master).. in any case, I already sent you the environment yaml, but here it is again: |
related to: choderalab/openmmtools#558 |
I recently was using this code snippet to run one of my energy validation tests:
However, I'm getting this error:
This is because this line tries to set the platform of the global context cache, but was already set when this line was called, because
feptasks.py
hasimport openmmtools.cache as cache
, which creates a global context cache here.If I comment out this line, the problem goes away.
I think we need to go through the all the files in this repo and make sure that global context caches are being used properly.
The text was updated successfully, but these errors were encountered: