using velocity gauge is much slower than length gauge in TDDFT
Details
If I use velocity gauge in TDDFT(td_stype=1), ABACUS is much slower than the length gauge,
Here is the input and log files I used:
compareGagus.tar.gz
Based on the time consumption log, my guess is the bottleneck is in the modules
Evolve_elec evolve_psi
HSolverLCAO solve
HamiltLCAO updateHk
Besides, it seems the 1st electronic step in each ionic step is the most time consuming.
I wish the developers could help to improve the performance when using velocity gauge.
Task list for Issue attackers (only for developers)
- [ ] Reproduce the performance issue on a similar system or environment.
- [ ] Identify the specific section of the code causing the performance issue.
- [ ] Investigate the issue and determine the root cause.
- [ ] Research best practices and potential solutions for the identified performance issue.
- [ ] Implement the chosen solution to address the performance issue.
- [ ] Test the implemented solution to ensure it improves performance without introducing new issues.
- [ ] Optimize the solution if necessary, considering trade-offs between performance and other factors (e.g., code complexity, readability, maintainability).
- [ ] Review and incorporate any relevant feedback from users or developers.
- [ ] Merge the improved solution into the main codebase and notify the issue reporter.
I noticed this problem quite early, but at that time it was secondary to ensuring the correctness of the code. The main cause of this problem is that the Interface snap_psibeta_half_tddft takes too long, as can also be seen from your logs. It was used to calculate nonlocal potential terms for velocity gague. We will try to optimize this interface to improve the performance of the code.