Repository navigation
refactor: spell out local types in numerical kernels, solvers and I/O - #8397
Open
Stardust0831 wants to merge 34 commits into
Open
Stardust0831 wants to merge 34 commits into
Stardust0831 wants to merge 34 commits into
Conversation
This branch has not been deployed
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.
Linked Issue
The developer guide asks contributors to prefer explicit local types. This refactor applies that rule without changing a user-facing feature.
What's changed?
Spell out 757 local declarations in 211 files across the numerical libraries, PW and LCAO solvers, I/O, existing unit tests, and three PyABACUS binding declarations. The changes make precision, pointee types, ownership, and copy versus reference semantics visible at the declaration. For example, the complex FFT scratch buffers use
std::complex<FPTYPE>*and the real-space buffer usesFPTYPE*. The initializer expressions and numerical operations are preserved.Unit Tests and/or Case Tests for my changes
cmake --build "$build" -j 6 --target "$target"andctest --test-dir "$build" -V --no-tests=error -R "^${target}$"withOMP_NUM_THREADS=1andOPENBLAS_NUM_THREADS=1. 45 suites passed in full (523 Google Tests). The parallel INPUT fixture selectsgenelpaand the parallel eigensolver suite calls ELPA. Both stop with ELPA disabled on the comparison build and the final commit. All four ScaLAPACK eigensolver cases passed separately on the final commit.std::is_same<decltype(variable), Expected>and compiled the explicit declarations. Compared generated CPU objects in the tested configurations, including LibRI/Libxc, PyABACUS, and translation units instantiating the changed headers. Focused dispersion, radial, FFT and INPUT tests were also run on the corresponding earlier commits, including FFT on one and three MPI ranks and D4 on two.-std=c++17 -arch=sm_75). The PTX and the combined host/device objects afterobjcopy --strip-debugmatched byte for byte. GPU runtime and ROCm were untested. Full-application integration tests were outside the focused runs.Governance Notes
No documentation update required. The changes are local declarations with the same types and initializers. Public interfaces, INPUT parsing and defaults, and build configuration are unchanged.
<new>declaresstd::new_handlerand<memory>declaresstd::unique_ptr. The four existing global reads flagged by the checker occur in the same initializers on both sides of the diff (net zero). No exception is requested.