Repository navigation
Conversation
read_rhog aborted as soon as the gamma_only flag stored in the restart file differed from the current run, so an nscf started from an scf-generated ABACUS-CHARGE-DENSITY.restart silently failed to load the density (issue deepmodeling#6664). The reader now reconstructs the missing half sphere through the Hermitian relation rho(-G) = conj(rho(G)) instead of returning an error. The mapping is driven by the Miller indices stored in the file, so it works for both directions (half sphere -> full sphere and full sphere -> half sphere) and is independent of which axis defines the half sphere. Fill logic is factored into a local assign_mode helper, keeping the existing out-of-grid, stick-ownership and cutoff guards unchanged. Tests update InconsistentGammaOnly to expect success and add round-trip coverage for both gamma_only conversions.
ErjieWu
requested changes
Dec 4, 2026
…og read When the file stores only one half sphere (gamma_mismatch), G and -G may be owned by different MPI ranks, so assign_mode(-G) silently failed on the rank owning G and the conjugate partner was never filled. Each rank now writes into a private buffer and the disjoint entries are merged with an MPI_Allreduce(SUM). Also guard the wrapped Miller indices against the reduced fftnx/fftny size of gamma_only grids, preventing out-of-bounds access to fftixy2ip.
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.
Fix #6664
read_rhog aborted as soon as the gamma_only flag stored in the restart file differed from the current run, so an nscf started from an scf-generated ABACUS-CHARGE-DENSITY.restart silently failed to load the density (issue #6664).
The reader now reconstructs the missing half sphere through the Hermitian relation rho(-G) = conj(rho(G)) instead of returning an error. The mapping is driven by the Miller indices stored in the file, so it works for both directions (half sphere -> full sphere and full sphere -> half sphere) and is independent of which axis defines the half sphere.
Fill logic is factored into a local assign_mode helper, keeping the existing out-of-grid, stick-ownership and cutoff guards unchanged. Tests update InconsistentGammaOnly to expect success and add round-trip coverage for both gamma_only conversions.