openforcefield / openff-toolkit

The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
http://openforcefield.org
MIT License
311 stars 90 forks source link

The toolkit showcase stochastically fails with OMP_NUM_THREADS=1 and AmberToolsToolkitWrapper #1842

Closed Yoshanuikabundi closed 5 months ago

Yoshanuikabundi commented 6 months ago

Describe the bug Assigning charges with AmberTools can fail when OMP_NUM_THREADS is set to 1 (but not other values or when it is unset). This only happens for some inputs - for instance, simply changing the atom indexing for the test molecule can fix the issue.

I found this trying to fix the OpenFF Docs cookbook - see https://github.com/openforcefield/openff-docs/actions/runs/8342106212/job/22829552667#step:7:249

To Reproduce

from openff.toolkit import Molecule

# %env OMP_NUM_THREADS=2
%env OMP_NUM_THREADS=1

mol1 = Molecule.from_smiles('[H][O][C@@]1([H])[c]2[c]([c]([O][c]3[c]([H])[c]([F])[c]([H])[c]([C]#[N])[c]3[H])[c]([H])[c]([H])[c]2[S](=[O])(=[O])[C]([H])([H])[H])[C]([H])([H])[C]1([F])[F]')
# mol1 = Molecule.from_smiles('CS(=O)(=O)c1ccc(Oc2cc(F)cc(C#N)c2)c2c1[C@H](O)C(F)(F)C2')
mol2 = Molecule.from_mapped_smiles('[O:1]([C@:2]1([H:28])[C:3]([F:24])([F:25])[C:4]([H:29])([H:30])[c:5]2[c:6]1[c:7]([S:20](=[O:21])(=[O:22])[C:23]([H:36])([H:37])[H:38])[c:8]([H:31])[c:9]([H:32])[c:10]2[O:11][c:12]1[c:13]([H:33])[c:14]([F:15])[c:16]([H:34])[c:17]([C:18]#[N:26])[c:19]1[H:35])[H:27]')

assert mol1 == mol2

mol1.assign_partial_charges('am1bcc')
mol2.assign_partial_charges('am1bcc')

mol2.partial_charges

Output

Output for the above code is:

[/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/bin/wrapped_progs/antechamber](http://localhost:8888/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/bin/wrapped_progs/antechamber): Fatal Error!
Cannot properly run "[/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/bin/sqm](http://localhost:8888/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/bin/sqm) -O -i sqm.in -o sqm.out".

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 13
     10 assert mol1 == mol2
     12 mol1.assign_partial_charges('am1bcc')
---> 13 mol2.assign_partial_charges('am1bcc')
     15 mol2.partial_charges

File [~/Documents/openff/openff-docs/.soap/examples/lib/python3.10/site-packages/openff/toolkit/topology/molecule.py:2629](http://localhost:8888/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/lib/python3.10/site-packages/openff/toolkit/topology/molecule.py#line=2628), in FrozenMolecule.assign_partial_charges(self, partial_charge_method, strict_n_conformers, use_conformers, toolkit_registry, normalize_partial_charges)
   2615         warnings.warn(
   2616             f"Warning! Partial charge method '{partial_charge_method}' is not designed "
   2617             "for use on large (i.e. > 150 atoms) molecules and may crash or take hours to "
   (...)
   2621             stacklevel=2,
   2622         )
   2624 if isinstance(toolkit_registry, ToolkitRegistry):
   2625     # We may need to try several toolkitwrappers to find one
   2626     # that supports the desired partial charge method, so we
   2627     # tell the ToolkitRegistry to continue trying ToolkitWrappers
   2628     # if one raises an error (raise_exception_types=[])
-> 2629     toolkit_registry.call(
   2630         "assign_partial_charges",
   2631         molecule=self,
   2632         partial_charge_method=partial_charge_method,
   2633         use_conformers=use_conformers,
   2634         strict_n_conformers=strict_n_conformers,
   2635         normalize_partial_charges=normalize_partial_charges,
   2636         raise_exception_types=[],
   2637         _cls=self.__class__,
   2638     )
   2639 elif isinstance(toolkit_registry, ToolkitWrapper):
   2640     toolkit_wrapper: ToolkitWrapper = toolkit_registry

File [~/Documents/openff/openff-docs/.soap/examples/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py:370](http://localhost:8888/home/joshmitchell/Documents/openff/openff-docs/.soap/examples/lib/python3.10/site-packages/openff/toolkit/utils/toolkit_registry.py#line=369), in ToolkitRegistry.call(self, method_name, raise_exception_types, *args, **kwargs)
    368 for toolkit, error in errors:
    369     msg += " {} {} : {}\n".format(toolkit, type(error), error)
--> 370 raise ValueError(msg)

ValueError: No registered toolkits can provide the capability "assign_partial_charges" for args "()" and kwargs "{'molecule': Molecule with name '' and SMILES '[H][O][C@@]1([H])[c]2[c]([c]([O][c]3[c]([H])[c]([F])[c]([H])[c]([C]#[N])[c]3[H])[c]([H])[c]([H])[c]2[S](=[O])(=[O])[C]([H])([H])[H])[C]([H])([H])[C]1([F])[F]', 'partial_charge_method': 'am1bcc', 'use_conformers': None, 'strict_n_conformers': False, 'normalize_partial_charges': True, '_cls': <class 'openff.toolkit.topology.molecule.Molecule'>}"
Available toolkits are: [ToolkitWrapper around The RDKit version 2023.03.3, ToolkitWrapper around AmberTools version 22.0, ToolkitWrapper around Built-in Toolkit version None]
 ToolkitWrapper around The RDKit version 2023.03.3 <class 'openff.toolkit.utils.exceptions.ChargeMethodUnavailableError'> : partial_charge_method 'am1bcc' is not available from RDKitToolkitWrapper. Available charge methods are ['mmff94', 'gasteiger'] 
 ToolkitWrapper around AmberTools version 22.0 <class 'subprocess.CalledProcessError'> : Command '['antechamber', '-i', 'molecule.sdf', '-fi', 'sdf', '-o', 'charged.mol2', '-fo', 'mol2', '-pf', 'yes', '-dr', 'n', '-c', 'bcc', '-nc', '0.0']' returned non-zero exit status 1.
 ToolkitWrapper around Built-in Toolkit version None <class 'openff.toolkit.utils.exceptions.ChargeMethodUnavailableError'> : Partial charge method "am1bcc"" is not supported by the Built-in toolkit. Available charge methods are ['zeros', 'formal_charge']

See also https://github.com/openforcefield/openff-docs/actions/runs/8342106212/job/22829552667#step:7:249

Computing environment (please complete the following information):

Output of running `conda list`
List of packages in environment: "/home/joshmitchell/Documents/openff/openff-docs/.soap/examples"

  Name                           Version         Build                           Channel    
──────────────────────────────────────────────────────────────────────────────────────────────
  _libgcc_mutex                  0.1             conda_forge                     conda-forge
  _openmp_mutex                  4.5             2_gnu                           conda-forge
  absl-py                        2.1.0           pyhd8ed1ab_0                    conda-forge
  aiohttp                        3.9.3           py310h2372a71_1                 conda-forge
  aiosignal                      1.3.1           pyhd8ed1ab_0                    conda-forge
  ambertools                     22.5            py310hd182041_0                 conda-forge
  annotated-types                0.6.0           pyhd8ed1ab_0                    conda-forge
  anyio                          4.3.0           pyhd8ed1ab_0                    conda-forge
  argon2-cffi                    23.1.0          pyhd8ed1ab_0                    conda-forge
  argon2-cffi-bindings           21.2.0          py310h2372a71_4                 conda-forge
  arpack                         3.7.0           hdefa2d7_2                      conda-forge
  arrow                          1.3.0           pyhd8ed1ab_0                    conda-forge
  ase                            3.22.1          pyhd8ed1ab_1                    conda-forge
  asttokens                      2.4.1           pyhd8ed1ab_0                    conda-forge
  astunparse                     1.6.3           pyhd8ed1ab_0                    conda-forge
  async-lru                      2.0.4           pyhd8ed1ab_0                    conda-forge
  async-timeout                  4.0.3           pyhd8ed1ab_0                    conda-forge
  attrs                          23.2.0          pyh71513ae_0                    conda-forge
  aws-c-auth                     0.7.11          h0b4cabd_1                      conda-forge
  aws-c-cal                      0.6.9           h14ec70c_3                      conda-forge
  aws-c-common                   0.9.12          hd590300_0                      conda-forge
  aws-c-compression              0.2.17          h572eabf_8                      conda-forge
  aws-c-event-stream             0.4.1           h97bb272_2                      conda-forge
  aws-c-http                     0.8.0           h9129f04_2                      conda-forge
  aws-c-io                       0.14.0          hf8f278a_1                      conda-forge
  aws-c-mqtt                     0.10.1          h2b97f5f_0                      conda-forge
  aws-c-s3                       0.4.9           hca09fc5_0                      conda-forge
  aws-c-sdkutils                 0.1.13          h572eabf_1                      conda-forge
  aws-checksums                  0.1.17          h572eabf_7                      conda-forge
  aws-crt-cpp                    0.26.0          h04327c0_8                      conda-forge
  aws-sdk-cpp                    1.11.210        hba3e011_10                     conda-forge
  babel                          2.14.0          pyhd8ed1ab_0                    conda-forge
  beautifulsoup4                 4.12.3          pyha770c72_0                    conda-forge
  binutils_impl_linux-64         2.40            hf600244_0                      conda-forge
  binutils_linux-64              2.40            hdade7a5_3                      conda-forge
  bleach                         6.1.0           pyhd8ed1ab_0                    conda-forge
  blinker                        1.7.0           pyhd8ed1ab_0                    conda-forge
  blosc                          1.21.5          h0f2a231_0                      conda-forge
  boost                          1.78.0          py310hcb52e73_5                 conda-forge
  boost-cpp                      1.78.0          h2c5509c_4                      conda-forge
  brotli                         1.1.0           hd590300_1                      conda-forge
  brotli-bin                     1.1.0           hd590300_1                      conda-forge
  brotli-python                  1.1.0           py310hc6cd4ac_1                 conda-forge
  bson                           0.5.9           py_0                            conda-forge
  bzip2                          1.0.8           hd590300_5                      conda-forge
  c-ares                         1.27.0          hd590300_0                      conda-forge
  c-blosc2                       2.13.2          hb4ffafa_0                      conda-forge
  ca-certificates                2024.2.2        hbcca054_0                      conda-forge
  cached-property                1.5.2           hd8ed1ab_1                      conda-forge
  cached_property                1.5.2           pyha770c72_1                    conda-forge
  cachetools                     5.3.3           pyhd8ed1ab_0                    conda-forge
  cairo                          1.18.0          h3faef2a_0                      conda-forge
  certifi                        2024.2.2        pyhd8ed1ab_0                    conda-forge
  cffi                           1.16.0          py310h2fee648_0                 conda-forge
  chardet                        5.2.0           py310hff52083_1                 conda-forge
  charset-normalizer             3.3.2           pyhd8ed1ab_0                    conda-forge
  click                          8.1.7           unix_pyh707e725_0               conda-forge
  click-option-group             0.5.6           pyhd8ed1ab_0                    conda-forge
  cloudpickle                    3.0.0           pyhd8ed1ab_0                    conda-forge
  cmake                          3.28.3          hcfe8598_0                      conda-forge
  colorama                       0.4.6           pyhd8ed1ab_0                    conda-forge
  comm                           0.2.2           pyhd8ed1ab_0                    conda-forge
  contourpy                      1.2.0           py310hd41b1e2_0                 conda-forge
  cryptography                   42.0.5          py310h75e40e8_0                 conda-forge
  cudatoolkit                    11.8.0          h4ba93d1_13                     conda-forge
  cycler                         0.12.1          pyhd8ed1ab_0                    conda-forge
  cython                         3.0.9           py310hc6cd4ac_0                 conda-forge
  cytoolz                        0.12.3          py310h2372a71_0                 conda-forge
  dask-core                      2024.3.1        pyhd8ed1ab_0                    conda-forge
  dask-jobqueue                  0.8.5           pyhd8ed1ab_0                    conda-forge
  debugpy                        1.8.1           py310hc6cd4ac_0                 conda-forge
  decorator                      5.1.1           pyhd8ed1ab_0                    conda-forge
  defusedxml                     0.7.1           pyhd8ed1ab_0                    conda-forge
  dgl                            2.0.0           py310hf4f05e9_0                 conda-forge
  distributed                    2024.3.1        pyhd8ed1ab_0                    conda-forge
  entrypoints                    0.4             pyhd8ed1ab_0                    conda-forge
  exceptiongroup                 1.2.0           pyhd8ed1ab_2                    conda-forge
  executing                      2.0.1           pyhd8ed1ab_0                    conda-forge
  expat                          2.6.2           h59595ed_0                      conda-forge
  f90wrap                        0.2.13          py310h03ae0af_2                 conda-forge
  fftw                           3.3.10          mpi_mpich_h5537406_8            conda-forge
  filelock                       3.13.1          pyhd8ed1ab_0                    conda-forge
  flask                          3.0.2           pyhd8ed1ab_0                    conda-forge
  flatbuffers                    23.5.26         h59595ed_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_1                      conda-forge
  fontconfig                     2.14.2          h14ed4e7_0                      conda-forge
  fonts-conda-ecosystem          1               0                               conda-forge
  fonts-conda-forge              1               0                               conda-forge
  fonttools                      4.49.0          py310h2372a71_0                 conda-forge
  fqdn                           1.5.1           pyhd8ed1ab_0                    conda-forge
  freetype                       2.12.1          h267a509_2                      conda-forge
  freetype-py                    2.3.0           pyhd8ed1ab_0                    conda-forge
  frozenlist                     1.4.1           py310h2372a71_0                 conda-forge
  fsspec                         2024.3.1        pyhca7485f_0                    conda-forge
  gast                           0.5.4           pyhd8ed1ab_0                    conda-forge
  gawk                           5.3.0           ha916aea_0                      conda-forge
  gcc_impl_linux-64              11.4.0          h7aa1c59_5                      conda-forge
  gcc_linux-64                   11.4.0          h0f0c6b6_3                      conda-forge
  gettext                        0.21.1          h27087fc_0                      conda-forge
  gflags                         2.2.2           he1b5a44_1004                   conda-forge
  gfortran_impl_linux-64         11.4.0          h86428dc_5                      conda-forge
  gfortran_linux-64              11.4.0          h8f970dc_3                      conda-forge
  giflib                         5.2.1           h0b41bf4_3                      conda-forge
  gitdb                          4.0.11          pyhd8ed1ab_0                    conda-forge
  gitpython                      3.1.42          pyhd8ed1ab_0                    conda-forge
  glog                           0.6.0           h6f12383_0                      conda-forge
  gmp                            6.3.0           h59595ed_1                      conda-forge
  gmpy2                          2.1.2           py310h3ec546c_1                 conda-forge
  google-auth                    2.28.2          pyhca7485f_0                    conda-forge
  google-auth-oauthlib           1.2.0           pyhd8ed1ab_0                    conda-forge
  google-pasta                   0.2.0           pyh8c360ce_0                    conda-forge
  greenlet                       3.0.3           py310hc6cd4ac_0                 conda-forge
  gromacs                        2023.4          nompi_h76c6bb2_101              conda-forge
  grpcio                         1.59.3          py310h1b8f574_0                 conda-forge
  gsl                            2.7             he838d99_0                      conda-forge
  gxx_impl_linux-64              11.4.0          h7aa1c59_5                      conda-forge
  gxx_linux-64                   11.4.0          h2730b16_3                      conda-forge
  h11                            0.14.0          pyhd8ed1ab_0                    conda-forge
  h2                             4.1.0           pyhd8ed1ab_0                    conda-forge
  h5py                           3.10.0          nompi_py310h65828d5_101         conda-forge
  hdf4                           4.2.15          h2a13503_7                      conda-forge
  hdf5                           1.14.3          mpi_mpich_ha2c2bf8_0            conda-forge
  hpack                          4.0.0           pyh9f0ad1d_0                    conda-forge
  httpcore                       1.0.4           pyhd8ed1ab_0                    conda-forge
  httpx                          0.27.0          pyhd8ed1ab_0                    conda-forge
  hyperframe                     6.0.1           pyhd8ed1ab_0                    conda-forge
  icu                            73.2            h59595ed_0                      conda-forge
  idna                           3.6             pyhd8ed1ab_0                    conda-forge
  importlib-metadata             7.0.2           pyha770c72_0                    conda-forge
  importlib_metadata             7.0.2           hd8ed1ab_0                      conda-forge
  importlib_resources            6.3.0           pyhd8ed1ab_0                    conda-forge
  ipykernel                      6.29.3          pyhd33586a_0                    conda-forge
  ipython                        8.22.2          pyh707e725_0                    conda-forge
  ipywidgets                     8.1.2           pyhd8ed1ab_0                    conda-forge
  isoduration                    20.11.0         pyhd8ed1ab_0                    conda-forge
  itsdangerous                   2.1.2           pyhd8ed1ab_0                    conda-forge
  jax                            0.4.25          pyhd8ed1ab_0                    conda-forge
  jaxlib                         0.4.23          cpu_py310h8d585fe_0             conda-forge
  jedi                           0.19.1          pyhd8ed1ab_0                    conda-forge
  jinja2                         3.1.3           pyhd8ed1ab_0                    conda-forge
  json5                          0.9.24          pyhd8ed1ab_0                    conda-forge
  jsonpointer                    2.4             py310hff52083_3                 conda-forge
  jsonschema                     4.21.1          pyhd8ed1ab_0                    conda-forge
  jsonschema-specifications      2023.12.1       pyhd8ed1ab_0                    conda-forge
  jsonschema-with-format-nongpl  4.21.1          pyhd8ed1ab_0                    conda-forge
  jupyter-lsp                    2.2.4           pyhd8ed1ab_0                    conda-forge
  jupyter_client                 8.6.1           pyhd8ed1ab_0                    conda-forge
  jupyter_core                   5.7.2           py310hff52083_0                 conda-forge
  jupyter_events                 0.10.0          pyhd8ed1ab_0                    conda-forge
  jupyter_server                 2.13.0          pyhd8ed1ab_0                    conda-forge
  jupyter_server_terminals       0.5.3           pyhd8ed1ab_0                    conda-forge
  jupyterlab                     4.1.5           pyhd8ed1ab_0                    conda-forge
  jupyterlab_pygments            0.3.0           pyhd8ed1ab_1                    conda-forge
  jupyterlab_server              2.25.4          pyhd8ed1ab_0                    conda-forge
  jupyterlab_widgets             3.0.10          pyhd8ed1ab_0                    conda-forge
  keras                          2.15.0          pyhd8ed1ab_0                    conda-forge
  kernel-headers_linux-64        2.6.32          he073ed8_17                     conda-forge
  keyutils                       1.6.1           h166bdaf_0                      conda-forge
  kim-api                        2.3.0           h097297d_1                      conda-forge
  kiwisolver                     1.4.5           py310hd41b1e2_1                 conda-forge
  krb5                           1.21.2          h659d440_0                      conda-forge
  lammps                         2023.11.21      cpu_py310_h8f80a90_mpi_mpich_5  conda-forge
  lcms2                          2.16            hb7c19ff_0                      conda-forge
  ld_impl_linux-64               2.40            h41732ed_0                      conda-forge
  lerc                           4.0.0           h27087fc_0                      conda-forge
  libabseil                      20230802.1      cxx17_h59595ed_0                conda-forge
  libaec                         1.1.2           h59595ed_1                      conda-forge
  libarrow                       15.0.0          h84dd17c_0_cpu                  conda-forge
  libarrow-acero                 15.0.0          h59595ed_0_cpu                  conda-forge
  libarrow-dataset               15.0.0          h59595ed_0_cpu                  conda-forge
  libarrow-flight                15.0.0          h120cb0d_0_cpu                  conda-forge
  libarrow-flight-sql            15.0.0          h61ff412_0_cpu                  conda-forge
  libarrow-gandiva               15.0.0          hacb8726_0_cpu                  conda-forge
  libarrow-substrait             15.0.0          h61ff412_0_cpu                  conda-forge
  libblas                        3.9.0           21_linux64_openblas             conda-forge
  libbrotlicommon                1.1.0           hd590300_1                      conda-forge
  libbrotlidec                   1.1.0           hd590300_1                      conda-forge
  libbrotlienc                   1.1.0           hd590300_1                      conda-forge
  libcblas                       3.9.0           21_linux64_openblas             conda-forge
  libcrc32c                      1.1.2           h9c3ff4c_0                      conda-forge
  libcurl                        8.6.0           hca28451_0                      conda-forge
  libdeflate                     1.19            hd590300_0                      conda-forge
  libedit                        3.1.20191231    he28a2e2_2                      conda-forge
  libev                          4.33            hd590300_2                      conda-forge
  libevent                       2.1.12          hf998b51_1                      conda-forge
  libexpat                       2.6.2           h59595ed_0                      conda-forge
  libffi                         3.4.2           h7f98852_5                      conda-forge
  libgcc-devel_linux-64          11.4.0          h922705a_105                    conda-forge
  libgcc-ng                      13.2.0          h807b86a_5                      conda-forge
  libgfortran-ng                 13.2.0          h69a702a_5                      conda-forge
  libgfortran5                   13.2.0          ha4646dd_5                      conda-forge
  libglib                        2.80.0          hf2295e7_0                      conda-forge
  libgomp                        13.2.0          h807b86a_5                      conda-forge
  libgoogle-cloud                2.12.0          h5206363_4                      conda-forge
  libgrpc                        1.59.3          hd6c4280_0                      conda-forge
  libhwloc                       2.9.3           default_h554bfaf_1009           conda-forge
  libiconv                       1.17            hd590300_2                      conda-forge
  libidn2                        2.3.7           hd590300_0                      conda-forge
  libjpeg-turbo                  3.0.0           hd590300_1                      conda-forge
  liblapack                      3.9.0           21_linux64_openblas             conda-forge
  liblapacke                     3.9.0           21_linux64_openblas             conda-forge
  libllvm15                      15.0.7          hb3ce162_4                      conda-forge
  libnetcdf                      4.9.2           mpi_mpich_h60ccfc9_13           conda-forge
  libnghttp2                     1.58.0          h47da74e_1                      conda-forge
  libnl                          3.9.0           hd590300_0                      conda-forge
  libnsl                         2.0.1           hd590300_0                      conda-forge
  libopenblas                    0.3.26          pthreads_h413a1c8_0             conda-forge
  libparquet                     15.0.0          h352af49_0_cpu                  conda-forge
  libpnetcdf                     1.12.3          mpi_mpich_h4ac58e2_101          conda-forge
  libpng                         1.6.43          h2797004_0                      conda-forge
  libprotobuf                    4.24.4          hf27288f_0                      conda-forge
  libre2-11                      2023.09.01      h7a70373_1                      conda-forge
  libsanitizer                   11.4.0          h4dcbe23_5                      conda-forge
  libsodium                      1.0.18          h36c2ea0_1                      conda-forge
  libsqlite                      3.45.2          h2797004_0                      conda-forge
  libssh2                        1.11.0          h0841786_0                      conda-forge
  libstdcxx-devel_linux-64       11.4.0          h922705a_105                    conda-forge
  libstdcxx-ng                   13.2.0          h7e041cc_5                      conda-forge
  libthrift                      0.19.0          hb90f79a_1                      conda-forge
  libtiff                        4.6.0           ha9c0a0a_2                      conda-forge
  libtorch                       2.1.2           cpu_generic_h7795521_0          conda-forge
  libunistring                   0.9.10          h7f98852_0                      conda-forge
  libutf8proc                    2.8.0           h166bdaf_0                      conda-forge
  libuuid                        2.38.1          h0b41bf4_0                      conda-forge
  libuv                          1.48.0          hd590300_0                      conda-forge
  libwebp-base                   1.3.2           hd590300_0                      conda-forge
  libxcb                         1.15            h0b41bf4_0                      conda-forge
  libxcrypt                      4.4.36          hd590300_1                      conda-forge
  libxml2                        2.12.6          h232c23b_0                      conda-forge
  libxslt                        1.1.39          h76b75d6_0                      conda-forge
  libzip                         1.10.1          h2629f0a_3                      conda-forge
  libzlib                        1.2.13          hd590300_5                      conda-forge
  lightning-utilities            0.10.1          pyhd8ed1ab_0                    conda-forge
  locket                         1.0.0           pyhd8ed1ab_0                    conda-forge
  lxml                           5.1.0           py310hcfd0673_0                 conda-forge
  lz4-c                          1.9.4           hcb278e6_0                      conda-forge
  lzo                            2.10            h516909a_1000                   conda-forge
  make                           4.3             hd18ef5c_1                      conda-forge
  markdown                       3.6             pyhd8ed1ab_0                    conda-forge
  markdown-it-py                 3.0.0           pyhd8ed1ab_0                    conda-forge
  markupsafe                     2.1.5           py310h2372a71_0                 conda-forge
  matplotlib-base                3.8.3           py310h62c0568_0                 conda-forge
  matplotlib-inline              0.1.6           pyhd8ed1ab_0                    conda-forge
  mda-xdrlib                     0.2.0           pyhd8ed1ab_0                    conda-forge
  mdtraj                         1.9.9           py310h523e8d7_1                 conda-forge
  mdurl                          0.1.2           pyhd8ed1ab_0                    conda-forge
  metis                          5.1.1           h59595ed_2                      conda-forge
  mistune                        3.0.2           pyhd8ed1ab_0                    conda-forge
  ml_dtypes                      0.2.0           py310hcc13569_2                 conda-forge
  mlip                           3.0             mpi_mpich_hd0d41c4_1            conda-forge
  mpc                            1.3.1           hfe3b2da_0                      conda-forge
  mpfr                           4.2.1           h9458935_0                      conda-forge
  mpi                            1.0             mpich                           conda-forge
  mpich                          4.2.0           h846660c_100                    conda-forge
  mpmath                         1.3.0           pyhd8ed1ab_0                    conda-forge
  msgpack-python                 1.0.7           py310hd41b1e2_0                 conda-forge
  multidict                      6.0.5           py310h2372a71_0                 conda-forge
  munkres                        1.1.4           pyh9f0ad1d_0                    conda-forge
  n2p2                           2.2.0           mpi_mpich_py310_hae4c411_105    conda-forge
  nbclient                       0.10.0          pyhd8ed1ab_0                    conda-forge
  nbconvert                      7.16.2          pyhd8ed1ab_0                    conda-forge
  nbconvert-core                 7.16.2          pyhd8ed1ab_0                    conda-forge
  nbconvert-pandoc               7.16.2          pyhd8ed1ab_0                    conda-forge
  nbformat                       5.10.3          pyhd8ed1ab_0                    conda-forge
  ncurses                        6.4             h59595ed_2                      conda-forge
  nest-asyncio                   1.6.0           pyhd8ed1ab_0                    conda-forge
  netcdf-fortran                 4.6.1           mpi_mpich_hdf31df6_3            conda-forge
  networkx                       3.2.1           pyhd8ed1ab_0                    conda-forge
  nglview                        3.1.2           pyh15ce09e_0                    conda-forge
  nomkl                          1.0             h5ca1d4c_0                      conda-forge
  notebook                       7.1.2           pyhd8ed1ab_0                    conda-forge
  notebook-shim                  0.2.4           pyhd8ed1ab_0                    conda-forge
  numexpr                        2.9.0           py310hc2d3c2e_100               conda-forge
  numpy                          1.26.4          py310hb13e2d6_0                 conda-forge
  oauthlib                       3.2.2           pyhd8ed1ab_0                    conda-forge
  ocl-icd                        2.3.2           hd590300_0                      conda-forge
  ocl-icd-system                 1.0.0           1                               conda-forge
  openff-amber-ff-ports          0.0.4           pyhca7485f_0                    conda-forge
  openff-forcefields             2024.03.0       pyhca7485f_0                    conda-forge
  openff-interchange             0.3.23          pyhd8ed1ab_0                    conda-forge
  openff-interchange-base        0.3.23          pyhd8ed1ab_0                    conda-forge
  openff-models                  0.1.2           pyhca7485f_0                    conda-forge
  openff-nagl                    0.3.4           pyhd8ed1ab_0                    conda-forge
  openff-nagl-base               0.3.4           pyhd8ed1ab_0                    conda-forge
  openff-nagl-models             0.1.2           pyhd8ed1ab_0                    conda-forge
  openff-recharge                0.5.2           pyhd8ed1ab_0                    conda-forge
  openff-toolkit                 0.15.2          pyhd8ed1ab_0                    conda-forge
  openff-toolkit-base            0.15.2          pyhd8ed1ab_0                    conda-forge
  openff-toolkit-examples        0.15.2          hd8ed1ab_0                      conda-forge
  openff-units                   0.2.1           pyh1a96a4e_0                    conda-forge
  openff-utilities               0.1.12          pyhd8ed1ab_0                    conda-forge
  openjpeg                       2.5.2           h488ebb8_0                      conda-forge
  openmm                         8.1.1           py310h43b6314_1                 conda-forge
  openmmforcefields              0.12.0          pyhd8ed1ab_0                    conda-forge
  openssl                        3.2.1           hd590300_1                      conda-forge
  opt-einsum                     3.3.0           hd8ed1ab_2                      conda-forge
  opt_einsum                     3.3.0           pyhc1e730c_2                    conda-forge
  orc                            1.9.2           h4b38347_0                      conda-forge
  overrides                      7.7.0           pyhd8ed1ab_0                    conda-forge
  packaging                      24.0            pyhd8ed1ab_0                    conda-forge
  packmol                        20.010          h86c2bf4_0                      conda-forge
  pandas                         2.2.1           py310hcc13569_0                 conda-forge
  pandoc                         3.1.12.3        ha770c72_0                      conda-forge
  pandocfilters                  1.5.0           pyhd8ed1ab_0                    conda-forge
  panedr                         0.8.0           pyhd8ed1ab_0                    conda-forge
  parmed                         3.4.4           py310heca2aa9_0                 conda-forge
  parso                          0.8.3           pyhd8ed1ab_0                    conda-forge
  partd                          1.4.1           pyhd8ed1ab_0                    conda-forge
  pcre2                          10.43           hcad00b1_0                      conda-forge
  pdbfixer                       1.9             pyh1a96a4e_0                    conda-forge
  perl                           5.32.1          7_hd590300_perl5                conda-forge
  pexpect                        4.9.0           pyhd8ed1ab_0                    conda-forge
  pickleshare                    0.7.5           py_1003                         conda-forge
  pillow                         10.2.0          py310h01dd4db_0                 conda-forge
  pint                           0.21            pyhd8ed1ab_0                    conda-forge
  pip                            24.0            pyhd8ed1ab_0                    conda-forge
  pixman                         0.43.2          h59595ed_0                      conda-forge
  pkg-config                     0.29.2          h36c2ea0_1008                   conda-forge
  pkgutil-resolve-name           1.3.10          pyhd8ed1ab_1                    conda-forge
  platformdirs                   4.2.0           pyhd8ed1ab_0                    conda-forge
  plumed                         2.8.2           mpi_mpich_h7ded119_0            conda-forge
  prometheus_client              0.20.0          pyhd8ed1ab_0                    conda-forge
  prompt-toolkit                 3.0.42          pyha770c72_0                    conda-forge
  protobuf                       4.24.4          py310h620c231_0                 conda-forge
  psutil                         5.9.8           py310h2372a71_0                 conda-forge
  pthread-stubs                  0.4             h36c2ea0_1001                   conda-forge
  ptyprocess                     0.7.0           pyhd3deb0d_0                    conda-forge
  pure_eval                      0.2.2           pyhd8ed1ab_0                    conda-forge
  py-cpuinfo                     9.0.0           pyhd8ed1ab_0                    conda-forge
  pyarrow                        15.0.0          py310hf9e7431_0_cpu             conda-forge
  pyasn1                         0.5.1           pyhd8ed1ab_0                    conda-forge
  pyasn1-modules                 0.3.0           pyhd8ed1ab_0                    conda-forge
  pycairo                        1.26.0          py310hda9f760_0                 conda-forge
  pycparser                      2.21            pyhd8ed1ab_0                    conda-forge
  pydantic                       2.6.4           pyhd8ed1ab_0                    conda-forge
  pydantic-core                  2.16.3          py310hcb5633a_0                 conda-forge
  pyedr                          0.8.0           pyhd8ed1ab_0                    conda-forge
  pygments                       2.17.2          pyhd8ed1ab_0                    conda-forge
  pyjwt                          2.8.0           pyhd8ed1ab_1                    conda-forge
  pyopenssl                      24.0.0          pyhd8ed1ab_0                    conda-forge
  pyparsing                      3.1.2           pyhd8ed1ab_0                    conda-forge
  pysocks                        1.7.1           pyha2e5f31_6                    conda-forge
  pytables                       3.9.2           py310h374b01c_1                 conda-forge
  python                         3.10.13         hd12c33a_1_cpython              conda-forge
  python-constraint              1.4.0           py_0                            conda-forge
  python-dateutil                2.9.0           pyhd8ed1ab_0                    conda-forge
  python-fastjsonschema          2.19.1          pyhd8ed1ab_0                    conda-forge
  python-flatbuffers             24.3.7          pyh59ac667_0                    conda-forge
  python-json-logger             2.0.7           pyhd8ed1ab_0                    conda-forge
  python-tzdata                  2024.1          pyhd8ed1ab_0                    conda-forge
  python_abi                     3.10            4_cp310                         conda-forge
  pytorch                        2.1.2           cpu_generic_py310h730b6a9_0     conda-forge
  pytorch-lightning              2.2.1           pyhd8ed1ab_0                    conda-forge
  pytz                           2024.1          pyhd8ed1ab_0                    conda-forge
  pyu2f                          0.1.5           pyhd8ed1ab_0                    conda-forge
  pyyaml                         6.0.1           py310h2372a71_1                 conda-forge
  pyzmq                          25.1.2          py310h795f18f_0                 conda-forge
  qcelemental                    0.27.1          pyhd8ed1ab_0                    conda-forge
  qcengine                       0.29.0          pyhd8ed1ab_0                    conda-forge
  qcportal                       0.53            pyhd8ed1ab_0                    conda-forge
  quippy                         0.9.14          py310h6c23d3c_0                 conda-forge
  rdkit                          2023.03.3       py310h399bcf7_0                 conda-forge
  rdma-core                      50.0            hd3aeb46_1                      conda-forge
  re2                            2023.09.01      h7f4b329_1                      conda-forge
  readline                       8.2             h8228510_1                      conda-forge
  referencing                    0.34.0          pyhd8ed1ab_0                    conda-forge
  reportlab                      4.1.0           py310h2372a71_0                 conda-forge
  requests                       2.31.0          pyhd8ed1ab_0                    conda-forge
  requests-oauthlib              1.4.0           pyhd8ed1ab_0                    conda-forge
  rfc3339-validator              0.1.4           pyhd8ed1ab_0                    conda-forge
  rfc3986-validator              0.1.1           pyh9f0ad1d_0                    conda-forge
  rhash                          1.4.4           hd590300_0                      conda-forge
  rich                           13.7.1          pyhd8ed1ab_0                    conda-forge
  rlpycairo                      0.2.0           pyhd8ed1ab_0                    conda-forge
  rpds-py                        0.18.0          py310hcb5633a_0                 conda-forge
  rsa                            4.9             pyhd8ed1ab_0                    conda-forge
  s2n                            1.4.1           h06160fa_0                      conda-forge
  scipy                          1.12.0          py310hb13e2d6_2                 conda-forge
  send2trash                     1.8.2           pyh41d4057_0                    conda-forge
  setuptools                     69.2.0          pyhd8ed1ab_0                    conda-forge
  six                            1.16.0          pyh6c4a22f_0                    conda-forge
  sleef                          3.5.1           h9b69904_2                      conda-forge
  smirnoff99frosst               1.1.0           pyh44b312d_0                    conda-forge
  smmap                          5.0.0           pyhd8ed1ab_0                    conda-forge
  snappy                         1.1.10          h9fff704_0                      conda-forge
  sniffio                        1.3.1           pyhd8ed1ab_0                    conda-forge
  sortedcontainers               2.4.0           pyhd8ed1ab_0                    conda-forge
  soupsieve                      2.5             pyhd8ed1ab_1                    conda-forge
  sqlalchemy                     2.0.28          py310h2372a71_0                 conda-forge
  sqlite                         3.45.2          h2c6b66d_0                      conda-forge
  stack_data                     0.6.2           pyhd8ed1ab_0                    conda-forge
  sympy                          1.12            pypyh9d50eac_103                conda-forge
  sysroot_linux-64               2.12            he073ed8_17                     conda-forge
  tabulate                       0.9.0           pyhd8ed1ab_1                    conda-forge
  tblib                          3.0.0           pyhd8ed1ab_0                    conda-forge
  tensorboard                    2.15.2          pyhd8ed1ab_0                    conda-forge
  tensorboard-data-server        0.7.0           py310h75e40e8_1                 conda-forge
  tensorflow                     2.15.0          cpu_py310h7825f03_2             conda-forge
  tensorflow-base                2.15.0          cpu_py310h7e4d085_2             conda-forge
  tensorflow-estimator           2.15.0          cpu_py310haacee6a_2             conda-forge
  termcolor                      2.4.0           pyhd8ed1ab_0                    conda-forge
  terminado                      0.18.1          pyh0d859eb_0                    conda-forge
  tinycss2                       1.2.1           pyhd8ed1ab_0                    conda-forge
  tinydb                         4.8.0           pyhd8ed1ab_0                    conda-forge
  tk                             8.6.13          noxft_h4845f30_101              conda-forge
  tomli                          2.0.1           pyhd8ed1ab_0                    conda-forge
  toolz                          0.12.1          pyhd8ed1ab_0                    conda-forge
  torchdata                      0.7.1           py310h6d3df93_1                 conda-forge
  torchmetrics                   1.3.2           pyhd8ed1ab_0                    conda-forge
  tornado                        6.4             py310h2372a71_0                 conda-forge
  tqdm                           4.66.2          pyhd8ed1ab_0                    conda-forge
  traitlets                      5.14.2          pyhd8ed1ab_0                    conda-forge
  types-python-dateutil          2.9.0.20240316  pyhd8ed1ab_0                    conda-forge
  typing-extensions              4.10.0          hd8ed1ab_0                      conda-forge
  typing_extensions              4.10.0          pyha770c72_0                    conda-forge
  typing_utils                   0.1.0           pyhd8ed1ab_0                    conda-forge
  tzdata                         2024a           h0c530f3_0                      conda-forge
  ucx                            1.15.0          h11edf95_7                      conda-forge
  unicodedata2                   15.1.0          py310h2372a71_0                 conda-forge
  uri-template                   1.3.0           pyhd8ed1ab_0                    conda-forge
  urllib3                        2.2.1           pyhd8ed1ab_0                    conda-forge
  validators                     0.22.0          pyhd8ed1ab_0                    conda-forge
  voro                           0.4.6           h00ab1b0_0                      conda-forge
  wcwidth                        0.2.13          pyhd8ed1ab_0                    conda-forge
  webcolors                      1.13            pyhd8ed1ab_0                    conda-forge
  webencodings                   0.5.1           pyhd8ed1ab_2                    conda-forge
  websocket-client               1.7.0           pyhd8ed1ab_0                    conda-forge
  werkzeug                       3.0.1           pyhd8ed1ab_0                    conda-forge
  wget                           1.21.4          hda4d442_0                      conda-forge
  wheel                          0.42.0          pyhd8ed1ab_0                    conda-forge
  widgetsnbextension             4.0.10          pyhd8ed1ab_0                    conda-forge
  wrapt                          1.14.1          py310h5764c6d_1                 conda-forge
  xmltodict                      0.13.0          pyhd8ed1ab_0                    conda-forge
  xorg-kbproto                   1.0.7           h7f98852_1002                   conda-forge
  xorg-libice                    1.1.1           hd590300_0                      conda-forge
  xorg-libsm                     1.2.4           h7391055_0                      conda-forge
  xorg-libx11                    1.8.7           h8ee46fc_0                      conda-forge
  xorg-libxau                    1.0.11          hd590300_0                      conda-forge
  xorg-libxdmcp                  1.1.3           h7f98852_0                      conda-forge
  xorg-libxext                   1.3.4           h0b41bf4_2                      conda-forge
  xorg-libxrender                0.9.11          hd590300_0                      conda-forge
  xorg-libxt                     1.3.0           hd590300_1                      conda-forge
  xorg-renderproto               0.11.1          h7f98852_1002                   conda-forge
  xorg-xextproto                 7.3.0           h0b41bf4_1003                   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
  yarl                           1.9.4           py310h2372a71_0                 conda-forge
  zeromq                         4.3.5           h59595ed_1                      conda-forge
  zict                           3.0.0           pyhd8ed1ab_0                    conda-forge
  zipp                           3.17.0          pyhd8ed1ab_0                    conda-forge
  zlib                           1.2.13          hd590300_5                      conda-forge
  zlib-ng                        2.0.7           h0b41bf4_0                      conda-forge
  zstandard                      0.22.0          py310h1275a96_0                 conda-forge
  zstd                           1.5.5           hfc55251_0                      conda-forge

Additional context This is probably an upstream issue but I'm documenting it here anyway.

j-wags commented 6 months ago

Seems to be re-emergence of #1767. Here @Yoshanuikabundi has identified that the issue only occurs when running with one core.

Yoshanuikabundi commented 6 months ago

Ok I systematically ran ten charge assignments under the conditions that I believed led to the crash. 9 of them failed and 1 succeeded. So I think there is a stochastic element to the problem.

I also experimented with changing atom ordering, and specifying the conformers used to calculate charges. I had an atom ordering that worked every time, and an atom ordering that failed 9 times out of 10, so I generated a conformer for each ordering and then tried each conformer on the opposite ordering with the use_conformers argument (after remapping the conformer). The conformers looked very similar and didn't have anything obviously wrong with them - the main difference was a 180 degree rotation of a hydroxyl group. Moreover, changing the conformer to one generated from the opposite ordering didn't change the results. I was really surprised to see this, but it seems to be the atom ordering itself and not the conformation.

j-wags commented 6 months ago

Thanks for looking deeper into this.

Decisive morning-jeff is looking at this and sees two options:

I'm strongly in favor of the latter. I'll change the issue name to reflect this. @Yoshanuikabundi could you push the good atom ordering to https://github.com/openforcefield/openff-toolkit/pull/1846