Coder Social home page Coder Social logo

openmm-plumed's Introduction

GH Actions Status Conda Anaconda Cloud Badge

OpenMM PLUMED Plugin

This project provides a connection between OpenMM and PLUMED. It allows you to bias or analyze an OpenMM simulation based on collective variables.

This plugin requires PLUMED version 2.3b or greater. OpenMM 8.1.0 or greater is required to use v2.0 of this plugin. For previous versions of OpenMM you may use v1.0.

Installing The Plugin

We provide conda packages for Linux and MacOS via conda-forge, which can be installed from the conda-forge channel:

conda install -c conda-forge openmm-plumed

If you don't have conda available, we recommend installing Miniconda for Python 3 to provide the conda package manager.

Building The Plugin

This project uses CMake for its build system. To build it, follow these steps:

  1. Create a directory in which to build the plugin.

  2. Run the CMake GUI or ccmake, specifying your new directory as the build directory and the top level directory of this project as the source directory.

  3. Press "Configure".

  4. Set OPENMM_DIR to point to the directory where OpenMM is installed. This is needed to locate the OpenMM header files and libraries.

  5. Set PLUMED_INCLUDE_DIR and PLUMED_LIBRARY_DIR to point to the directories where the PLUMED header files and libraries are installed.

  6. Set CMAKE_INSTALL_PREFIX to the directory where the plugin should be installed. Usually, this will be the same as OPENMM_DIR, so the plugin will be added to your OpenMM installation.

  7. Press "Configure" again if necessary, then press "Generate".

  8. Use the build system you selected to build and install the plugin. For example, if you selected Unix Makefiles, type make install to install the plugin, and make PythonInstall to install the Python wrapper.

Using The Plugin

Simply create a PlumedForce object, passing the PLUMED control script as an argument to the constructor, then add it to your System. For example,

script = """
d: DISTANCE ATOMS=1,10
METAD ARG=d SIGMA=0.2 HEIGHT=0.3 PACE=500"""
system.addForce(PlumedForce(script))

Be aware that PLUMED numbers atoms starting from 1, whereas OpenMM numbers them starting from 0. The example above performs metadynamics based on the distance between atoms 0 and 9 (in OpenMM's numbering system).

License

This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap for Medical Research, grant U54 GM072970. See https://simtk.org.

Portions copyright (c) 2016-2023 Stanford University and the Authors.

Authors: Peter Eastman

Contributors:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

openmm-plumed's People

Contributors

giovannibussi avatar jaimergp avatar mpharrigan avatar peastman avatar raulppelaez avatar tonigi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openmm-plumed's Issues

Getting problems with make PythonInstall

Hey Peter,
I am getting the following error with installing the python wrapper even though it seems to have installed the plugin.

make install
[ 30%] Built target OpenMMPlumed
[ 38%] Built target TestSerializePlumedForce
[ 53%] Built target OpenMMPlumedReference
[ 61%] Built target TestReferencePlumedForce
[ 92%] Built target OpenMMPlumedCUDA
[100%] Built target TestCudaPlumedForce
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/include/PlumedForce.h
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/include/PlumedKernels.h
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/include/internal/PlumedForceImpl.h
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/include/internal/windowsExportPlumed.h
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/lib/libOpenMMPlumed.so
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/lib/plugins/libOpenMMPlumedReference.so
-- Up-to-date: /home/stanford/pande/users/msultan/software/installation/lib/plugins/libOpenMMPlumedCUDA.so


 make PythonInstall 
running build
running build_py
running build_ext
building '_openmmplumed' extension
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/stanford/pande/users/msultan/software/installation/include -I/home/stanford/pande/users/msultan/software/openmm-plumed/openmmapi/include -I/home/stanford/pande/users/msultan/software/anaconda/include/python3.5m -c PlumedPluginWrapper.cpp -o build/temp.linux-x86_64-3.5/PlumedPluginWrapper.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
PlumedPluginWrapper.cpp: In function ‘swig_module_info* SWIG_Python_GetModule()’:
PlumedPluginWrapper.cpp:2452:51: error: ‘PyCObject_Import’ was not declared in this scope
         (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
                                                   ^
PlumedPluginWrapper.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’:
PlumedPluginWrapper.cpp:2521:92: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
                                                                                            ^
PlumedPluginWrapper.cpp:2512:22: warning: unused variable ‘swig_empty_runtime_method_table’ [-Wunused-variable]
   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
                      ^
PlumedPluginWrapper.cpp: In function ‘swig_type_info* SWIG_Python_TypeQuery(const char*)’:
PlumedPluginWrapper.cpp:2544:60: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope
     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
                                                            ^
PlumedPluginWrapper.cpp:2549:51: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
       obj = PyCObject_FromVoidPtr(descriptor, NULL);
                                                   ^
error: command 'gcc' failed with exit status 1
make[3]: *** [PythonInstall] Error 1
make[2]: *** [python/CMakeFiles/PythonInstall.dir/all] Error 2
make[1]: *** [python/CMakeFiles/PythonInstall.dir/rule] Error 2
make: *** [PythonInstall] Error 2

The swig version is 1.3

swig -version

SWIG Version 1.3.40

Compiled with g++ [x86_64-redhat-linux-gnu]
Please see http://www.swig.org for reporting bugs and further information

Any recommendations on what to try?

Continuation line in PLUMED input

I noticed that PLUMED had a limit to the input line length (if the line is too long, PLUMED seems to simply ignore that action). Of course, it is nice to split certain input lines anyhow, but while PLUMED itself has the ellipse syntax to create continuation lines, the OpenMM plugin doesn't seem to have this option. The ellipse is rejected by unknown keyword '...'. Is there a way to have continuation lines within the triple """ quotes? Thanks, Istvan

adding ENERGY colvar

Hi,
is it possible to have the ENERGY collective variable implemented, so that it can be biased with plumed?
I would love to be able to run multithermal simulations with OPES and OpenMM, but for that I need to bias the potential energy.

From what I understand it might not be easy to do, because you need to calculate the total energy without the contribution of the PlumedForce. But I am quite new to OpenMM...

fatal error: openmm/Context.h

Hi Peter,
I am trying to install the plugin on my workstation. I already have the openmm7.0.1 installed using conda, and plumed installed separately.
However, I always have a fatal error that says "fatal error: openmm/Context.h No such file or directory".

In the configuration file from ccmake, I have tried
~/anaconda/pkgs/openmm-7.0.1-py27_0/include
~/anaconda/pkgs/openmm-7.0.1-py27_0/include/openmm.

And I can see the Context.h file there. Any ideas why? Should I install openMM myself instead of using conda? Thanks a lot for helping.

--Hongbin

Issue with reading ALPHABETA input and other multicolvar module objects

I have successfully installed the plugin, although when running my script for metadynamics using any of the multicolvar to develop a collective variable for biasing, I receive this error on reading atoms:-
The example below is for the ALPHABETA object.

PLUMED: Action ALPHABETA
PLUMED: with label @1
PLUMED: ERROR in input to action ALPHABETA with label @1 : No atoms have been read in
PLUMED:

I do not receive this kind of error when running using with other MD engines/packages patched to PLUMED, and using the same input files. Is there a specific problem with my build for the plugin or OpenMM in this respect? My build was made rather recently, if this provides some insight.

Can conda openmm-plumed use a custom plumed installation outside conda?

Hi, I have been using OpenMM-PLUMED for a long time and always built the openmm-plumed plugin from source. The cmake builder has always been a bit difficult to use, but this time I couldn't get it to work at all on a new machine. So, I was very glad to see that the conda version of openmm-plumed exists. I installed it with no issues, but now I realize that it will always use the built-in PLUMED. My question is whether I can set environmental variables to make conda openmm-plumed use my PLUMED instead of the built-in one. I tried setting

export PATH=/home/istvan/opt/plumed-2.8.1_install/bin/:$PATH
export LD_LIBRARY_PATH=PATH=/home/istvan/opt/plumed-2.8.1_install/lib:$LD_LIBRARY_PATH

but that didn't help. Is there a solution to this?

Thank you very much for your kind assistance.

Best regards,

Istvan

How to install openmm-plumed with mpi and CUDA platform

Hi!

I have problem in installing openmm-plumed with both mpi and CUDA platform.

I'd like to run a bias-exchange simulation with 14 replicas in Drude force field. So, I need to use OpenMM plugined with plumed (enable mpi). To run it faster, I'd like to run the simulation on a CUDA platform. However, the package supplied https://github.com/peastman/openmm-plumed is packed without mpi and CUDA. I wonder how can I custom the installation to carry out my work.

Thanks for any possible help in advance!

Ongoing ABI problem

Hi, I know there have been multiple tickets addressing this problem, I myself contributed to them too, but the problem still seems to persist with the latest conda OpenMM build. I installed OpenMM with conda under anaconda3, 'conda install -c omnia/label/cuda100 openmm' and installed openmm-plumed with cmake. The only way openmm-plumed compiled was with this setting:

$ grep ABI CMakeCache.txt
CMAKE_CXX_FLAGS:STRING=-D_GLIBCXX_USE_CXX11_ABI=0

With ABI=1 or 'CMAKE_CXX_FLAGS:STRING=' I get the following error:

$ make install
-- Configuring done
-- Generating done
-- Build files have been written to: /raid/istvan/opt/openmm-plumed-build
[  3%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o
[  7%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForceImpl.cpp.o
[ 11%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedForceProxy.cpp.o
[ 15%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedSerializationProxyRegistration.cpp.o
[ 19%] Linking CXX shared library libOpenMMPlumed.so
[ 19%] Built target OpenMMPlumed
[ 23%] Building CXX object serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o
[ 26%] Linking CXX executable TestSerializePlumedForce
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `testSerialization()':
TestSerializePlumedForce.cpp:(.text+0x27f): undefined reference to `OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `void OpenMM::XmlSerializer::serialize<PlumedPlugin::PlumedForce>(PlumedPlugin::PlumedForce const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream&)':
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x72): undefined reference to `OpenMM::SerializationNode::setName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0xe3): undefined reference to `OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x123): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x185): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x1cd): undefined reference to `OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenMM::ContextImpl&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/build.make:96: serialization/tests/TestSerializePlumedForce] Error 1
make[1]: *** [CMakeFiles/Makefile2:123: serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

With ABI=0, openmm-plumed successfully compiles but then when I run a test job with PlumedForce I get the following error:

Traceback (most recent call last):
  File "run-meta-eABF-1D-adaptive-path.py", line 8, in <module>
    from openmmplumed import PlumedForce
  File "/raid/istvan/anaconda3/lib/python3.7/site-packages/openmmplumed.py", line 15, in <module>
    import _openmmplumed
ImportError: /raid/istvan/anaconda3/lib/python3.7/site-packages/_openmmplumed.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK12PlumedPlugin11PlumedForce9getScriptB5cxx11Ev

which indicates a Cxx11 issue. So, it seems that OpenMM 7.4.1 was compiled with a different ABI setting. Can you tell me what setting it was? I should compile openmm-plumed with the same setting, but so far I could only compile it with ABI=0 and that doesn't work.

Hopefully, the following ldd output might give a clue. First, I compared libOpenMMPlumed.so in the openmm-plumed-build directory and in the /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib directory. The latter was created by the 'make PythonInstall' command and I would think it should be identical with the one in the local build directory.

$ ll /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib/libOpenMMPlumed.so
-rw-r--r-- 1 istvan istvan 66944 Jan 22 22:40 /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib/libOpenMMPlumed.so
$ ll /raid/istvan/opt/openmm-plumed-build/libOpenMMPlumed.so 
-rwxr-xr-x 1 istvan istvan 66944 Jan 22 22:40 /raid/istvan/opt/openmm-plumed-build/libOpenMMPlumed.so

They are the same size, but their ldd output is diiferent:

$ ldd /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib/libOpenMMPlumed.so
	linux-vdso.so.1 (0x00007ffef03fc000)
	libOpenMM.so => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9eb561f000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9eb5407000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9eb5016000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9eb4c78000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f9eb5bb4000)
$ ldd /raid/istvan/opt/openmm-plumed-build/libOpenMMPlumed.so 
	linux-vdso.so.1 (0x00007fff7c396000)
	libOpenMM.so => /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib/libOpenMM.so (0x00007f7f30158000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7f2fdcf000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7f2fbb7000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f2f7c6000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7f2f5be000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f2f3ba000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7f2f19b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7f2edfd000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7f308c0000)

So, it seems that libOpenMMPlumed.so generated by 'make PythonInstall' actually doesn't know about OpenMM!? The ldd on libOpenMM.so prints:

$ ldd /raid/istvan/anaconda3/pkgs/openmm-7.4.1-py37_cuda100_rc_1/lib/libOpenMM.so
	linux-vdso.so.1 (0x00007ffee1da0000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fab281ee000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fab27fea000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fab27dcb000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fab27a42000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fab276a4000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fab2748c000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fab2709b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fab28952000)

Could you help me fix this problem? Of course, I can compile OpenMM from source and then I won't have this issue, but it is so nice to use conda. Thank you very much for your kind assistance.

Best regards,

Istvan

What is the OpenMM_DIR for a conda installation?

I have a very simple question coming from a biologist trying to learn computers: how do I determine the Openmm_DIR in cmake to install openmm-plumed? I have installed openmm via conda, so I have guessed:
/home/lewis/miniconda3/include/openmm but compiling gives
/home/lewis/Downloads/openmm-plumed-master/openmmapi/include/PlumedForce.h:35:28: fatal error: openmm/Context.h: No such file or directory

Additionally, is CUDA_SDK_ROOT_DIR necessary? I have installed the cuda toolkit, but this option is prefilled with 'NOTFOUND'. Googling the cuda sdk takes me to the cuda toolkit.

I tried to be sneaky and install openmm-plumed via the AceMD conda channel (https://anaconda.org/acellera/openmm-plumed2) but still can't from openmmplumed import PlumedForce. Yet print(pluginLoadedLibNames) does return libOpenMMPlumedOpenCL.so which confuses me further. I do have /home/lewis/miniconda3/pkgs/openmm-plumed2-7.1.0-3/lib/libOpenMMPlumed.so. Perhaps the acemd version is expecting cuda-8.0 because print(Platform.getPluginLoadFailures()) gives ('Error loading library /home/lewis/miniconda3/lib/plugins/libOpenMMPlumedCUDA.so: libcudart.so.8.0: cannot open shared object file: No such file or directory',)

Anticipating problems I saw in the other issues: print(version.openmm_library_path) gives a directory that does have plumed plugin libraries within

Thanks!

MTSIntegrator

Just a clarification, the PLUMED plugin injects PLUMED forces at every time step, correct? Does this mean the outer time step when using the MTSIntegrator?
Thanks,
Istvan

Building Python wrappers error

Hi, I get these errors while trying to make the python wrappers:

make PythonInstall
[100%] Generating PlumedPluginWrapper.cpp
/home/ahmad/Downloads/openmm-plumed-master/python/plumedplugin.i:4: Error: Unable to find 'swig/OpenMMSwigHeaders.i'
/home/ahmad/Downloads/openmm-plumed-master/python/plumedplugin.i:5: Error: Unable to find 'swig/typemaps.i'
python/CMakeFiles/PythonInstall.dir/build.make:60: recipe for target 'python/PlumedPluginWrapper.cpp' failed
make[3]: *** [python/PlumedPluginWrapper.cpp] Error 1
CMakeFiles/Makefile2:403: recipe for target 'python/CMakeFiles/PythonInstall.dir/all' failed
make[2]: *** [python/CMakeFiles/PythonInstall.dir/all] Error 2
CMakeFiles/Makefile2:410: recipe for target 'python/CMakeFiles/PythonInstall.dir/rule' failed
make[1]: *** [python/CMakeFiles/PythonInstall.dir/rule] Error 2
Makefile:251: recipe for target 'PythonInstall' failed
make: *** [PythonInstall] Error 2

I'm not sure where it's coming from, but apparently some files are missing?

Occasional wrong results

I am facing a subtle bug. On occasions I get FES landscapes on the dialanine example which are off. It's non-deterministic, hence hard to reproduce and diagnose, but the bug is seen e.g. from HILLS heights trends (attached).

Left is a likely-correct run (diala CHARMM22 FES, 300 K, textbook example). Right is the occasional (1/5 maybe) wrong run. Top: well-tempered HILLS height with time. Bottom: FES. Repo here.

immagine
immagine

Tutorial

Make a tutorial how to use OpenMM-PLUMED with a complete example. So the mistakes like in #48 are avoided.

openmm plumed write output to bck.0.COLVARS instead of COLVARS

Hi,

I found when I simulate a specific system with openmm plumed on GPU by CUDA, the plumed output, which should be written to COLVARS, is actually written to bck.0.COLVARS while an empty COLVARS is also produced (before the simulation starts, there is no COLVARS file in the working directory).

To reproduce the issue, you can download and unpack the .tar.gz file, then in the directory with all the files, run command python run_system.py --platform CUDA > simulation_output.txt, you will see an empty COLVARS is produced, and the plumed output is written to bck.0.COLVARS.

My openmm version is 7.5.1, openmm-plumed version is 1.0, cudatoolkit is 10.0.130. GPU type is Nvidia Volta V100.

This problem only happens when using GPU. If run by CPU with command: python run_system.py --platform CPU > simulation_output.txt, then openmm plumed output are correctly written to COLVARS.

Additionally, if you remove this line simulation.minimizeEnergy() from run_system.py, then run with CUDA, plumed output will be correctly written to COLVARS.

So far based on these tests, I cannot locate the source of this issue. It will be helpful if anyone could help, thanks!

simulation.tar.gz

Install without cmake_gui

Hi,

How can I install this plugin without cmake_gui in a server?
I only have cmake in that machine.

Thanks.

UNITS not taken into account

It looks like UNITS statements don't have an effect - this is easily seen for LENGTH in this test case but I suspect it affects energies etc.

I have seen that conversion factors are properly set in the code, so I can't really figure out the underlying cause. Posting it here for future reference.

Versioning

For the conda recipe I need the project to decide on a versioning scheme. Everything is almost ready in conda-forge/staged-recipes#13486.

So far I resorted to YYYY.MM.DD, but I wonder if you'd rather choose a semver scheme with tagged releases in this repo?

more import errors

Hey Peter,
So i am running into a newer error on another cluster when I try and install the plugin there. I already have OpenMM 7.0.1 installed along with plumed. I also tried doing fresh builds but it sems to install just fine and then gives the following error.

 plumed --is-installed
[msultan@gpu-27-21 ~/software/openmm-plumed/temp6]$ python -m simtk.testInstallation
There are 4 Platforms available:

1 Reference - Successfully computed forces
2 CPU - Successfully computed forces
3 CUDA - Successfully computed forces
4 OpenCL - Successfully computed forces

Median difference in forces between platforms:

Reference vs. CPU: 1.97903e-05
Reference vs. CUDA: 2.15426e-05
CPU vs. CUDA: 1.55626e-05
Reference vs. OpenCL: 2.15122e-05
CPU vs. OpenCL: 1.55626e-05
CUDA vs. OpenCL: 1.47779e-07
[msultan@gpu-27-21 ~/software/openmm-plumed/temp6]$ which python
~/software/anaconda/bin/python
[msultan@gpu-27-21 ~/software/openmm-plumed/temp6]$ which ipython
~/software/anaconda/bin/ipython
[msultan@gpu-27-21 ~/software/openmm-plumed/temp6]$ python -m openmmplumed
Traceback (most recent call last):
  File "/home/msultan/software/anaconda/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/msultan/software/anaconda/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/msultan/software/anaconda/lib/python3.5/site-packages/openmmplumed.py", line 28, in <module>
    _openmmplumed = swig_import_helper()
  File "/home/msultan/software/anaconda/lib/python3.5/site-packages/openmmplumed.py", line 24, in swig_import_helper
    _mod = imp.load_module('_openmmplumed', fp, pathname, description)
  File "/home/msultan/software/anaconda/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/home/msultan/software/anaconda/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: /home/msultan/software/anaconda/lib/python3.5/site-packages/_openmmplumed.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZNK12PlumedPlugin11PlumedForce9getScriptB5cxx11Ev

Thanks for all the help!

Specified a Platform for a Context which does not support all required kernels

I am trying to run a simulation on a GPU using CUDA but am running into this error:

Traceback (most recent call last):
File "../src/biased_simulation.py", line 277, in
run_simulation(args.force_constant)
File "../src/biased_simulation.py", line 222, in run_simulation
simulation = Simulation(modeller.topology, system, integrator, platform)
File "XXXX/lib/python3.8/site-packages/simtk/openmm/app/simulation.py", line 103, in init
self.context = mm.Context(self.system, self.integrator, platform)
File "XXXX/openmm-7.5.0-jqi6xufw5yoxhm3mtam5vw3b42hx54q6/lib/python3.8/site-packages/simtk/openmm/openmm.py", line 15587, in init
_openmm.Context_swiginit(self, _openmm.new_Context(*args))
simtk.openmm.OpenMMException: Specified a Platform for a Context which does not support all required kernels

According to this GitHub issue: #10, this is solved by using Platform.loadPluginsFromDirectory() with the directory where the OpenMMPlumed**.so files are located, but I am already doing this and loading the following plugins:

libOpenMMAmoebaCUDA.so libOpenMMCudaCompiler.so libOpenMMOpenCL.so libOpenMMPlumedReference.so
libOpenMMAmoebaReference.so libOpenMMDrudeCUDA.so libOpenMMPME.so libOpenMMRPMDCUDA.so
libOpenMMCPU.so libOpenMMDrudeOpenCL.so libOpenMMPlumedCUDA.so libOpenMMRPMDOpenCL.so
libOpenMMCUDA.so libOpenMMDrudeReference.so libOpenMMPlumedOpenCL.so libOpenMMRPMDReference.so

I checked Platform.getPluginLoadFailures() and there are no failures for the shared object files.

Python Bindings fail to build with Plumed + OpenMM 7.5

Plumed and plumed-openmm successfully built, but when attempting to build the openmm-plumed python plugin (make PythonInstall) the following error occured:

cd /scicore/home/lilienfeld/browni0000/software/openmm-plumed-src/build/python && /scicore/home/lilienfeld/browni0000/software/swig/bin/swig -python -c++ -o PlumedPluginWrapper.cpp -I/scicore/home/lilienfeld/browni0000/software/openmm/include /scicore/home/lilienfeld/browni0000/software/openmm-plumed-src/python/plumedplugin.i
swig: DOH/base.c:36: DohDelete: Assertion `0' failed.
/bin/sh: line 1:  7620 Aborted                 /scicore/home/lilienfeld/browni0000/software/swig/bin/swig -python -c++ -o PlumedPluginWrapper.cpp -I/scicore/home/lilienfeld/browni0000/software/openmm/include /scicore/home/lilienfeld/browni0000/software/openmm-plumed-src/python/plumedplugin.i
 CMAKE_BUILD_TYPE                                                                                                                    
 CMAKE_INSTALL_PREFIX             /scicore/home/lilienfeld/browni0000/software/openmm                                                
 CUDA_HOST_COMPILER               /scicore/soft/apps/GCCcore/8.3.0/bin/cc                                                            
 CUDA_SDK_ROOT_DIR                CUDA_SDK_ROOT_DIR-NOTFOUND                                                                         
 CUDA_TOOLKIT_ROOT_DIR            /scicore/soft/apps/CUDA/10.1.243-GCC-8.3.0                                                         
 CUDA_USE_STATIC_CUDA_RUNTIME     ON                                                                                                 
 CUDA_rt_LIBRARY                  /usr/lib64/librt.so                                                                                
 OPENCL_INCLUDE_DIR               /scicore/soft/apps/CUDA/10.1.243-GCC-8.3.0/include                                                 
 OPENCL_LIBRARY                   /scicore/soft/apps/CUDA/10.1.243-GCC-8.3.0/lib64/libOpenCL.so                                      
 OPENMM_DIR                       /scicore/home/lilienfeld/browni0000/software/openmm                                                
 PLUMED_BUILD_CUDA_LIB            ON                                                                                                 
 PLUMED_BUILD_OPENCL_LIB          ON                                                                                                 
 PLUMED_BUILD_PYTHON_WRAPPERS     ON                                                                                                 
 PLUMED_INCLUDE_DIR               /scicore/home/lilienfeld/browni0000/software/plumed/include/plumed                                 
 PLUMED_LIBRARY_DIR               /scicore/home/lilienfeld/browni0000/software/plumed/lib                                            
 PYTHON_EXECUTABLE                /scicore/home/lilienfeld/browni0000/miniconda3/envs/sci/bin/python                                 
 SWIG_EXECUTABLE                  /scicore/home/lilienfeld/browni0000/software/swig/bin/swig                                         

I'm using Python 3.7, swig 3.0.5, and all plumed/openmm/openmm-plumed codes were compiled with gcc 8.3

If any help/advice could be given would be greatly appreciated.

Compiling with CUDA&OpenCL: 'Lepton' not declared in this scope

I am trying to provide the conda recipes as suggested in #6. This is happening in this PR: conda-forge/staged-recipes#13486

After the release of Plumed 2.7, the Reference platform can build correctly (see temporary CPU builds in the CI logs for Linux and MacOS).

However, OpenCL and CUDA are not as lucky. There's an issue with lepton and its scope in the OpenMM headers:

Scanning dependencies of target OpenMMPlumedCUDA
[ 73%] Building CXX object platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o
In file included from ${PREFIX}/include/openmm/cuda/CudaExpressionUtilities.h:30:0,
                 from ${PREFIX}/include/openmm/cuda/CudaContext.h:45,
                 from ${WORK}/platforms/cuda/src/CudaPlumedKernels.h:37,
                 from ${WORK}/platforms/cuda/src/CudaPlumedKernelFactory.cpp:35:
${PREFIX}/include/openmm/common/ExpressionUtilities.h:61:63: error: 'Lepton' was not declared in this scope
     std::string createExpressions(const std::map<std::string, Lepton::ParsedExpression>& expressions, const std::map<std::string, std::string>& variables,
                           

Any ideas? This is the build script.

Error building

Hello, I have now successfully built and installed both PLUMED and OpenMM into a conda environment but now run into some difficulties with the build of this plugin. The error message I get is quite long so I included just the start and end of it below.

Screenshot 2022-07-22 at 17 19 01

Screenshot 2022-07-22 at 17 19 35

The ccmake settings used were as below:
Screenshot 2022-07-22 at 17 23 17

Any help is much appreciated, thanks!

installation error for OpenMM 7.2

Hi Peter,

I am trying to install openmm-plumed with OpenMM 7.2, but I got following errror:

Building CXX object platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o
In file included from /home/fisiksnju/.openmm72/include/openmm/cuda/CudaPlatform.h:32:0,
                 from /home/fisiksnju/.openmm72/include/openmm/cuda/CudaContext.h:44,
                 from /home/fisiksnju/.temp_softwares/openmm-plumed/platforms/cuda/src/CudaPlumedKernels.h:37,
                 from /home/fisiksnju/.temp_softwares/openmm-plumed/platforms/cuda/src/CudaPlumedKernelFactory.cpp:35:
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:76:23: error: ‘std::function’ has not been declared
     void execute(std::function<void (ThreadPool&, int)> task);
                       ^
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:76:31: error: expected ‘,’ or ‘...’ before ‘<’ token
     void execute(std::function<void (ThreadPool&, int)> task);
                               ^
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:99:5: error: ‘function’ in namespace ‘std’ does not name a type
     std::function<void (ThreadPool& pool, int)> currentFunction;
     ^
make[2]: *** [platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o] Error 1
make[1]: *** [platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/all] Error 2
make: *** [all] Error 2

This error does not appear in OpenMM 7.0 as I just tested it, do you have any clue what the problem is?

I just check CMakeCache.txt, seems that it is using CUDA_HOST_COMPILER:FILEPATH=/usr/bin/gcc-4.8 as compiler, would that be an issue here?

Updated: yes, for gcc version older than 6.0, I need to explicitly turn on -std=c++11 switch in CMake, that solved the problem.

Thanks!

building error

Hi,
When I try to build this plugin, I got this:

Scanning dependencies of target OpenMMPlumed
[  5%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o
/home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/src/PlumedForce.cpp: In member function ‘virtual OpenMM::ForceImpl* PlumedPlugin::PlumedForce::cre:
/home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/src/PlumedForce.cpp:47:37: error: invalid new-expression of abstract class type ‘PlumedPlugin::Plu’
     return new PlumedForceImpl(*this);
                                     ^
In file included from /home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/src/PlumedForce.cpp:33:0:
/home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/include/internal/PlumedForceImpl.h:50:28: note:   because the following virtual functions are pure:
 class OPENMM_EXPORT_PLUMED PlumedForceImpl : public OpenMM::ForceImpl {
                            ^
In file included from /home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/include/internal/PlumedForceImpl.h:36:0,
                 from /home/zy/proj/link_to_2T/software/openmm-plumed/openmmapi/src/PlumedForce.cpp:33:
/home/zy/anaconda2/pkgs/openmm-7.1.1-py36_0/include/openmm/internal/ForceImpl.h:77:18: note:    virtual void OpenMM::ForceImpl::updateContextState(OpenMM::C)
     virtual void updateContextState(ContextImpl& context) = 0;
                  ^
CMakeFiles/OpenMMPlumed.dir/build.make:62: recipe for target 'CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o' failed
make[2]: *** [CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/OpenMMPlumed.dir/all' failed
make[1]: *** [CMakeFiles/OpenMMPlumed.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

and the cmake setting:
qq 20180424194708

Could you help look is there anything wrong?

CUDA slowness

There is something odd going on in the CUDA version: it's many times slower than the reference implementation, even with a "do-nothing" PLUMED input. I doubt it's just memory copying as it occurs with a handful of atoms. A self-contained example is here https://github.com/giorginolab/openmm-plumed-diala

METAD bias potential updated by Context.getState(getEnergy=True)

Hi!
first of all, thank you for maintaining this amazing plugin. I've encountered a problem when running metadynamics with openmm-plumed. The core of the program is the following:

  • A Gaussian is placed every 100 steps in the protocol
  • Integration for 100 steps is performed, the system is in configuration x1
  • The positions in the context are set to another configuration, lets say x2
  • The energy of that configuration x2 is evaluated
  • The simulation is reset to the configuration x1
  • Repeat the process

Strangely, plumed updates the HILLS file based on x2, not on x1. But an energy evaluation should not be counted as a step, am I right? Shouldn't this be prevented from happening by this check?

Here is a small example of a simulation script for an Na+Cl- ion pair together with the resulting (wrong) HILLS file: metad_test.zip. A workaround is to set the system's StepCount to something that is not a multiple of the bias deposition stride, and set it back after the calculation.

Thanks for your help!

Edit:
Could it be linked to the way openmm increments the step counter, essentially doing:
step=0
CalculateForces()
step+= 1
...
So that here the step counter is 100 after one round of the above protocol, but the force calculation was last performed when the step counter was 99, therefore the energy request triggers the update?

Can add PlumedForce() but no COLVAR or HILLS file is written.

Hi,

I am using OpenMM 7.5 and just successfully installed openmm-plumed through conda. My "conda list" output is:

openmm                    7.5.0            py37h7adb4fe_4    conda-forge
openmm-plumed             1.0              py37h49e701d_3    conda-forge
plumed                    2.7.0                h1ff6a10_0    conda-forge

I can successfully build my system and add a PlumedForce using the lines below:

#atom1 = 1798 in PDB count
#atom2 = 2438 in PDB count
script = """
d: DISTANCE ATOMS=1797,2437
METAD ARG=d SIGMA=0.2 HEIGHT=0.3 PACE=500 FILE=HILLS
PRINT STRIDE=1 ARG=* FILE=COLVAR"""
system.addForce(PlumedForce(script))

The simulation runs smoothly, but no COLVAR or HILLS files are written, nor visible bias is observed between atoms 1797 and 2437. Is this a normal behavior?

Installation with openmm on anaconda 3

I installed both openmm 7.3.2 and plumed 2.3.3 with anaconda, but encountered the following when installing openmm-plumed from source:
[ 3%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o
[ 7%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForceImpl.cpp.o
[ 11%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedForceProxy.cpp.o
[ 15%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedSerializationProxyRegistration.cpp.o
[ 19%] Linking CXX shared library libOpenMMPlumed.so
[ 19%] Built target OpenMMPlumed
[ 23%] Building CXX object serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o
[ 26%] Linking CXX executable TestSerializePlumedForce
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function testSerialization()': TestSerializePlumedForce.cpp:(.text+0x1f5): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function void OpenMM::XmlSerializer::serialize<PlumedPlugin::PlumedForce>(PlumedPlugin::PlumedForce const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream&)': TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x72): undefined reference to OpenMM::SerializationNode::setName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0xe1): undefined reference to OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x121): undefined reference to OpenMM::SerializationProxy::getTypeNameabi:cxx11 const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x17d): undefined reference to OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const' TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x1c3): undefined reference to OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
../../libOpenMMPlumed.so: undefined reference to OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenMM::ContextImpl&) const' ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/build.make:84: recipe for target 'serialization/tests/TestSerializePlumedForce' failed
make[2]: *** [serialization/tests/TestSerializePlumedForce] Error 1
CMakeFiles/Makefile2:122: recipe for target 'serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all' failed
make[1]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Python unit test?

It'd be great to have at least one unit test for the Python wrappers so it can be included in the upcoming CI.

Compile error

Hi,
When I try to compile this package I met this problem. Could anyone knows which part of configuration is wrong? Is that caused by the CUDA library?

[ 27%] Building CXX object serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o
Linking CXX executable TestSerializePlumedForce
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: in function testSerialization()': TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x3bc): undefined reference to OpenMM::SerializationNode::setName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x405): undefined reference to OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x430): undefined reference to OpenMM::SerializationProxy::getTypeNameabi:cxx11 const'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x468): undefined reference to OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0xb67): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0xffc): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x149d): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x1951): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x2245): undefined reference to OpenMM::SerializationProxy::getTypeNameabi:cxx11 const'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenMM::ContextImpl&) const' /home/sj52/anaconda3/bin/../lzju.edu.cnib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getChildNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::setDoubleProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, double)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getBoolProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::createChildNode(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getDoubleProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::setBoolProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)'
/home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld generated: undefined reference to OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [serialization/tests/TestSerializePlumedForce] Error 1
make[1]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
make: *** [all] Error 2

Platform Exception with PLUMED 2.3.1 / OpenMM 7.1.0 / CUDA 8.0

Hello,

I am having trouble getting PLUMED 2.3.1 and OpenMM 7.1.0 to work together with the current version of the openmm-plumed plugin (downloaded earlier today). I have compiled openmm-plumed with CUDA (version 8.0); the executable passes the tests and can be imported in Python.

However, when I try to launch an OpenMM simulation (with a setup that I know works otherwise) with a PlumedForce, I obtain the following exception:

Traceback (most recent call last): File "openmm-implicit-obc2.py", line 104, in <module> simulation = Simulation(psf.topology, system, integrator, platform) File "/usr/local/lib/python2.7/dist-packages/simtk/openmm/app/simulation.py", line 103, in __init__ self.context = mm.Context(self.system, self.integrator, platform) File "/usr/local/lib/python2.7/dist-packages/simtk/openmm/openmm.py", line 5570, in __init__ this = _openmm.new_Context(*args) Exception: Specified a Platform for a Context which does not support all required kernels

This error arises regardless as to whether I specify CUDA or CPU as the Platform for OpenMM. Would you have an idea of how to solve the problem?

I am fairly new to openMM and PLUMED (long term NAMD user here...), so I may have missed something obvious. If that is the case I apologize.

Thanks in advance for your help,

Florian

Energy is NaN after adding PlumedForce to the system

behavior occurs when I add a Plumed script to the system via:

topology = top.topology
positions = gro.positions
system = top.createSystem(nonbondedMethod=nonbondedMethod, nonbondedCutoff=nonbondedCutoff,
    constraints=constraints, rigidWater=rigidWater, ewaldErrorTolerance=ewaldErrorTolerance)
script = """
c1: COM ATOMS=9021-9080
c2: COM ATOMS=1-9020 NOPBC
c3: COM ATOMS=8121-9020 NOPBC
distance: DISTANCE ATOMS=c2,c1 COMPONENTS
real: DISTANCE ATOMS=c2,c1
xydist2: COMBINE ARG=distance.x,distance.y POWERS=2,2 PERIODIC=NO
xydist: COMBINE ARG=xydist2 POWERS=0.5 PERIODIC=NO
p: RESTRAINT ...
    ARG=real
    AT=0
    SLOPE=0.0
    KAPPA=0
... p:
PRINT ARG=real,xydist,distance.z STRIDE=100 FILE=test.pullcolvar.out
"""
system.addForce(PlumedForce(script))
potE = simulation.context.getState(getEnergy=True).getPotentialEnergy()

print("Pot. energy", potE)

Potential energy prints out NaN when the PlumedForce is added, without PlumedForce it prints out an energy.

can not import PlumedForce

Hi Peter,

I think I successfully installed the openmmplumed because it says %100 on the built target.
And I tried to export LD_LIBRARY_PATH=/usr/local/lib/plumed.

However, I can not import PlumedFOrce and it says "No module named openmmplumed".
Are there anything I missed in the installation process? Thanks for helping.

--Hongbin

OpenMM-PLUMED with VariableLangevinIntegrator

Hi, I am trying to run OpenMM-PLUMED with the VariableLangevinIntegrator, but even though PLUMED seems to work (it uses CPU cycles), it does not print any bias log data, and it is hard to tell if whatever it calculates makes sense. I guess, the problem is that no time step information is given to PLUMED, see copy of the PLUMED output below.

PLUMED: PLUMED is starting
PLUMED: Version: 2.7.1 (git: Unknown) compiled on Apr 21 2021 at 15:30:46
PLUMED: Please cite these papers when using PLUMED [1][2]
PLUMED: For further information see the PLUMED web page at http://www.plumed.org
PLUMED: Root: /home/istvan/opt/plumed-2.7.1-istvan-install/lib/plumed
PLUMED: For installed feature, see /home/istvan/opt/plumed-2.7.1-istvan-install/lib/plumed/src/config/config.txt
**PLUMED: Molecular dynamics engine: OpenMM**
PLUMED: Precision of reals: 8
PLUMED: Running over 1 node
PLUMED: Number of threads: 4
PLUMED: Cache line size: 512
PLUMED: Number of atoms: 34181
PLUMED: File suffix: 
**PLUMED: Timestep: -nan**
PLUMED: KbT has not been set by the MD engine
PLUMED: It should be set by hand where needed

I wonder, does this mean that I cannot use VariableLangevinIntegrator?

Thank you very much,

Istvan

Simulation freezing while reading Plumed script

Hi,

I have been facing this problem for a while and I could not find a solution for it. I ran a 500ns metadynamics on my system using both OpenMM and Plumed, which was not enough to achieve convergence of my FES. I want to extend my simulation, but my simulation freezes while reading the Plumed script as shown on Production.log below.

Production.log

My plumed script is intended to create a cylinder volume based metadynamics, as below.
metady_cyl_K2.txt

My OpenMM script is this:
Production_script.zip

I have seen this freezing behavior in different systems and metadynamics protocols as well. I have faced this issue while running locally in my PC and in a HPC facility.

Any ideas?

Error while compiling openmm-plumed

Hi Team,
I am new to this type of installations.
I did followed the instructions to compile and got an error while compilation on Mac (High Seirra).
Please see below the error for more details:

Scanning dependencies of target TestReferencePlumedForce
[ 57%] Building CXX object platforms/reference/tests/CMakeFiles/TestReferencePlumedForce.dir/TestReferencePlumedForce.cpp.o
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:83:5: error: expected variable name or 'this' in lambda capture list
ASSERT_EQUAL_VEC(Vec3(), state.getForces()[1], 1e-5);
^
/usr/local/openmm/include/openmm/internal/AssertionUtilities.h:57:174: note: expanded from macro 'ASSERT_EQUAL_VEC'
...found, tol) {double norm = std::sqrt((expected).dot(expected)); double scale = norm > 1.0 ? norm : 1.0; if ((std::abs(((expected)[0])-((found)[0]))/scale > (...
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:83:5: error: expected variable name or 'this' in lambda capture list
/usr/local/openmm/include/openmm/internal/AssertionUtilities.h:57:234: note: expanded from macro 'ASSERT_EQUAL_VEC'
...double scale = norm > 1.0 ? norm : 1.0; if ((std::abs(((expected)[0])-((found)[0]))/scale > (tol)) || (std::abs(((expected)[1])-((found)[1]))/scale > (tol)) ...
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:83:5: error: expected variable name or 'this' in lambda capture list
/usr/local/openmm/include/openmm/internal/AssertionUtilities.h:57:294: note: expanded from macro 'ASSERT_EQUAL_VEC'
...: 1.0; if ((std::abs(((expected)[0])-((found)[0]))/scale > (tol)) || (std::abs(((expected)[1])-((found)[1]))/scale > (tol)) || (std::abs(((expected)[2])-((found)[2...
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:256:2: error: expected '}'
}
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:83:5: note: to match this '{'
ASSERT_EQUAL_VEC(Vec3(), state.getForces()[1], 1e-5);
^
/usr/local/openmm/include/openmm/internal/AssertionUtilities.h:57:48: note: expanded from macro 'ASSERT_EQUAL_VEC'
#define ASSERT_EQUAL_VEC(expected, found, tol) {double norm = std::sqrt((expected).dot(expected)); double scale = norm > 1.0 ? norm : 1.0; if ((std::abs(((expe...
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:256:2: error: expected '}'
}
^
/Users/nyuad/openmm-plumed/platforms/reference/tests/TestReferencePlumedForce.cpp:56:18: note: to match this '{'
void testForce() {
^
5 errors generated.
make[2]: *** [platforms/reference/tests/CMakeFiles/TestReferencePlumedForce.dir/TestReferencePlumedForce.cpp.o] Error 1
make[1]: *** [platforms/reference/tests/CMakeFiles/TestReferencePlumedForce.dir/all] Error 2
make: *** [all] Error 2

Below the cmake output :
CMAKE_BUILD_TYPE
CMAKE_EXECUTABLE_FORMAT MACHO
CMAKE_INSTALL_PREFIX /usr/local/openmm
CMAKE_OSX_ARCHITECTURES
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT
CUDA_HOST_COMPILER /Library/Developer/CommandLineTools/usr/bin/clang
CUDA_SDK_ROOT_DIR CUDA_SDK_ROOT_DIR-NOTFOUND
OPENCL_INCLUDE_DIR /System/Library/Frameworks/OpenCL.framework/Headers
OPENCL_LIBRARY /System/Library/Frameworks/OpenCL.framework
OPENMM_DIR /usr/local/openmm
PLUMED_BUILD_CUDA_LIB OFF
PLUMED_BUILD_OPENCL_LIB ON
PLUMED_BUILD_PYTHON_WRAPPERS ON
PLUMED_INCLUDE_DIR /usr/local/include/plumed
PLUMED_LIBRARY_DIR /usr/local/lib
PYTHON_EXECUTABLE /Users/nyuad/miniconda3/bin/python
SWIG_EXECUTABLE /usr/local/bin/swig

Can you please advise how to fix this issue? many thanks in advance.

Thanks,
Fahed

Can import openmmplumed but cannot run simulation

Hi,

I've been trying to run a simulation using the openmmplumed plugin. With some help I was able to create a new python environment and compile and install the plugin. I am able to import the openmmplumed PlumedForce and add it to my system but it does not let me run the simulation. Below is my code and the error message I got

import numpy as np
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
from openmmplumed import PlumedForce

#Load the input files
prmtop = AmberPrmtopFile('input.prmtop')
inpcrd = AmberInpcrdFile('input.inpcrd')

#set up system
system = prmtop.createSystem(implicitSolvent=OBC2, soluteDielectric=1.0, solventDielectric=80.0)

#load PLUMED file and apply to system
system.addForce(PlumedForce('pull_plumed.dat'))

integrator = LangevinIntegrator(300kelvin, 1/picosecond, 0.002picoseconds)

#set up simulation
simulation = Simulation(prmtop.topology, system, integrator)
simulation.context.setPositions(inpcrd.positions)
if inpcrd.boxVectors is not None:
simulation.context.setPeriodicBoxVectors(*inpcrd.boxVectors)

#Minimization
simulation.minimizeEnergy()

#Output specifications
simulation.reporters.append(PDBReporter('output_implicit.pdb', 1000))
simulation.reporters.append(StateDataReporter('data_implicit.txt', 1000, step=True,
potentialEnergy=True, temperature=True, volume=True, totalSteps=1000000, speed=True, separator=' '))

#Run the simulation
simulation.step(1000000)

The error message I get is
Screenshot from 2020-10-20 19-00-46

Any suggestions to help solve this would be very helpful. Thank you in advance!

Yuvraj

Installation problem: Make error

Hi,
When I try to build the plugin, I get these:

[ 31%] Built target OpenMMPlumed
[ 31%] Linking CXX executable TestSerializePlumedForce
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `testSerialization()':
TestSerializePlumedForce.cpp:(.text+0x1f5): undefined reference to `OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `void OpenMM::XmlSerializer::serialize<PlumedPlugin::PlumedForce>(PlumedPlugin::PlumedForce const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream&)':
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x72): undefined reference to `OpenMM::SerializationNode::setName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0xe1): undefined reference to `OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x121): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x17d): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x1c3): undefined reference to `OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenMM::ContextImpl&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/build.make:95: recipe for target 'serialization/tests/TestSerializePlumedForce' failed
make[2]: *** [serialization/tests/TestSerializePlumedForce] Error 1
CMakeFiles/Makefile2:122: recipe for target 'serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all' failed
make[1]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

This is the screen shot of the configure settings:

screenshot at 2017-12-27 22 06 33

Any idea what I'm doing wrong?

Enabling plumed modules with conda install

Hello,

Is it possible to enable a plumed module when installing via conda? For example:

./configure --enable-modules=+piv+annfunc

Or is the cmake route the only option here?

Thanks,
Mike

Error loading an external library

Hi,

I'm attempting to use an external C script to do funnel Metadynamics using OpenMM-PLUMED, however it it fails to load the script, with the following error:

+++ PLUMED error
+++ at PlumedMain.cpp:914, function void PLMD::PlumedMain::load(const string&)
+++ message follows +++
I cannot load library ./ProjectionOnAxis.so ./ProjectionOnAxis.so: undefined symbol: _ZTIN4PLMD6ActionE

I've compiled OpenMM from source and patched it with the PLUMED plugin from the master branch, using
gcc/g++ 7.5.0. PLUMED version is 2.6.1. Amber20 loads ProjectionOnAxis.so perfectly fine, so it not plumed itself.

Attaching all the input files for replication. error_fun_metaD.zip

Also, here's what the PLUMED output should look like -
correct_plumed_output.txt

Restarting simulation from .xml file yields wrong timestamp on Plumed output

Hi,

I ran a metadynamics simulation on strides of 100ns each using OpenMM v7.5.1 + Plumed v2.7. Although I can successfully restart my simulation and Plumed continues outputting data as it should, the timestamp used seems to be incorrect.

I am restarting my simulation using the .xml state file outputted at 800ns. I am explicitly defining the correct "simulation.currentStep" and current time ("simulation.context.setTime()") before actually triggering the "simulation.step(nsteps)" command but Plumed still outputs a timestamp starting from 0.

Below there is a set of input files that should yield the error. This error only appears when I restart my simulation from the .xml state file. Loading from the checkpoint works just fine.

restart_timestamp.zip

Any ideas on this is highly appreciated.
Thanks!

conda recipe for openmm-plumed

So it seems like both plumed and openmm have conda recipes associated with them. Would it be possible to create a conda recipe for openmm-plumed to make it easier to install and deploy on travis?

How to correctly use openmm-plumed for system without periodic boundary condition

May I ask how to correctly set the plumed bias for periodic/non-periodic boundary systems (PBC or nonPBC)? In openmm, the periodic boundary condition is set for each single force, instead of set globally. There are methods to set forces as PBC or nonPBC. for example, for bond, there is setUsesPeriodicBoundaryConditions to set whether to use PBC for bonded interactions, and setNonbondedMethod for nonbonded interactions. So I wonder for plumed bias, if there is similar settings in openmm so that it can work properly for PBC and nonPBC systems? Another possibility is, whether to use PBC or not is only controlled by adding "NOPBC" or not in defining collective variables?

PLUMED forces with MTSIntegrator

Hi, this is not strictly an issue but more of a question and/or feature request. The gist of the problem is that since PLUMED is running on CPU, it is a huge bottleneck and can slow down OpenMM-PLUMED simulations by multiple fold with respect to a pure OpenMM GPU simulation. PLUMED has a built-in STRIDE option that works for some actions such as METAD but not others like DRR. The basic idea behind STRIDE is to compute PLUMED forces only every so often instead of at every time step, but when computed, PLUMED forces are multiplied by the value of STRIDE. So, for example with STRIDE=2, PLUMED forces are computed only at every other time step but then the forces are multiplied by two, and this should work well for slow varying biases.

I was wondering if I can reproduce the same behavior using MTSIntegrator for any kind of PLUMED action. Normally I use MTSIntegrator like this:
integrator = MTSIntegrator(2femptoseconds, [(2,1), (1,1), (0,2)])
where force group 1 is the nonbonded.setReciprocalSpaceForceGroup and group 2 is the PLUMED force. So, I could do something like this:
integrator = MTSIntegrator(4
femptoseconds, [(2,1), (1,2), (0,4)])

However, I don't fully understand how MTSIntegrator works. It is clear that the 3 different force groups are evaluated with different frequencies (and accordingly I do get a significant speed up applying the second integrator with respect to using the first integrator), but what exact forces are injected at intermediate time steps? I see 3 different options, but I couldn't figure out which if any is used in MTSIntegrator. Option 1) only forces that are computed are injected. Option 2) at intermediate steps the computed force(s) + a stale force (the last computed force) is injected for the remainder of the force group(s). Option 3) like option 1) but group 1 forces are multiplied by 2 and group 2 forces are multiplied by 4 when they are injected.

I can easily be wrong regarding all these options, could you clarify what MTSIntegrator does and whether what I suggest regarding PLUMED forces is feasible to do.

Thanks!

Istvan

Does not interface with extra PLUMED2 modules (i.e FunnelMD, Maze)

After compiling plumed, openmm, and openmm-plumed locally, I would have thought that the force script utilizes plumed native parsing. However, I cannot reference the additional plumed modules through the plugin. Is there a simple fix such as adding the tags for them to be parsed somewhere?

I do not believe that this should break any existing calculations since it works already with the METAD tag.

Edit: I should clarify, the force is being picked up, but it does not capture the correct platform for the specified context. This is odd since a normal METAD tag PLUMEDForce script does capture the correct platform.

make error

Hi, I am getting following error while during make install. I don't know what it's about. Can you please help me with it?

[ 3%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o
[ 7%] Building CXX object CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForceImpl.cpp.o
[ 11%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedForceProxy.cpp.o
[ 15%] Building CXX object CMakeFiles/OpenMMPlumed.dir/serialization/src/PlumedSerializationProxyRegistration.cpp.o
[ 19%] Linking CXX shared library libOpenMMPlumed.so
[ 19%] Built target OpenMMPlumed
[ 23%] Building CXX object serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o
[ 26%] Linking CXX executable TestSerializePlumedForce
/home/akognole/modules/plumed/lib/libplumed.so: undefined reference to std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const@GLIBCXX_3.4.18' /home/akognole/modules/plumed/lib/libplumed.so: undefined reference to std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/home/akognole/modules/plumed/lib/libplumed.so: undefined reference to std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const@GLIBCXX_3.4.18' /home/akognole/modules/plumed/lib/libplumed.so: undefined reference to __cxa_throw_bad_array_new_length@CXXABI_1.3.8'
/home/akognole/modules/plumed/lib/libplumed.so: undefined reference to std::chrono::_V2::system_clock::now()@GLIBCXX_3.4.19' /home/akognole/modules/plumed/lib/libplumed.so: undefined reference to std::_Hash_bytes(void const*, unsigned long, unsigned long)@CXXABI_1.3.5'
collect2: ld returned 1 exit status
make[2]: *** [serialization/tests/TestSerializePlumedForce] Error 1
make[1]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.