-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Describe the bug
I understand this library is no longer maintained; however, I haven't tested this on tblite but wanted to add my results here for your reference.
When I run a "typical" calculation on a molecule with ~40-60 atoms or so the calculation is 10x slower than if I set OMP_NUM_THREADS=1. If I profile the code most of the time is spent spawning new process and not actually doing calcultions.
For such lightweight calculations I'd recommend threads over processes as the overhead of spawning new processes is actually higher than the calculation itself. Not sure if you've already updated the tblite implementation to use threads over processes, but I'd certainly recommend this ;P
The performance hit is impressive. If OpenMP is here to stay in the implementation I'd suggest an easy API for passing in the OMP_NUM_THREADS variable and probably set it to 1 by default. 🚗💨 . The current implementation does not offer this possibility and since new processes are spawned outside of the python interpreter unfortunately xtb-python does not respect setting os.environ['OMP_NUM_THREADS': 1] so programatically controlling this important variable is rather challenging (still looking for a solution).
Thx!