choderalab / openmmtools

A batteries-included toolkit for the GPU-accelerated OpenMM molecular simulation engine.
http://openmmtools.readthedocs.io
MIT License
244 stars 76 forks source link

Error in paralleltempering #639

Open xlimke opened 1 year ago

xlimke commented 1 year ago

I got an error message when testing the example in paralleltempering.py (https://github.com/choderalab/openmmtools/blob/main/openmmtools/multistate/paralleltempering.py) The error message is as following:

Traceback (most recent call last):
  File "/scratch/96097.mgt01/openmm_run4.py", line 214, in <module>
    simulationx.create(reference_state,
  File "/scratch/96097.mgt01/openmm_run4.py", line 196, in create
    super(ParallelTemperingSampler, self).create(thermodynamic_states, sampler_states, storage=storage, **kwargs)
  File "/share/home/xum/miniconda3/envs/openmm2/lib/python3.9/site-packages/openmmtools/multistate/multistatesampler.py", line 535, in create
    self._pre_write_create(thermodynamic_states, sampler_states, storage,
  File "/share/home/xum/miniconda3/envs/openmm2/lib/python3.9/site-packages/openmmtools/multistate/replicaexchange.py", line 252, in _pre_write_create
    super()._pre_write_create(thermodynamic_states, sampler_states, *args, **kwargs)
  File "/share/home/xum/miniconda3/envs/openmm2/lib/python3.9/site-packages/openmmtools/multistate/multistatesampler.py", line 774, in _pre_write_create
    if state.n_particles != n_particles:
  File "/share/home/xum/miniconda3/envs/openmm2/lib/python3.9/site-packages/openmmtools/states.py", line 2184, in n_particles
    return len(self.positions)
  File "/share/home/xum/miniconda3/envs/openmm2/lib/python3.9/site-packages/simtk/unit/quantity.py", line 727, in __len__
    return len(self._value)
TypeError: object of type 'State' has no len()

Is there something wrong with the script itself or my input file?

Thanks in advance, Meng

mikemhenry commented 1 year ago

What version of openmmtools are you using? Can you post the output of conda list?

xlimke commented 1 year ago

I am using openmmtools of 0.20.0 version installed from conda-forge.

This is my conda list output:

# packages in environment at /share/home/xum/miniconda3/envs/openmm2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
amberlite                 22.0                     pypi_0    pypi
ambertools                22.0             py39h464e725_3    conda-forge
amberutils                21.0                     pypi_0    pypi
arpack                    3.7.0                hdefa2d7_2    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
blosc                     1.21.1               h83bc5f7_3    conda-forge
boost-cpp                 1.74.0               h75c5d50_8    conda-forge
brotli                    1.0.9                h166bdaf_8    conda-forge
brotli-bin                1.0.9                h166bdaf_8    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.18.1               h7f98852_0    conda-forge
ca-certificates           2022.9.24            ha878542_0    conda-forge
certifi                   2022.9.24          pyhd8ed1ab_0    conda-forge
cftime                    1.6.2            py39h2ae25f5_1    conda-forge
contourpy                 1.0.6            py39hf939315_0    conda-forge
cudatoolkit               10.1.243             h6bb024c_0    anaconda
curl                      7.86.0               h2283fc2_1    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    0.29.32          py39h5a03fae_1    conda-forge
fftw                      3.3.10          nompi_hf0379b8_105    conda-forge
fonttools                 4.38.0           py39hb9d737c_1    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
gawk                      5.1.0                h7f98852_0    conda-forge
gsl                       2.7                  he838d99_0    conda-forge
hdf4                      4.2.15               h9772cbc_5    conda-forge
hdf5                      1.12.2          nompi_h4df4325_100    conda-forge
icu                       70.1                 h27087fc_0    conda-forge
jax                       0.3.25             pyhd8ed1ab_0    conda-forge
jaxlib                    0.3.25          cpu_py39h12df254_1    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jpeg                      9e                   h166bdaf_2    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.4            py39hf939315_1    conda-forge
krb5                      1.19.3               h08a2579_0    conda-forge
lcms2                     2.14                 h6ed2654_0    conda-forge
ld_impl_linux-64          2.39                 hcc3a1bd_1    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20220623.0      cxx17_h48a1fff_5    conda-forge
libblas                   3.9.0           16_linux64_openblas    conda-forge
libbrotlicommon           1.0.9                h166bdaf_8    conda-forge
libbrotlidec              1.0.9                h166bdaf_8    conda-forge
libbrotlienc              1.0.9                h166bdaf_8    conda-forge
libcblas                  3.9.0           16_linux64_openblas    conda-forge
libcurl                   7.86.0               h2283fc2_1    conda-forge
libdeflate                1.14                 h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgfortran-ng            12.2.0              h69a702a_19    conda-forge
libgfortran5              12.2.0              h337968e_19    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libgrpc                   1.49.1               h30feacc_1    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
liblapack                 3.9.0           16_linux64_openblas    conda-forge
libnetcdf                 4.8.1           nompi_h261ec11_106    conda-forge
libnghttp2                1.47.0               hff17c54_1    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libopenblas               0.3.21          pthreads_h78a6416_3    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libprotobuf               3.21.9               h6239696_0    conda-forge
libsqlite                 3.40.0               h753d276_0    conda-forge
libssh2                   1.10.0               hf14f497_3    conda-forge
libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
libtiff                   4.4.0                h55922b4_4    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp-base              1.2.4                h166bdaf_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxml2                   2.10.3               h7463322_0    conda-forge
libzip                    1.9.2                hc929e4a_1    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
markupsafe                2.1.1            py39hb9d737c_2    conda-forge
matplotlib-base           3.6.2            py39hf9fd14e_0    conda-forge
mdtraj                    1.9.7            py39h62423bb_4    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
mpiplus                   v0.0.1          pyhd8ed1ab_1003    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
netcdf-fortran            4.6.0           nompi_hc402ea5_101    conda-forge
netcdf4                   1.6.2           nompi_py39hfaa66c4_100    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
nose                      1.3.7                   py_1006    conda-forge
numexpr                   2.8.3           py39hf625f34_101    conda-forge
numpy                     1.23.5           py39h3d75532_0    conda-forge
ocl-icd                   2.3.1                h7f98852_0    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
openjpeg                  2.5.0                h7d73246_1    conda-forge
openmm                    7.5.1            py39h521fe91_1    conda-forge
openmm-plumed             1.0              py39h9e7d1d4_2    conda-forge
openmmtools               0.20.0           py39h3811e60_1    conda-forge
openssl                   3.0.7                h166bdaf_0    conda-forge
opt_einsum                3.3.0              pyhd8ed1ab_1    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
packmol                   20.010               h86c2bf4_0    conda-forge
packmol-memgen            1.2.3rc0                 pypi_0    pypi
pandas                    1.5.2            py39h4661b88_0    conda-forge
parmed                    3.4.3            py39h5a03fae_3    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
perl                      5.32.1          2_h7f98852_perl5    conda-forge
pillow                    9.2.0            py39hf3a2cdf_3    conda-forge
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
plumed                    2.8.1           nompi_hd7db5c2_100    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pymbar                    4.0.1            py39h2ae25f5_1    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
pytables                  3.7.0            py39h6a7961f_3    conda-forge
python                    3.9.13          h2660328_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2022.6             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0              py39hb9d737c_5    conda-forge
re2                       2022.06.01           h27087fc_1    conda-forge
readline                  8.1.2                h0f457ee_0    conda-forge
sander                    22.0                     pypi_0    pypi
scipy                     1.9.3            py39hddc5342_2    conda-forge
setuptools                65.5.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.9                hbd366e4_2    conda-forge
sqlite                    3.40.0               h4ff8645_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
typing_extensions         4.4.0              pyha770c72_0    conda-forge
tzdata                    2022f                h191b570_0    conda-forge
unicodedata2              15.0.0           py39hb9d737c_0    conda-forge
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxt                1.2.1                h7f98852_2    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zlib                      1.2.13               h166bdaf_4    conda-forge
zstd                      1.5.2                h6239696_4    conda-forge