marcelloPuligheddu / cp2k

Quantum chemistry and solid state physics software package
https://www.cp2k.org
GNU General Public License v2.0
0 stars 0 forks source link

openMP may be changing number of threads #1

Open marcelloPuligheddu opened 2 weeks ago

marcelloPuligheddu commented 2 weeks ago

Something strange is happening.

I think, at last in this test, openmp threads > 1 are getting destroyed and recreated between call to integrate_four_center.

Unfortunately this completely invalidates all libGint internals, expecially the libGint_handle.

This means we have to recreate all handles and all associate objects at every call to int_4_c.

This should also lead to non insignificant memory leaks (as in undestroyed objects) on the cpu and probably also on the gpu.

To reproduce, run the H20-32.inp file (reduced to contain a single molecule) on 4 openmp, single MPI.

Possibly due to the small size of the test Possibly limited to my machine

marcelloPuligheddu commented 1 week ago

Workaround from 30cb671 works fine. It creates a new handle each time integrate_4c is called.

This is not perfect since: we could save handle in master and share them not really sure what happened to the memory allocated from previous handles