Support binary LCAO wavefunction input - #7863
Open
goodchong wants to merge 4 commits into
Open
Conversation
mohanchen
self-requested a review
August 29, 2026 02:45
mohanchen
reviewed
Aug 31, 2026
| { | ||
| namespace | ||
| { | ||
| void parse_init_wfc(const std::vector<std::string>& values, Input_para& input) |
Collaborator
There was a problem hiding this comment.
do we have similar functions already?
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
read_wfc_lcaowith an explicit two-valueinit_wfcsyntax:init_wfc file txtandinit_wfc file binaryinit_wfcmethod field internally while storing the normalized file format separately, so existing PW, LCAO, TDDFT, LR, and EXX flow checks remain stableinit_wfc fileinput for backward compatibility (LCAO defaults to text, PW defaults to binary) while canonicalizingINPUT.infoto the explicit two-value formout_wfc_lcao 2layout for Gamma-only and multi-k calculations, including type conversion and file/index/dimension validationdouble,float, complex, skipped bands, mismatched formats, truncated input, and existing text inputInput behavior
init_wfc file txtandinit_wfc file binary.init_wfc file binaryand rejectsinit_wfc file txtbecause no PW text reader exists.Binary compatibility
The reader intentionally follows the existing native
int/doublewriter protocol. It does not add magic/version fields or cross-ABI, cross-endian compatibility, and it does not read files accumulated without_app_flag.Verification
cmake --build build -j2(full serial build passed)OMP_NUM_THREADS=1 ctest --test-dir /tmp/abacus_wfc_binary_mpi_mpicxx --output-on-failure -R '^(MODULE_IO_read_item_serial|MODULE_IO_write_wfc_nao|MODULE_IO_write_wfc_nao_para|MODULE_IO_read_wfc_nao_test|MODULE_IO_read_wfc_nao_test_parallel)$'(5/5 passed, including 2-rank MPI outside the restricted sandbox)OMP_NUM_THREADS=1two-stage end-to-end runs passed for text Gamma, binary Gamma, and binary 8-k-point LCAO wavefunctions; source/readback energies differed by at most5.5e-13 eVinit_wfc file txttoINPUT.infoOMP_NUM_THREADS=1 ./build/abacus_basic_omp --check-input: PWfile binarypassed; PWfile txtfailed with the expected unsupported-format error./build/abacus_basic_omp -h init_wfc: only the explicitfile txtandfile binaryforms are documented./build/abacus_basic_omp -h read_wfc_lcao: returnedUnknown parameterdocs/parameters.yamlanddocs/advanced/input_files/input-main.md; a fresh YAML generation matched byte-for-bytegit diff --checkpython3 tools/03_code_analysis/agent_governance_check.py --staged(no findings)#6206