grimme-lab / xtb

Semiempirical Extended Tight-Binding Program Package
https://xtb-docs.readthedocs.io/
GNU Lesser General Public License v3.0
568 stars 144 forks source link

Fixes #1054 by ensuring thread savety of hessian calculations with GFN-FF #1061

Closed Thomas3R closed 3 months ago

Thomas3R commented 3 months ago

The distance array neigh%distances was not allocated thread save and was removed from the neigh class. Now the distances are calculated from the atom coordinates and the translation vectors.

marcelmbn commented 3 months ago

Given the assumption that the distance array cannot be allocated thread safe, this seems like a reasonable change to me. However, it's principle-wise not a good development to move away from modularized calculation of static variables (like a distance array) towards calculating it from scratch whenever needed. Thus, do you think there's any chance to allocate it in a thread-safe way?

Thomas3R commented 3 months ago

Of course, a distance array could be used in a thread-saving way. However, I recommend implementing this together with a revision of the force field parallelization. This would be a major effort to implement either way.