Skip to content
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

OpenMM 7.5 #347

Closed
halx opened this issue May 12, 2021 · 11 comments
Closed

OpenMM 7.5 #347

halx opened this issue May 12, 2021 · 11 comments

Comments

@halx
Copy link
Collaborator

halx commented May 12, 2021

@lohedges we need to updated to OpenMM 7.5 because of the new integrators that are now available in that version. We (Julien and Cresset) want to use this for SOMD free energy calculations and I don't see a way to upgrade the conda environment of Sire.

@lohedges
Copy link
Member

Hi there, we are currently in the process of migrating to the conda-forge ecosystem (see here) where we build against the conda-forge version of OpenMM, i.e. 7.5. This should hopefully be approved soon.

However, you should still be able to rebuild Sire against the new version.

... I don't see a way to upgrade the conda environment of Sire.

What issue are you having? For example, after building Sire you should be able to do:

conda install -c conda-forge openmm=7.5

Then re-run your build against the updated version of OpenMM. (You could also update your local version of build_sire.py to use the new version of OpenMM too.)

If you're having issues, you could simply use our conda-recipe, which would build a compatible version for you.

Note that you'll likely need to update OpenMMMD.py as well, since it looks like the integrator_type options sets things that wouldn't be appropriate for some of the new integrators.

@bieniekmateusz
Copy link

We've just compiled sire with openmm=7.5 on ppc64le machine, and we are running into this error:

Traceback (most recent call last):
  File "../envs/sire3/share/Sire/scripts/somd-freenrg.py", line 146, in <module>
    OpenMMMD.runFreeNrg(params)
  File "../envs/sire3/lib/python3.9/site-packages/Sire/Tools/__init__.py", line 176, in inner
    retval = func()
  File "../envs/sire3/lib/python3.9/site-packages/Sire/Tools/OpenMMMD.py", line 1623, in runFreeNrg
    moves = setupMovesFreeEnergy(system, ranseed, gpu.val, lambda_val.val)
  File "../envs/sire3/lib/python3.9/site-packages/Sire/Tools/OpenMMMD.py", line 1193, in setupMovesFreeEnergy
    Integrator_OpenMM = OpenMMFrEnergyST(molecules, solute, solute_hard, solute_todummy, solute_fromdummy, False)
Boost.Python.ArgumentError: Python argument types in
    OpenMMFrEnergyST.__init__(OpenMMFrEnergyST, MoleculeGroup, MoleculeGroup, MoleculeGroup, MoleculeGroup, MoleculeGroup)
did not match C++ signature:
    __init__(_object*)
end of job

Thanks for your help!

@lohedges
Copy link
Member

lohedges commented Jun 2, 2021

Thanks, I'll look into this when I can. It's possible that the OpenMM API has changed in version 7.5, in which case the Sire OpenMM wrappers would need to be updated. If this is the case, it might cause issue with backwards compatibility for SOMD, i.e. if we need to handle different versions of OpenMM.

Could you confirm that things work correctly using OpenMM 7.4.2 from the Omnia channel? Also, could you confirm that you rebuilt Sire following the update to 7.5? (This will link Sire against the updated libOpenMM.so.)

Cheers.

@bieniekmateusz
Copy link

I have just realised that I used the devel branch. The last commit date is Thu May 20 20:50:50 2021 +0100. I assume I should switch to master.

We've tried to compile Sire against OpenMM 7.4.2 from Omnia channel, but there was plenty of linking issues despite the libraries/headers appearing to be from the same place. Let me know if it's useful to confirm this, I might give it another go.

@lohedges
Copy link
Member

lohedges commented Jun 2, 2021

Are you referring to the devel branch of OpenMM or Sire? The latest devel commit of Sire was on the 27th of May, and contains the fix to disable bundling of libcpuid. (At present you should use the devel branch for Sire.)

It would be good to confirm whether this is an issue with OpenMM 7.4.2 vs 7.5 if possible. I can try locally on Linux. Could you let me know how you were running SOMD when the error was raised. Any input files would be useful too.

@bieniekmateusz
Copy link

Yes, the devel branch of Sire. At the time we used a workaround to fix libcpuid, thanks. I'll see what I can do about OpenMM 7.4.2.

The full error is this:

Traceback (most recent call last):
  File "conda3/envs/sire3/share/Sire/scripts/somd-freenrg.py", line 146, in <module>
    OpenMMMD.runFreeNrg(params)
  File "conda3/envs/sire3/lib/python3.9/site-packages/Sire/Tools/__init__.py", line 176, in inner
    retval = func()
  File "conda3/envs/sire3/lib/python3.9/site-packages/Sire/Tools/OpenMMMD.py", line 1623, in runFreeNrg
    moves = setupMovesFreeEnergy(system, ranseed, gpu.val, lambda_val.val)
  File "conda3/envs/sire3/lib/python3.9/site-packages/Sire/Tools/OpenMMMD.py", line 1193, in setupMovesFreeEnergy
    Integrator_OpenMM = OpenMMFrEnergyST(molecules, solute, solute_hard, solute_todummy, solute_fromdummy, False)
Boost.Python.ArgumentError: Python argument types in
    OpenMMFrEnergyST.__init__(OpenMMFrEnergyST, MoleculeGroup, MoleculeGroup, MoleculeGroup, MoleculeGroup, MoleculeGroup, bool)
did not match C++ signature:
    __init__(_object*)

Here is the full input file. It seems it all boils down to somd-freenrg command. I have not run myself Sire yet but I hope this is useful.
sirefep_cppapierror.tar.gz

@lohedges
Copy link
Member

lohedges commented Jun 2, 2021

I've just tested locally on Linux and it works with both OpenMM 7.4.2 (using Sire devel built from source) and 7.5.1 (using our Sire conda-forge recipe.)

@bieniekmateusz
Copy link

I should have tested that separately. I'll go through the recipe and see if I can find. Thank you!

@lohedges
Copy link
Member

lohedges commented Jun 3, 2021

@halx: If you want to build and use the conda-forge version of Sire on Linux (which uses OpenMM 7.5) you can do the following:

Set up a build environment:

conda create -n sire-build python=3.7
conda activate sire-build

Clone our staged-recipes repository:

git clone https://github.com/michellab/staged-recipes.git
cd staged-recipes/recipes/sire

Install conda-build:

conda install -c conda-forge conda-build

Add the following to the build section of the meta.yaml file to fix this issue, i.e.:

diff --git a/recipes/sire/meta.yaml b/recipes/sire/meta.yaml
index 1a04e40ebd..69591986a0 100644
--- a/recipes/sire/meta.yaml
+++ b/recipes/sire/meta.yaml
@@ -21,6 +21,7 @@ requirements:
     - cmake
     - git
     - make
+    - sysroot_linux-64 2.17
   host:
     - boost
     - gsl

Run conda-build:

conda-build -c conda-forge .

The conda package will now be located somewhere like /home/lester/.conda/envs/sire-build/conda-bld/linux-64 . You can install the package into an existing conda-environment using:

conda install sire -c file:////home/lester/.conda/envs/sire-build/conda-bld 

@bieniekmateusz
Copy link

Our issue turned out not to be related to the 7.5 Openmm version as now added to #320. Thanks

@lohedges
Copy link
Member

lohedges commented Feb 1, 2022

Closing since we now build on top of the conda-forge OpenMM.

@lohedges lohedges closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants