Skip to content

Refactor hsolver: drop dead global includes and GlobalV::DSIZE - #7865

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
Critsium-xy:refactor/hsolver-globalv-cleanup
Aug 27, 2026
Merged

Refactor hsolver: drop dead global includes and GlobalV::DSIZE#7865
mohanchen merged 1 commit into
deepmodeling:developfrom
Critsium-xy:refactor/hsolver-globalv-cleanup

Conversation

@Critsium-xy

Copy link
Copy Markdown
Collaborator

No description provided.

Step 1 — remove includes of global_variable.h / parameter.h from files
that no longer reference any symbol from them: diago_cusolver.cpp,
diago_pexsi.cpp, diago_elpa_native.cpp and module_pexsi/simple_pexsi.cpp.

Step 2 — remove GlobalV::DSIZE from the ScaLAPACK/LAPACK solvers:

* diago_scalapack.cpp: p?sygvx needs iclustr(2*NPROW*NPCOL) and
  gap(NPROW*NPCOL) of the grid the descriptor lives on, which is not
  necessarily the size of the diag world.  Query the grid via
  Cblacs_gridinfo() on desc[1] instead.  This also fixes a latent
  out-of-bounds read in post_processing() whenever the BLACS grid is
  smaller than DSIZE; the loop now derives its bound from iclustr.

* diago_lapack.cpp: the serial LAPACK ?sygvx/?hegvx take no iclustr/gap
  at all, so gap is dropped and iclustr becomes a single-process
  placeholder.

No functional change for the existing single-grid runs.
Verified with MODULE_HSOLVER_LCAO (serial and 4 MPI ranks) and
MODULE_HSOLVER_diago_hs_parallel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mohanchen mohanchen added Refactor Refactor ABACUS codes Diago Issues related to diagonalizaiton methods labels Aug 27, 2026
@mohanchen
mohanchen merged commit 39564a1 into deepmodeling:develop Aug 27, 2026
17 checks passed
mohanchen pushed a commit to mohanchen/abacus-mc that referenced this pull request Aug 28, 2026
…odeling#7865)

Step 1 — remove includes of global_variable.h / parameter.h from files
that no longer reference any symbol from them: diago_cusolver.cpp,
diago_pexsi.cpp, diago_elpa_native.cpp and module_pexsi/simple_pexsi.cpp.

Step 2 — remove GlobalV::DSIZE from the ScaLAPACK/LAPACK solvers:

* diago_scalapack.cpp: p?sygvx needs iclustr(2*NPROW*NPCOL) and
  gap(NPROW*NPCOL) of the grid the descriptor lives on, which is not
  necessarily the size of the diag world.  Query the grid via
  Cblacs_gridinfo() on desc[1] instead.  This also fixes a latent
  out-of-bounds read in post_processing() whenever the BLACS grid is
  smaller than DSIZE; the loop now derives its bound from iclustr.

* diago_lapack.cpp: the serial LAPACK ?sygvx/?hegvx take no iclustr/gap
  at all, so gap is dropped and iclustr becomes a single-process
  placeholder.

No functional change for the existing single-grid runs.
Verified with MODULE_HSOLVER_LCAO (serial and 4 MPI ranks) and
MODULE_HSOLVER_diago_hs_parallel.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Diago Issues related to diagonalizaiton methods Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants