Skip to content

Fix redundant density symmetrization in OFDFT - #7749

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Cstandardlib:fix/7724-symmetrize-rho-ofdft
Aug 2, 2026
Merged

Fix redundant density symmetrization in OFDFT#7749
mohanchen merged 1 commit into
deepmodeling:developfrom
Cstandardlib:fix/7724-symmetrize-rho-ofdft

Conversation

@Cstandardlib

@Cstandardlib Cstandardlib commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Fix #7724

Unit Tests and/or Case Tests for my changes

  • No tests added.

What's changed?

  • Remove redundant rho_symmetrize operation whose results will soon be overwritten in esolver_of.cpp.
  • Now no unnecessary symmetrization is performed for ofdft with init_chg!=file, saving up to 95% of total time.

Governance Notes

  • INPUT/docs changes: No changes.

Copilot AI review requested due to automatic review settings August 1, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR targets the OFDFT initialization hotspot reported in #7724 by avoiding a redundant density symmetrization step when the initial (non-file) density is immediately replaced with a uniform density in ESolver_OF::before_opt.

Changes:

  • Guard Symmetry_rho::symmetrize_rho(...) so it only runs when init_chg == "file" in ESolver_OF::before_opt.
  • Add an in-code note explaining why symmetrization is skipped for non-file initialization.
  • Minor whitespace/formatting cleanups in esolver_of.cpp.

Comment thread source/source_esolver/esolver_of.cpp Outdated
@Cstandardlib
Cstandardlib force-pushed the fix/7724-symmetrize-rho-ofdft branch from 281f08e to d8fe1db Compare August 1, 2026 19:26
Copilot AI review requested due to automatic review settings August 1, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@Cstandardlib
Cstandardlib force-pushed the fix/7724-symmetrize-rho-ofdft branch from d8fe1db to 65d533b Compare August 1, 2026 19:44
Copilot AI review requested due to automatic review settings August 1, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@mohanchen mohanchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mohanchen mohanchen added Refactor Refactor ABACUS codes Performance Issues related to fail running ABACUS Symmetry This issue is related to symmetry labels Aug 2, 2026
@mohanchen
mohanchen merged commit d2ed0cc into deepmodeling:develop Aug 2, 2026
18 checks passed
@Cstandardlib
Cstandardlib deleted the fix/7724-symmetrize-rho-ofdft branch August 2, 2026 07:37
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 Symmetry This issue is related to symmetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

symmetrize_rho slow on large systems for OFDFT

3 participants