Skip to content

refactor(lcao): make block-cyclic layout access explicit via para_2d() - #8269

Merged
mohanchen merged 9 commits into
deepmodeling:developfrom
kirk0830:pr/02-lcao-explicit-para2d
Nov 3, 2026
Merged

mohanchen merged 9 commits into
deepmodeling:developfrom
kirk0830:pr/02-lcao-explicit-para2d

Conversation

@kirk0830

@kirk0830 kirk0830 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make the LCAO-side consumers of Parallel_Orbitals request their block-cyclic layout explicitly through para_2d(), following the merged PR #8254.

This PR covers module_dm, module_dftu, module_lr, module_operator_lcao, and module_current. Parallel_2D inheritance is intentionally retained in this PR.

Motivation

Inherited layout members hide whether a pv dependency represents basis, wavefunction, or matrix layout. This change makes those dependencies explicit and isolates the remaining consumers before a subsequent PR removes the inheritance.

Changes

Non-goals

  • This PR does not remove Parallel_2D inheritance.
  • It does not introduce BlockCyclicDistributionInformation or Matrix2d as the public layout boundary.
  • It does not change LAPACK/ScaLAPACK algorithms.
  • It does not change user-visible behavior or INPUT parameters.

Verification

  • cmake --build build --target abacus_basic_para -j2: passed.
  • Built the affected DM, DFTU, LCAO operator, and LR unit-test targets.
  • Focused CTest set: 20/20 passed across MODULE_ESTATE_dm_*, MODULE_DFTU_*, MODULE_LCAO_operator_*, and MODULE_LR_*.
  • git diff --check upstream/develop...HEAD: passed.
  • Agent governance: no deterministic errors. The net-zero global-reference move in operator_lr_hxc.cpp is migration-neutral.
  • No documentation update is needed: this is an internal, behavior-neutral layout-access refactor with no INPUT or output changes.

Stack

Purely additive: no call site changes, inheritance still in place.
para_2d() (const + non-const) returns *this while Parallel_Orbitals derives
from Parallel_2D, giving the two escape hatches a const getter cannot serve
(LR_Util::setup_2d_division mutation, test-side descriptor writes).
get_blacs_ctxt() completes the inherited getter family, which covers the
other seven public data members.
…bitals, migrate module_operator_lcao call sites

@ABACUS-PR-BOT ABACUS-PR-BOT 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.

Non-blocking: Please add the exact unit-test build and CTest commands, plus the serial/MPI build configuration, behind the reported 20/20 result to the Verification section so others can reproduce it.

Static review of a1c9b4967f75; no builds or tests were run.

@mohanchen
mohanchen merged commit f4c3dd3 into deepmodeling:develop Nov 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants