OrderN / CONQUEST-release

Full public release of large scale and linear scaling DFT code CONQUEST
http://www.order-n.org/
MIT License
96 stars 25 forks source link

Multi threading exact exchange #276

Closed tkoskela closed 1 month ago

tkoskela commented 7 months ago

Collaborators in Bordeaux are developing this and could use some help. Not sure how much is in the main branch.

davidbowler commented 7 months ago

We want the f-exx developed by @lionelalexandre

tkoskela commented 5 months ago

Notes from meeting with @lionelalexandre

ilectra commented 4 months ago

Some useful reading: Linear–scaling implementation of exact exchange using the density matrix: method and accuracy

tkoskela commented 4 months ago

exx_poisson

exx_evalpao

exx_matmult

in https://github.com/OrderN/CONQUEST-release/blob/41cf7e2b6c77fbf6a6ac5d6731858030697f53a6/src/exx_kernel_default.f90#L1256-L1266

tkoskela commented 4 months ago

The kpart loop in https://github.com/OrderN/CONQUEST-release/blob/41cf7e2b6c77fbf6a6ac5d6731858030697f53a6/src/exx_kernel_default.f90#L442 duplicates large parts of the main loop in https://github.com/OrderN/CONQUEST-release/blob/41cf7e2b6c77fbf6a6ac5d6731858030697f53a6/src/multiply_module.f90#L217

We need to understand how to reduce the duplication. I would like to see if we can call mat_mult from exx_kernel_default instead of replicating the code without making too disruptive modifications to mat_mult. Keeping in mind the changes in #290

lionelalexandre commented 3 months ago

exx_poisson : that would be a very difficult task and I am not sure this is possible (using MPI)

lionelalexandre commented 3 months ago

exx_evalpao : actually r is not needed anymore (some vestige of previous versions). I don't see clearly how to avoid the 6 nested loops for evalpao but maybe there is something to do.

lionelalexandre commented 3 months ago

The kpart loop in : (maybe to clarify) as you noticed this part of the code has been inspired by the mat_mult kernel. The idea behind was to get access locally to matrix elements which were managed by remote nodes. At that time, this simplest way to duplicate mat_mult fo this purpose. Now, I think it is possible to use mat_mult 'as if' to get access to the matrix elements, to store them, and then to compute EXX. We may need to discuss about this.

tkoskela commented 1 month ago

Let's close this issue as completed by #324 and start a new one for the follow-up work.