openfe icon indicating copy to clipboard operation
openfe copied to clipboard

absolute hydration free energy calculation crash on methane

Open Lumber1432 opened this issue 2 months ago • 11 comments

Describe the bug Hello! I have been trying to run an absolute hydration free energy calculation for methane. While the vacuum unit of the calculation concludes successfully, the solvent unit only manages to complete the plain molecular dynamics, then after it minimizes the alchemical system and starts equilibration, it crashes.

To Reproduce I'm creating a transformation json starting from the following sdf file, where methane is mobley_9055303:

mobley_9055303
  -OEChem-01201715283D

  5  4  0     0  0  0  0  0  0999 V2000
   -0.0000   -0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.0570    1.0870   -0.0860 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.6200   -0.3970   -0.8070 H   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0040   -0.4240   -0.0700 H   0  0  0  0  0  0  0  0  0  0  0  0
    0.4420   -0.2670    0.9630 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0  0  0  0
  1  3  1  0  0  0  0
  1  4  1  0  0  0  0
  1  5  1  0  0  0  0
M  END
> <partial_charges>
-0.10869999975
0.0272000003606
0.0272000003606
0.0272000003606
0.0272000003606


> <partial_bond_orders>
1.0
1.0
1.0
1.0


> <atom_types>
c3
hc
hc
hc
hc


$$$$

The structure is read into the following script, where I generate a transformation json for each molecule present in the file:

def ahfe_simulation(input_file: str, durations) -> None:
    import pathlib

    from rdkit import Chem
    from openfe import (
        SmallMoleculeComponent,
        SolventComponent,
        ChemicalSystem,
        Transformation,
    )
    from openfe.protocols.openmm_afe import AbsoluteSolvationProtocol

    # read sdf files in for ligands
    ligands_sdf = Chem.SDMolSupplier(input_file, removeHs=False)
    ligand_mols = [SmallMoleculeComponent(sdf) for sdf in ligands_sdf]

    # solvation
    solvent = SolventComponent(positive_ion="K", negative_ion="Cl", neutralize=True)

    # protocol - set simulations times and other settings
    ahfe_settings = AbsoluteSolvationProtocol.default_settings()
    (
        ahfe_settings.solvent_simulation_settings.equilibration_length,
        ahfe_settings.solvent_simulation_settings.production_length,
        ahfe_settings.vacuum_simulation_settings.equilibration_length,
        ahfe_settings.vacuum_simulation_settings.production_length,
    ) = durations

    ahfe_settings.protocol_repeats = 1

    ahfe_settings.solvent_equil_output_settings.output_indices = "all"
    ahfe_settings.solvent_output_settings.output_indices = "all"

    ahfe_settings.solvent_engine_settings.compute_platform = "cpu"
    ahfe_settings.vacuum_engine_settings.compute_platform = "cpu"

    ahfe_protocol = AbsoluteSolvationProtocol(settings=ahfe_settings)

    transformation_dir = pathlib.Path("ahfe_json")
    transformation_dir.mkdir(exist_ok=True)

    for ligand in ligand_mols:
        # chemical systems
        system_a = ChemicalSystem(
            {"ligand": ligand, "solvent": solvent}, name=ligand.name
        )

        system_b = ChemicalSystem({"solvent": solvent})

        transformation = Transformation(
            stateA=system_a,
            stateB=system_b,
            mapping=None,
            protocol=ahfe_protocol,
            name=f"{system_a.name}",
        )

        # use openfe CLI to run simulations and gather results
        transformation.dump(transformation_dir / f"{transformation.name}.json")

if __name__ == "__main__":
    from openff.units import unit

    # ahfe simulation with default settings
    # ahfe_durations = {
    #     "solvent": {"equilibration": 1, "production": 10},
    #     "vacuum": {"equilibration": 0.5, "production": 2},
    # }
    ahfe_durations = {
        "solvent": {"equilibration": 1, "production": 10},
        "vacuum": {"equilibration": 0.1, "production": 0.1},
    }

    ahfe_durations = (
        ahfe_durations["solvent"]["equilibration"] * unit.nanosecond,
        ahfe_durations["solvent"]["production"] * unit.nanosecond,
        ahfe_durations["vacuum"]["equilibration"] * unit.nanosecond,
        ahfe_durations["vacuum"]["production"] * unit.nanosecond,
    )
    ahfe_simulation("input_molecules.sdf", ahfe_durations)

Afterwards I run the calculation with openfe quickrun, and it fails once it reaches the alchemical simulations of the solvent unit.

Software versions

  • Which operating system and version did you use? I am on NixOS 25.05
  • Which method did you use to install this package? I'm running OpenFE from the 1.7.0 Docker image
  • Copy/paste the output of conda list (or the equivalent for your package manager): This is the output of micromamba list from within the container:
List of packages in environment: "/opt/conda"

  Name                           Version       Build                              Channel    
───────────────────────────────────────────────────────────────────────────────────────────────
  _openmp_mutex                  4.5           5_kmp_llvm                         conda-forge
  _python_abi3_support           1.0           hd8ed1ab_2                         conda-forge
  adjusttext                     1.3.0         pyhd8ed1ab_0                       conda-forge
  adwaita-icon-theme             49.0          unix_0                             conda-forge
  ambertools                     24.8          cuda_None_nompi_py312hbe1986e_101  conda-forge
  annotated-types                0.7.0         pyhd8ed1ab_1                       conda-forge
  anyio                          4.11.0        pyhcf101f3_0                       conda-forge
  argon2-cffi                    25.1.0        pyhd8ed1ab_0                       conda-forge
  argon2-cffi-bindings           25.1.0        py312h4c3975b_1                    conda-forge
  arpack                         3.9.1         nompi_hf03ea27_102                 conda-forge
  arrow                          1.4.0         pyhcf101f3_0                       conda-forge
  asttokens                      3.0.0         pyhd8ed1ab_1                       conda-forge
  async-lru                      2.0.5         pyh29332c3_0                       conda-forge
  at-spi2-atk                    2.38.0        h0630a04_3                         conda-forge
  at-spi2-core                   2.40.3        h0630a04_0                         conda-forge
  atk-1.0                        2.38.0        h04ea711_2                         conda-forge
  attrs                          25.4.0        pyh71513ae_0                       conda-forge
  babel                          2.17.0        pyhd8ed1ab_0                       conda-forge
  beautifulsoup4                 4.14.2        pyha770c72_0                       conda-forge
  biopython                      1.85          py312h4c3975b_2                    conda-forge
  bleach                         6.2.0         pyh29332c3_4                       conda-forge
  bleach-with-css                6.2.0         h82add2a_4                         conda-forge
  blosc                          1.21.6        he440d0b_1                         conda-forge
  brotli                         1.1.0         hb03c661_4                         conda-forge
  brotli-bin                     1.1.0         hb03c661_4                         conda-forge
  brotli-python                  1.1.0         py312h1289d80_4                    conda-forge
  bson                           0.5.10        pyhd8ed1ab_0                       conda-forge
  bzip2                          1.0.8         hda65f42_8                         conda-forge
  c-ares                         1.34.5        hb9d3cd8_0                         conda-forge
  c-blosc2                       2.21.3        h4cfbee9_0                         conda-forge
  ca-certificates                2025.10.5     hbd8a1cb_0                         conda-forge
  cached-property                1.5.2         hd8ed1ab_1                         conda-forge
  cached_property                1.5.2         pyha770c72_1                       conda-forge
  cachetools                     6.2.1         pyhd8ed1ab_0                       conda-forge
  cairo                          1.18.4        h3394656_0                         conda-forge
  certifi                        2025.10.5     pyhd8ed1ab_0                       conda-forge
  cffi                           2.0.0         py312h35888ee_0                    conda-forge
  cftime                         1.6.4         py312h4f23490_2                    conda-forge
  charset-normalizer             3.4.4         pyhd8ed1ab_0                       conda-forge
  cinnabar                       0.5.0         pyhd8ed1ab_0                       conda-forge
  click                          8.3.0         pyh707e725_0                       conda-forge
  click-option-group             0.5.6         pyhd8ed1ab_0                       conda-forge
  colorama                       0.4.6         pyhd8ed1ab_1                       conda-forge
  comm                           0.2.3         pyhe01879c_0                       conda-forge
  contourpy                      1.3.3         py312hd9148b4_2                    conda-forge
  cpython                        3.12.12       py312hd8ed1ab_1                    conda-forge
  cudatoolkit                    11.7.0        hd8887f6_11                        conda-forge
  cycler                         0.12.1        pyhd8ed1ab_1                       conda-forge
  cyrus-sasl                     2.1.28        hd9c7081_0                         conda-forge
  dbus                           1.16.2        h3c4dab8_0                         conda-forge
  debugpy                        1.8.17        py312h8285ef7_0                    conda-forge
  decorator                      5.2.1         pyhd8ed1ab_0                       conda-forge
  defusedxml                     0.7.1         pyhd8ed1ab_0                       conda-forge
  dill                           0.4.0         pyhd8ed1ab_0                       conda-forge
  epoxy                          1.5.10        hb03c661_2                         conda-forge
  exceptiongroup                 1.3.0         pyhd8ed1ab_0                       conda-forge
  execnet                        2.1.1         pyhd8ed1ab_1                       conda-forge
  executing                      2.2.1         pyhd8ed1ab_0                       conda-forge
  fftw                           3.3.10        nompi_hf1063bd_110                 conda-forge
  filelock                       3.20.0        pyhd8ed1ab_0                       conda-forge
  flexcache                      0.3           pyhd8ed1ab_1                       conda-forge
  flexparser                     0.4           pyhd8ed1ab_1                       conda-forge
  font-ttf-dejavu-sans-mono      2.37          hab24e00_0                         conda-forge
  font-ttf-inconsolata           3.000         h77eed37_0                         conda-forge
  font-ttf-source-code-pro       2.038         h77eed37_0                         conda-forge
  font-ttf-ubuntu                0.83          h77eed37_3                         conda-forge
  fontconfig                     2.15.0        h7e30c49_1                         conda-forge
  fonts-conda-ecosystem          1             0                                  conda-forge
  fonts-conda-forge              1             0                                  conda-forge
  fonttools                      4.60.1        py312h8a5da7c_0                    conda-forge
  fqdn                           1.5.1         pyhd8ed1ab_1                       conda-forge
  freetype                       2.14.1        ha770c72_0                         conda-forge
  freetype-py                    2.3.0         pyhd8ed1ab_0                       conda-forge
  fribidi                        1.0.16        hb03c661_0                         conda-forge
  fsspec                         2025.9.0      pyhd8ed1ab_0                       conda-forge
  gdk-pixbuf                     2.44.4        h2b0a6b4_0                         conda-forge
  git                            2.51.1        pl5321h8305f47_0                   conda-forge
  glib-tools                     2.86.0        hf516916_0                         conda-forge
  gmp                            6.3.0         hac33072_2                         conda-forge
  gmpy2                          2.2.1         py312hcaba1f9_1                    conda-forge
  graphite2                      1.3.14        hecca717_2                         conda-forge
  graphviz                       13.1.2        h87b6fe6_0                         conda-forge
  greenlet                       3.2.4         py312h1289d80_1                    conda-forge
  griddataformats                1.0.2         pyhd8ed1ab_1                       conda-forge
  gsd                            4.2.0         h31e983c_0                         conda-forge
  gtk3                           3.24.43       h021d004_4                         conda-forge
  gts                            0.7.6         h977cf35_4                         conda-forge
  gufe                           1.7.0         pyhd8ed1ab_0                       conda-forge
  h11                            0.16.0        pyhd8ed1ab_0                       conda-forge
  h2                             4.3.0         pyhcf101f3_0                       conda-forge
  h5py                           3.15.1        nompi_py312ha4f8f14_100            conda-forge
  harfbuzz                       12.1.0        h15599e2_0                         conda-forge
  hdf4                           4.2.15        h2a13503_7                         conda-forge
  hdf5                           1.14.6        nompi_h6e4c0c1_103                 conda-forge
  hicolor-icon-theme             0.17          ha770c72_2                         conda-forge
  hpack                          4.1.0         pyhd8ed1ab_0                       conda-forge
  httpcore                       1.0.9         pyh29332c3_0                       conda-forge
  httpx                          0.28.1        pyhd8ed1ab_0                       conda-forge
  hyperframe                     6.1.0         pyhd8ed1ab_0                       conda-forge
  icu                            75.1          he02047a_0                         conda-forge
  idna                           3.11          pyhd8ed1ab_0                       conda-forge
  importlib-metadata             8.7.0         pyhe01879c_1                       conda-forge
  importlib_resources            6.5.2         pyhd8ed1ab_0                       conda-forge
  iniconfig                      2.3.0         pyhd8ed1ab_0                       conda-forge
  ipycytoscape                   1.3.3         pyhd8ed1ab_1                       conda-forge
  ipykernel                      7.0.1         pyha191276_0                       conda-forge
  ipython                        9.6.0         pyhfa0c392_0                       conda-forge
  ipython_pygments_lexers        1.1.1         pyhd8ed1ab_0                       conda-forge
  ipywidgets                     8.1.7         pyhd8ed1ab_0                       conda-forge
  isoduration                    20.11.0       pyhd8ed1ab_1                       conda-forge
  jax                            0.7.0         pyhd8ed1ab_0                       conda-forge
  jaxlib                         0.7.0         cpu_py312h73730d4_1                conda-forge
  jedi                           0.19.2        pyhd8ed1ab_1                       conda-forge
  jinja2                         3.1.6         pyhd8ed1ab_0                       conda-forge
  joblib                         1.5.2         pyhd8ed1ab_0                       conda-forge
  jq                             1.8.1         h73b1eb8_0                         conda-forge
  json5                          0.12.1        pyhd8ed1ab_0                       conda-forge
  jsonpointer                    3.0.0         py312h7900ff3_2                    conda-forge
  jsonschema                     4.25.1        pyhe01879c_0                       conda-forge
  jsonschema-specifications      2025.9.1      pyhcf101f3_0                       conda-forge
  jsonschema-with-format-nongpl  4.25.1        he01879c_0                         conda-forge
  jupyter-lsp                    2.3.0         pyhcf101f3_0                       conda-forge
  jupyter_client                 8.6.3         pyhd8ed1ab_1                       conda-forge
  jupyter_core                   5.9.1         pyhc90fa1f_0                       conda-forge
  jupyter_events                 0.12.0        pyh29332c3_0                       conda-forge
  jupyter_server                 2.17.0        pyhcf101f3_0                       conda-forge
  jupyter_server_terminals       0.5.3         pyhd8ed1ab_1                       conda-forge
  jupyterlab                     4.4.10        pyhd8ed1ab_0                       conda-forge
  jupyterlab_pygments            0.3.0         pyhd8ed1ab_2                       conda-forge
  jupyterlab_server              2.28.0        pyhcf101f3_0                       conda-forge
  jupyterlab_widgets             3.0.15        pyhd8ed1ab_0                       conda-forge
  kartograf                      1.2.0         pyhd8ed1ab_0                       conda-forge
  keyutils                       1.6.3         hb9d3cd8_0                         conda-forge
  kiwisolver                     1.4.9         py312h0a2e395_1                    conda-forge
  konnektor                      0.2.0         pyhe01879c_0                       conda-forge
  krb5                           1.21.3        h659f571_0                         conda-forge
  lark                           1.3.0         pyhd8ed1ab_0                       conda-forge
  lcms2                          2.17          h717163a_0                         conda-forge
  ld_impl_linux-64               2.44          ha97dd6f_2                         conda-forge
  lerc                           4.0.0         h0aef613_1                         conda-forge
  libabseil                      20250127.1    cxx17_hbbce691_0                   conda-forge
  libaec                         1.1.4         h3f801dc_0                         conda-forge
  libblas                        3.9.0         37_h5875eb1_mkl                    conda-forge
  libboost                       1.86.0        hed09d94_4                         conda-forge
  libboost-python                1.86.0        py312hf890105_4                    conda-forge
  libbrotlicommon                1.1.0         hb03c661_4                         conda-forge
  libbrotlidec                   1.1.0         hb03c661_4                         conda-forge
  libbrotlienc                   1.1.0         hb03c661_4                         conda-forge
  libcblas                       3.9.0         37_hfef963f_mkl                    conda-forge
  libcups                        2.3.3         hb8b1518_5                         conda-forge
  libcurl                        8.16.0        h4e3cde8_0                         conda-forge
  libdeflate                     1.24          h86f0d12_0                         conda-forge
  libdrm                         2.4.125       hb03c661_1                         conda-forge
  libedit                        3.1.20250104  pl5321h7949ede_0                   conda-forge
  libegl                         1.7.0         ha4b6fd6_2                         conda-forge
  libegl-devel                   1.7.0         ha4b6fd6_2                         conda-forge
  libev                          4.33          hd590300_2                         conda-forge
  libexpat                       2.7.1         hecca717_0                         conda-forge
  libffi                         3.4.6         h2dba641_1                         conda-forge
  libfreetype                    2.14.1        ha770c72_0                         conda-forge
  libfreetype6                   2.14.1        h73754d4_0                         conda-forge
  libgcc                         15.2.0        h767d61c_7                         conda-forge
  libgcc-ng                      15.2.0        h69a702a_7                         conda-forge
  libgd                          2.3.3         h6f5c62b_11                        conda-forge
  libgfortran                    15.2.0        h69a702a_7                         conda-forge
  libgfortran-ng                 15.2.0        h69a702a_7                         conda-forge
  libgfortran5                   15.2.0        hcd61629_7                         conda-forge
  libgl                          1.7.0         ha4b6fd6_2                         conda-forge
  libgl-devel                    1.7.0         ha4b6fd6_2                         conda-forge
  libglib                        2.86.0        h1fed272_0                         conda-forge
  libglvnd                       1.7.0         ha4b6fd6_2                         conda-forge
  libglx                         1.7.0         ha4b6fd6_2                         conda-forge
  libglx-devel                   1.7.0         ha4b6fd6_2                         conda-forge
  libgomp                        15.2.0        h767d61c_7                         conda-forge
  libgrpc                        1.71.0        h8e591d7_1                         conda-forge
  libhwloc                       2.12.1        default_h3d81e11_1000              conda-forge
  libiconv                       1.18          h3b78370_2                         conda-forge
  libjpeg-turbo                  3.1.0         hb9d3cd8_0                         conda-forge
  liblapack                      3.9.0         37_h5e43f62_mkl                    conda-forge
  liblzma                        5.8.1         hb9d3cd8_2                         conda-forge
  libnetcdf                      4.9.2         nompi_h21f7587_118                 conda-forge
  libnghttp2                     1.67.0        had1ee68_0                         conda-forge
  libnsl                         2.0.1         hb9d3cd8_1                         conda-forge
  libntlm                        1.8           hb9d3cd8_0                         conda-forge
  libpciaccess                   0.18          hb9d3cd8_0                         conda-forge
  libpng                         1.6.50        h421ea60_1                         conda-forge
  libpq                          18.0          h3675c94_0                         conda-forge
  libprotobuf                    5.29.3        h7460b1f_2                         conda-forge
  librdkit                       2025.09.1     h3c5c181_1                         conda-forge
  libre2-11                      2025.06.26    hba17884_0                         conda-forge
  librsvg                        2.58.4        h49af25d_2                         conda-forge
  libsodium                      1.0.20        h4ab18f5_0                         conda-forge
  libsqlite                      3.50.4        h0c1763c_0                         conda-forge
  libssh2                        1.11.1        hcf80075_0                         conda-forge
  libstdcxx                      15.2.0        h8f9b012_7                         conda-forge
  libstdcxx-ng                   15.2.0        h4852527_7                         conda-forge
  libtiff                        4.7.1         h8261f1e_0                         conda-forge
  libtorch                       2.6.0         cpu_mkl_hec71012_102               conda-forge
  libuuid                        2.41.2        he9a06e4_0                         conda-forge
  libuv                          1.51.0        hb03c661_1                         conda-forge
  libwebp-base                   1.6.0         hd42ef1d_0                         conda-forge
  libxcb                         1.17.0        h8a09558_0                         conda-forge
  libxcrypt                      4.4.36        hd590300_1                         conda-forge
  libxkbcommon                   1.11.0        he8b52b9_0                         conda-forge
  libxml2                        2.13.8        h04c0eec_1                         conda-forge
  libxslt                        1.1.43        h7a3aeb2_0                         conda-forge
  libzip                         1.11.2        h6991a6a_0                         conda-forge
  libzlib                        1.3.1         hb9d3cd8_2                         conda-forge
  lightning-utilities            0.15.2        pyhd8ed1ab_0                       conda-forge
  llvm-openmp                    21.1.4        h4922eb0_0                         conda-forge
  llvmlite                       0.45.1        py312h7424e68_0                    conda-forge
  lomap2                         3.2.1         pyhd8ed1ab_3                       conda-forge
  lxml                           6.0.2         py312h70dad80_0                    conda-forge
  lz4-c                          1.10.0        h5888daf_1                         conda-forge
  markdown-it-py                 4.0.0         pyhd8ed1ab_0                       conda-forge
  markupsafe                     3.0.3         py312h8a5da7c_0                    conda-forge
  matplotlib-base                3.10.7        py312he3d6523_0                    conda-forge
  matplotlib-inline              0.2.1         pyhd8ed1ab_0                       conda-forge
  mda-xdrlib                     0.2.0         pyhd8ed1ab_1                       conda-forge
  mdanalysis                     2.10.0        py312hf79963d_1                    conda-forge
  mdtraj                         1.11.0        np2py312h8baca0b_3                 conda-forge
  mdurl                          0.1.2         pyhd8ed1ab_1                       conda-forge
  mistune                        3.1.4         pyhcf101f3_0                       conda-forge
  mkl                            2024.2.2      ha770c72_17                        conda-forge
  ml_dtypes                      0.5.1         py312hf79963d_1                    conda-forge
  mmtf-python                    1.1.3         pyhd8ed1ab_0                       conda-forge
  mpc                            1.3.1         h24ddda3_1                         conda-forge
  mpfr                           4.2.1         h90cbb55_3                         conda-forge
  mpiplus                        v0.0.2        pyhd8ed1ab_0                       conda-forge
  mpmath                         1.3.0         pyhd8ed1ab_1                       conda-forge
  mrcfile                        1.5.4         pyhd8ed1ab_0                       conda-forge
  msgpack-python                 1.1.2         py312hd9148b4_0                    conda-forge
  munkres                        1.1.4         pyhd8ed1ab_1                       conda-forge
  narwhals                       2.9.0         pyhcf101f3_0                       conda-forge
  nbclient                       0.10.2        pyhd8ed1ab_0                       conda-forge
  nbconvert-core                 7.16.6        pyhcf101f3_1                       conda-forge
  nbformat                       5.10.4        pyhd8ed1ab_1                       conda-forge
  ncurses                        6.5           h2d0b736_3                         conda-forge
  nest-asyncio                   1.6.0         pyhd8ed1ab_1                       conda-forge
  netcdf-fortran                 4.6.2         nompi_h5aa5643_101                 conda-forge
  netcdf4                        1.7.2         nompi_py312hdd76c12_103            conda-forge
  networkx                       3.5           pyhe01879c_0                       conda-forge
  notebook                       7.4.7         pyhd8ed1ab_0                       conda-forge
  notebook-shim                  0.2.4         pyhd8ed1ab_1                       conda-forge
  numba                          0.62.1        py312h907b442_0                    conda-forge
  numexpr                        2.14.1        mkl_py312hf8315b2_0                conda-forge
  numpy                          1.26.4        py312heda63a1_0                    conda-forge
  ocl-icd                        2.3.3         hb9d3cd8_0                         conda-forge
  ocl-icd-system                 1.0.0         1                                  conda-forge
  oniguruma                      6.9.10        hb9d3cd8_0                         conda-forge
  opencl-headers                 2025.06.13    h5888daf_0                         conda-forge
  openfe                         1.7.0         pyhd8ed1ab_0                       conda-forge
  openfe-analysis                0.3.1         pyhd8ed1ab_0                       conda-forge
  openfe-base                    1.7.0         pyhd8ed1ab_0                       conda-forge
  openff-amber-ff-ports          2025.09.0     pyhd8ed1ab_0                       conda-forge
  openff-forcefields             2025.10.1     pyhd8ed1ab_0                       conda-forge
  openff-interchange             0.4.8         pyhd8ed1ab_1                       conda-forge
  openff-interchange-base        0.4.8         pyhd8ed1ab_1                       conda-forge
  openff-nagl                    0.5.4         pyhd8ed1ab_0                       conda-forge
  openff-nagl-base               0.5.4         pyhd8ed1ab_0                       conda-forge
  openff-nagl-models             2025.9.0      pyhd8ed1ab_0                       conda-forge
  openff-toolkit                 0.17.1        pyhd8ed1ab_0                       conda-forge
  openff-toolkit-base            0.17.1        pyhd8ed1ab_0                       conda-forge
  openff-units                   0.3.1         pyhd8ed1ab_2                       conda-forge
  openff-utilities               0.1.16        pyhd8ed1ab_0                       conda-forge
  openjpeg                       2.5.4         h55fea9a_0                         conda-forge
  openldap                       2.6.10        he970967_0                         conda-forge
  openmm                         8.1.1         py312hce710af_1                    conda-forge
  openmmforcefields              0.14.2        pyhd8ed1ab_0                       conda-forge
  openmmtools                    0.25.3        pyhd8ed1ab_0                       conda-forge
  openssl                        3.5.4         h26f9b46_0                         conda-forge
  opt_einsum                     3.4.0         pyhd8ed1ab_1                       conda-forge
  optree                         0.17.0        py312hd9148b4_1                    conda-forge
  overrides                      7.7.0         pyhd8ed1ab_1                       conda-forge
  packaging                      25.0          pyh29332c3_1                       conda-forge
  pandas                         2.3.3         py312hf79963d_1                    conda-forge
  pandocfilters                  1.5.0         pyhd8ed1ab_0                       conda-forge
  pango                          1.56.4        hadf4263_0                         conda-forge
  parmed                         4.3.0         py312ha9124a0_2                    conda-forge
  parso                          0.8.5         pyhcf101f3_0                       conda-forge
  patsy                          1.0.2         pyhcf101f3_0                       conda-forge
  pcre2                          10.46         h1321c63_0                         conda-forge
  pdbfixer                       1.9           pyh1a96a4e_0                       conda-forge
  perl                           5.32.1        7_hd590300_perl5                   conda-forge
  pexpect                        4.9.0         pyhd8ed1ab_1                       conda-forge
  pickleshare                    0.7.5         pyhd8ed1ab_1004                    conda-forge
  pillow                         11.3.0        py312h7b42cdd_3                    conda-forge
  pint                           0.24.4        pyhe01879c_2                       conda-forge
  pip                            25.2          pyh8b19718_0                       conda-forge
  pixman                         0.46.4        h54a6638_1                         conda-forge
  platformdirs                   4.5.0         pyhcf101f3_0                       conda-forge
  plotly                         6.3.1         pyhd8ed1ab_0                       conda-forge
  plugcli                        0.2.1         pyhd8ed1ab_0                       conda-forge
  pluggy                         1.6.0         pyhd8ed1ab_0                       conda-forge
  pooch                          1.8.2         pyhd8ed1ab_3                       conda-forge
  prometheus_client              0.23.1        pyhd8ed1ab_0                       conda-forge
  prompt-toolkit                 3.0.52        pyha770c72_0                       conda-forge
  psutil                         7.1.1         py312h4c3975b_0                    conda-forge
  pthread-stubs                  0.4           hb9d3cd8_1002                      conda-forge
  ptyprocess                     0.7.0         pyhd8ed1ab_1                       conda-forge
  pure_eval                      0.2.3         pyhd8ed1ab_1                       conda-forge
  py-cpuinfo                     9.0.0         pyhd8ed1ab_1                       conda-forge
  py3dmol                        2.5.3         pyhd8ed1ab_0                       conda-forge
  pybind11                       3.0.1         pyh7a1b43c_0                       conda-forge
  pybind11-global                3.0.1         pyhc7ab6ef_0                       conda-forge
  pycairo                        1.28.0        py312h2596900_1                    conda-forge
  pycparser                      2.22          pyh29332c3_1                       conda-forge
  pydantic                       2.11.10       pyh3cfb1c2_0                       conda-forge
  pydantic-core                  2.33.2        py312h680f630_0                    conda-forge
  pyedr                          0.8.0         pyhd8ed1ab_1                       conda-forge
  pygments                       2.19.2        pyhd8ed1ab_0                       conda-forge
  pygraphviz                     1.14          py312hdfa1987_2                    conda-forge
  pymbar                         4.2.0         h7900ff3_1                         conda-forge
  pymbar-core                    4.2.0         py312h4f23490_1                    conda-forge
  pyparsing                      3.2.5         pyhcf101f3_0                       conda-forge
  pysocks                        1.7.1         pyha55dd90_7                       conda-forge
  pytables                       3.10.2        py312hefc0c3f_9                    conda-forge
  pytest                         8.4.2         pyhd8ed1ab_0                       conda-forge
  pytest-datadir                 1.8.0         pyhd8ed1ab_0                       conda-forge
  pytest-regressions             2.8.3         pyhc455866_0                       conda-forge
  pytest-xdist                   3.8.0         pyhd8ed1ab_0                       conda-forge
  python                         3.12.12       hfe2f287_0_cpython                 conda-forge
  python-constraint              1.4.0         pyhff2d567_1                       conda-forge
  python-dateutil                2.9.0.post0   pyhe01879c_2                       conda-forge
  python-fastjsonschema          2.21.2        pyhe01879c_0                       conda-forge
  python-gil                     3.12.12       hd8ed1ab_1                         conda-forge
  python-json-logger             2.0.7         pyhd8ed1ab_0                       conda-forge
  python-tzdata                  2025.2        pyhd8ed1ab_0                       conda-forge
  python_abi                     3.12          8_cp312                            conda-forge
  pytng                          0.3.4         py312heed6b8f_0                    conda-forge
  pytorch                        2.6.0         cpu_mkl_py312_he110f90_102         conda-forge
  pytorch-lightning              2.5.5         pyh2a12c56_0                       conda-forge
  pytz                           2025.2        pyhd8ed1ab_0                       conda-forge
  pyyaml                         6.0.3         py312h8a5da7c_0                    conda-forge
  pyzmq                          27.1.0        py312hfb55c3c_0                    conda-forge
  qhull                          2020.2        h434a139_5                         conda-forge
  rdkit                          2025.09.1     py312h3ecb6ed_1                    conda-forge
  re2                            2025.06.26    h9925aae_0                         conda-forge
  readline                       8.2           h8c095d6_2                         conda-forge
  referencing                    0.37.0        pyhcf101f3_0                       conda-forge
  reportlab                      4.4.4         py312h4c3975b_0                    conda-forge
  requests                       2.32.5        pyhd8ed1ab_0                       conda-forge
  rfc3339-validator              0.1.4         pyhd8ed1ab_1                       conda-forge
  rfc3986-validator              0.1.1         pyh9f0ad1d_0                       conda-forge
  rfc3987-syntax                 1.1.0         pyhe01879c_1                       conda-forge
  rich                           14.2.0        pyhcf101f3_0                       conda-forge
  rlpycairo                      0.4.0         pyh6c17108_0                       conda-forge
  rpds-py                        0.28.0        py312h868fb18_1                    conda-forge
  scikit-learn                   1.7.2         py312h4f0b9e3_0                    conda-forge
  scikit-mol                     0.6.1         pyhd8ed1ab_0                       conda-forge
  scipy                          1.16.2        py312h7a1785b_0                    conda-forge
  seaborn                        0.13.2        hd8ed1ab_3                         conda-forge
  seaborn-base                   0.13.2        pyhd8ed1ab_3                       conda-forge
  send2trash                     1.8.3         pyh0d859eb_1                       conda-forge
  setuptools                     80.9.0        pyhff2d567_0                       conda-forge
  six                            1.17.0        pyhe01879c_1                       conda-forge
  sleef                          3.9.0         ha0421bc_0                         conda-forge
  snappy                         1.2.2         h03e3b7b_0                         conda-forge
  sniffio                        1.3.1         pyhd8ed1ab_1                       conda-forge
  soupsieve                      2.8           pyhd8ed1ab_0                       conda-forge
  spectate                       1.0.1         pyhd8ed1ab_0                       conda-forge
  sqlalchemy                     2.0.44        py312h4c3975b_0                    conda-forge
  stack_data                     0.6.3         pyhd8ed1ab_1                       conda-forge
  statsmodels                    0.14.5        py312h4f23490_1                    conda-forge
  sympy                          1.14.0        pyh2585a3b_105                     conda-forge
  tbb                            2021.13.0     hb60516a_3                         conda-forge
  terminado                      0.18.1        pyh0d859eb_0                       conda-forge
  threadpoolctl                  3.6.0         pyhecae5ae_0                       conda-forge
  tidynamics                     1.1.2         pyhd8ed1ab_0                       conda-forge
  tinycss2                       1.4.0         pyhd8ed1ab_0                       conda-forge
  tinydb                         4.8.2         pyhd8ed1ab_1                       conda-forge
  tk                             8.6.13        noxft_hd72426e_102                 conda-forge
  tomli                          2.3.0         pyhcf101f3_0                       conda-forge
  torchmetrics                   1.8.2         pyhd8ed1ab_0                       conda-forge
  tornado                        6.5.2         py312h4c3975b_1                    conda-forge
  tqdm                           4.67.1        pyhd8ed1ab_1                       conda-forge
  traitlets                      5.14.3        pyhd8ed1ab_1                       conda-forge
  typing-extensions              4.15.0        h396c80c_0                         conda-forge
  typing-inspection              0.4.2         pyhd8ed1ab_0                       conda-forge
  typing_extensions              4.15.0        pyhcf101f3_0                       conda-forge
  typing_utils                   0.1.0         pyhd8ed1ab_1                       conda-forge
  tzdata                         2025b         h78e105d_0                         conda-forge
  unicodedata2                   16.0.0        py312h4c3975b_1                    conda-forge
  uri-template                   1.3.0         pyhd8ed1ab_1                       conda-forge
  urllib3                        2.5.0         pyhd8ed1ab_0                       conda-forge
  validators                     0.35.0        pyhd8ed1ab_0                       conda-forge
  wayland                        1.24.0        h3e06ad9_0                         conda-forge
  wcwidth                        0.2.14        pyhd8ed1ab_0                       conda-forge
  webcolors                      24.11.1       pyhd8ed1ab_0                       conda-forge
  webencodings                   0.5.1         pyhd8ed1ab_3                       conda-forge
  websocket-client               1.9.0         pyhd8ed1ab_0                       conda-forge
  wheel                          0.45.1        pyhd8ed1ab_1                       conda-forge
  widgetsnbextension             4.0.14        pyhd8ed1ab_0                       conda-forge
  xkeyboard-config               2.46          hb03c661_0                         conda-forge
  xmltodict                      1.0.2         pyhcf101f3_0                       conda-forge
  xorg-libice                    1.1.2         hb9d3cd8_0                         conda-forge
  xorg-libsm                     1.2.6         he73a12e_0                         conda-forge
  xorg-libx11                    1.8.12        h4f16b4b_0                         conda-forge
  xorg-libxau                    1.0.12        hb9d3cd8_0                         conda-forge
  xorg-libxcomposite             0.4.6         hb9d3cd8_2                         conda-forge
  xorg-libxcursor                1.2.3         hb9d3cd8_0                         conda-forge
  xorg-libxdamage                1.1.6         hb9d3cd8_0                         conda-forge
  xorg-libxdmcp                  1.1.5         hb9d3cd8_0                         conda-forge
  xorg-libxext                   1.3.6         hb9d3cd8_0                         conda-forge
  xorg-libxfixes                 6.0.2         hb03c661_0                         conda-forge
  xorg-libxi                     1.8.2         hb9d3cd8_0                         conda-forge
  xorg-libxinerama               1.1.5         h5888daf_1                         conda-forge
  xorg-libxrandr                 1.5.4         hb9d3cd8_0                         conda-forge
  xorg-libxrender                0.9.12        hb9d3cd8_0                         conda-forge
  xorg-libxt                     1.3.1         hb9d3cd8_0                         conda-forge
  xorg-libxtst                   1.2.5         hb9d3cd8_3                         conda-forge
  xorg-libxxf86vm                1.1.6         hb9d3cd8_0                         conda-forge
  xorg-xorgproto                 2024.1        hb9d3cd8_1                         conda-forge
  yaml                           0.2.5         h280c20c_3                         conda-forge
  zeromq                         4.3.5         h387f397_9                         conda-forge
  zipp                           3.23.0        pyhd8ed1ab_0                       conda-forge
  zlib                           1.3.1         hb9d3cd8_2                         conda-forge
  zlib-ng                        2.2.5         hde8ca8f_0                         conda-forge
  zstandard                      0.25.0        py312h5253ce2_0                    conda-forge
  zstd                           1.5.7         hb8e6e7a_2                         conda-forge

