Skip to content

Conversation

@LKFEIYI
Copy link

@LKFEIYI LKFEIYI commented Jan 7, 2026

This is the refactoring part of the previous PR #6832 (comment).

Now, it seems that the efficiency of the surchem module has been improved by approximately 100%, which likely comes from reducing the creation/deletion of large matrices. As discussed in #6832 (comment), I deleted the local functions and used the unified interface XC_Functional::grad_rho. Redundant variables are also removed.

I merely tested two examples, and they are attached here for validation:
One is the optimization of ethanol in water, namely the example in #6794, where the time for cal_vel decreased from 1607.60s to 772.56s. The other one is the scf calculation of a Ag slab with cooh (adapted from http://bbs.keinsci.com/thread-57694-1-1.html), where the time for cal_vel decreased from 749.44s to 375.28s.
test.zip

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

Copy link
Collaborator

@dyzheng dyzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!!

@mohanchen mohanchen added Refactor Refactor ABACUS codes Performance Issues related to fail running ABACUS labels Jan 7, 2026
@mohanchen mohanchen merged commit b07057f into deepmodeling:develop Jan 7, 2026
14 checks passed
@LKFEIYI LKFEIYI mentioned this pull request Jan 7, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance Issues related to fail running ABACUS Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants