Repository navigation
fix(input): reject invalid DFT+U lists before resizing - #40
Draft
Stardust0831 wants to merge 1 commit into
Draft
Stardust0831 wants to merge 1 commit into
Stardust0831 wants to merge 1 commit into
Conversation
4 tasks
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.
Explicit
orbital_corrandhubbard_ulists are currently resized before their length is checked. Withntype=1,orbital_corr 2 99andhubbard_u 4 -7silently become2and4, hiding the invalid trailing values. Short lists are silently padded as well.Following deepmodeling#7719 and deepmodeling#8192, this change rejects these inputs instead of rewriting them. A shared vector-size declaration requires exactly
ntypecomplete, correctly typed values. Token validation runs before reading callbacks; length validation uses the original tokens after STRU resolvesntype, before any vector resize. Errors identify the supplied input, explain the requirement, link to the parameter manual, and reach every MPI rank.Omitted lists retain their defaults. Complete valid lists retain their supplied values. The existing physical element-range checks are preserved. This initial use of the shared declaration covers these two literal-vector parameters; the same declaration also supplies the count requirement to CLI help and generated documentation.
Validation
$buildand$mpi_builddenote configured serial and MPI build directories; runtime tests useOMP_NUM_THREADS=1.cmake --build "$build" --target abacus_basic_omp MODULE_IO_input_domain_reader MODULE_IO_read_item_serial MODULE_IO_input_domain MODULE_IO_availability -j 12andctest --test-dir "$build" -V -R '^MODULE_IO_(input_domain(_reader)?|read_item_serial|availability)$': 4 targets / 85 tests passed, covering malformed tokens, excess/missing entries, inferredntype, valid lists and omitted defaults.cmake --build "$mpi_build" --target MODULE_IO_input_error_mpi -j 12andenv OMPI_MCA_pml=ob1 OMPI_MCA_btl=self,sm ctest --test-dir "$mpi_build" -V -R '^MODULE_IO_input_error_mpi_': all 12 four-rank cases passed. Shared-memory transport avoids a host-specific MPI initialization delay; the existing timeout and all-rank shutdown assertions are unchanged.abacus_basic_omp --check-inputand the production reader passed 12 acceptance/rejection scenarios.abacus_basic_omp --version,abacus_basic_omp -h orbital_corr, andabacus_basic_omp -h hubbard_upassed; help remains within 80 columns.python3 -m unittest discover -s docs -p test_generate_input_main.py -v: 4 tests passed.abacus_basic_omp --generate-parameters-yamlfollowed bypython3 docs/generate_input_main.py parameters.yaml --output input-main.mdgenerated the reference with linked vector-count requirements.input_domain.cpp,python3 tools/03_code_analysis/agent_governance_check.py --staged, andgit diff --cached --checkpassed.INPUT and implementation notes
The two
Input_Itemregistrations document the input requirement. YAML and Markdown are generated from this metadata and are not committed. Changes affect input validation and help generation; DFT+U numerical algorithms are unchanged. No governance exception is requested.