Output

INFO:openmmtools.multistate.multistatesampler:Equilibration iteration 1/400
WARNING:py.warnings:/opt/conda/lib/python3.12/site-packages/openmmtools/mcmc.py:723: UserWarning: Particle coordinate is NaN.  For more information, see https://github.com/openmm/openmm/wiki/Frequently-Asked-Questions#nan
  warnings.warn(str(e))

WARNING:openmmtools.mcmc:Potential energy is NaN after 0 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 1 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 2 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 3 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 4 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 5 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 6 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 7 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 8 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 9 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 10 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 11 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 12 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 13 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 14 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 15 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 16 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 17 attempts of integration with move LangevinDynamicsMove Attempting a restart...
WARNING:openmmtools.mcmc:Potential energy is NaN after 18 attempts of integration with move LangevinDynamicsMove Attempting a restart...
ERROR:openmmtools.mcmc:Potential energy is NaN after 19 attempts of integration with move LangevinDynamicsMove Trying to reinitialize Context as a last-resort restart attempt...
ERROR:openmmtools.mcmc:Potential energy is NaN after 20 attempts of integration with move LangevinDynamicsMove
CRITICAL:openmmtools.multistate.multistatesampler:Propagating replica 0 at state 0 resulted in a NaN!
The state of the system and integrator before the error were saved in /home/openfe/openfe_issue/ahfe_json/shared_AbsoluteSolvationSolventUnit-cbd14d92394746debeae61fa9808d276_attempt_2/nan-error-logs

