Refactor: reduce FFT calls in Leps2 #6839
Merged
+18
−39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the code seemed to perform unnecessary IFFT (G to R) transformations for each component (x, y, z) and an extra FFT (R to G) for the final result. So I reduced the number of FFT/IFFT calls per iteration from 10 to 6.
Then, the efficiency of the solvation model can be further increased by about 25%. For example, during the scf calculation of Ag-COOH example in #6836 (comment), the time for cal_vel further decreased from 375.72 s to 272.63 s (total time decreased from 667 s to 566 s, GNU toolchain, 7950x, mpirun -n 16).
I will appreciate it if you can check if they are correct and safe.
Reminder
Linked Issue
Fix #...
Unit Tests and/or Case Tests for my changes
What's changed?
Any changes of core modules? (ignore if not applicable)