Conversation
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.
Summary
Replace the rank-0 gather-and-write implementation of the LibRPA v1 KS eigenvector output (
KS_eigenvector_0.dat, active whenout_librpa_reader_version == 1under__MPI) with a collective MPI-IO writer.Motivation
The old implementation had several scalability and robustness problems:
MPI_Allreduce(overMPI_COMM_WORLD) per (k-point, spin, band), i.e.nks × nspin × nbandscollectives of sizenlocaleach.nbands × nlocalwavefunction matrix on every rank, and rank 0 held the entire file payload in memory (nks × nspin × nbands × nlocal × 16 B) before writing it serially — prohibitive for production RPA/GW system sizes.KS_eigenvector_0.dat.MPI_COMM_WORLDinstead of the wavefunction communicator.What this PR does
RPA_LRI::out_eigen_vector(v1 branch, MPI build) now uses a collective MPI-IO writer:MPI_Type_create_hindexedfile datatype; payload is written withMPI_File_write_at_allin chunks bounded to 4M complex elements (64 MB pack buffer per rank, independent of system size).KS_eigenvector_0.dat.tmp, synced, closed, then renamed by rank 0; the temp file is removed on any error.psivsParallel_Orbitalsdimensions, spin/SOC consistency (evennlocal, even/odd spinor component split), and an exact global ownership invariant (summed per-rank element counts must equalnbands × spatial_basis).MPI_Aint/MPI_Offset/ int32 range checks).Compatibility
out_librpa_reader_version != 1) are untouched.Verification
RPA_LRI.hpp, compared against a re-implementation of the old writer: outputs are byte-for-byte identical over ~150 runs spanning 1–8 MPI ranks,nspin= 1/2/4 (incl. SOC), ScaLAPACK block sizes 1–33, uneven grids with ranks owning zero bands, and payloads crossing the 4M-element chunk boundary (multi-chunk collective writes).``