Expected behavior I expected the simulation to conclude successfully.

Additional context I've tried running the simulation with different methane input files to no avail. I've also tested the 1.5.0 Docker image. When I print the last saved state to PDB with OpenMM there does not seem to be anything out of place. Running this on the HPC system that will run the calculations for multiple molecules, the same error occurs. I am wilfully running the calculation on CPU because that is what will be available on the node. I have made multiple attempts, but the solvent leg always fails.

Thank you in advance for your help!

Lumber1432 avatar Nov 11 '25 14:11 Lumber1432

Thanks for the report @Lumber1432

I think I've seen a similar problem lately but I'm only now realising it's maybe a real bug.

Could you try running using only a few CPU cores? Try something like export OPENMM_CPU_THREADS=2.

IAlibay avatar Nov 11 '25 15:11 IAlibay

Hello @IAlibay, thank you for your prompt response. I have tried running the simulation within a container with OPENMM_CPU_THREADS=2 set, but it still crashed with the same error.

I am not sure if this is relevant, but since you mentioned modifying the core count I thought I would mention; when running this simulation on the compute node of the HPC system, I get some strange behavior. No matter how I try to get the process to use all cores available on the node, the process only ever uses a few (2, maybe 3 cores) to run the simulation. The only way I have been able to circumvent this has been by creating the SolvenUnit manually and running it separately. The process then uses all cores available. I have not tested, but assume the same would happen with the VacuumUnit. I was wondering if this is intended behavior.

Thank you again and let me know if there is anything else I can do.

Lumber1432 avatar Nov 12 '25 09:11 Lumber1432

I am not sure if this is relevant, but since you mentioned modifying the core count I thought I would mention; when running this simulation on the compute node of the HPC system, I get some strange behavior. No matter how I try to get the process to use all cores available on the node, the process only ever uses a few (2, maybe 3 cores) to run the simulation. The only way I have been able to circumvent this has been by creating the SolvenUnit manually and running it separately. The process then uses all cores available. I have not tested, but assume the same would happen with the VacuumUnit. I was wondering if this is intended behavior.

Ah thanks so much for reporting this, I just looked into the code and this is a separate (but equally legitimate) bug! I'll open a separate issue.

IAlibay avatar Nov 14 '25 14:11 IAlibay

Regarding the methane simulation failure you present, that is rather interesting. I'll try to replicate it on my end.

IAlibay avatar Nov 14 '25 14:11 IAlibay

@Lumber1432 I have been able to reproduce this locally - it looks like for > 1 CPU threads, the system crashes (it works fine on GPUs).

I'm not sure exactly what's going on here, I wonder if it's because the system is too small to decompose in a sensible way. By any chance, have you seen similar issues with larger ligands?

IAlibay avatar Nov 17 '25 19:11 IAlibay

