Refactor hsolver: drop dead global includes and GlobalV::DSIZE - #7865
Merged
mohanchen merged 1 commit intoAug 27, 2026
Merged
Conversation
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
approved these changes
Aug 27, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.