@IAlibay I tried to run the same simulation for toluene once to test whether that system would crash too, and it did. However, I did not test that molecule as extensively as I did methane. I haven't tried anything larger.

Lumber1432 avatar Nov 18 '25 10:11 Lumber1432

@IAlibay I am facing same issue lately when processing a ternary complex. I am wondering if this issue is specific to the simulation setup or when would this issue be triggered?

ziyueyang37 avatar Nov 18 '25 13:11 ziyueyang37

@ziyueyang37 - this should only be happening during simulation execution, rather than setup. Could you provide more information about what failure you are seeing?

IAlibay avatar Nov 18 '25 15:11 IAlibay

@IAlibay, thanks for replying. This is the error message in the output json file for 'complex' system : raise SimulationNaNError(message)\nopenmmtools.multistate.utils.SimulationNaNError: Propagating replica 0 at state 0 resulted in a NaN!\nThe state of the system and integrator before the error were saved in ****

The 'solvent' system did not raise error.

ziyueyang37 avatar Nov 18 '25 18:11 ziyueyang37

Thanks for the info @ziyueyang37 ! That does look like you're also getting a failure at simulation run time. Although since you're saying you are getting an issue with the complex (I assume this is an RBFE simulation?), I wonder if that might be a separate problem, e.g. bad initial configuration. Could you maybe open a separate issue with more details?

IAlibay avatar Nov 20 '25 19:11 IAlibay

Regarding the CPU simulation failure for AHFEs, I can't seem to be able to reproduce them with RHFEs or plain MD. I'm not sure exactly what is happening there. We are going to keep looking at it, but I'm afraid it might take a while to understand what is happening.

IAlibay avatar Nov 20 '25 19:11 IAlibay