Repository navigation
Refactor(input): make relax_method a scalar option - #8168
Open
Stardust0831 wants to merge 1 commit into
Open
Stardust0831 wants to merge 1 commit into
Stardust0831 wants to merge 1 commit into
Conversation
Stardust0831
marked this pull request as ready for review
October 17, 2026 16:12
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.
relax_methodnow selects each relaxation method with one scalar string. This removes the algorithm/variant pair from INPUT parsing and the relaxation interfaces, makes availability expressions refer to one well-defined value, and gives invalid inputs a complete list of accepted choices.The
relax_methodvalues change as follows:cgorcg 2cgcg 1cg_nestedbfgsorbfgs 2bfgsbfgs 1bfgs_traditionalcg_bfgscg_bfgs(unchanged)lbfgslbfgs(unchanged)sdsd(unchanged)The default remains simultaneous CG (
cg). All two-token values are rejected; no compatibility aliases are retained.Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Fixes #7822. Also addresses the availability-semantics discussion in #7783.
That discussion identified ambiguity between scalar membership (
in) and vector containment (contains): whenrelax_methodis a vector, it is unclear whether a condition refers to the whole vector, its first element, or one of its elements. A scalar parameter removes that ambiguity. The existing availability grammar remains unchanged.Unit Tests and/or Case Tests for my changes
Not run: full trajectory comparisons, LCAO/GPU builds, or the full test suite; validation focused on PW/MPI. The broader MPI
ParaReadfixture requires ELPA.Verification commands and build details
GCC 13.4, PW/MPI, LCAO/ELPA disabled, assertions enabled,
OMP_NUM_THREADS=1; executable versionv3.11.0-beta10.$ABACUS_BUILD_DIRis the build directory;$PARAMETER_YAMLand$INPUT_REFERENCEare generated scratch files. CLI input checks used copies oftests/01_PW/060_PW_RE_MG.Quality scoring: 15/17 files passed; both existing low scores are unchanged from the base.
What's changed?
relax_methodas onestd::string. Accept exactly one ofcg(default),cg_nested,bfgs,bfgs_traditional,cg_bfgs,lbfgs, orsd; reject empty, unknown, and multi-token values without compatibility aliases.Input_Itemtype/default/help and dependent availability expressions. Invalid empty, unknown, and multi-token values now share one diagnostic that lists every accepted scalar choice. Add assertions that scalar membership is valid and vector containment is rejected forrelax_method.The diff contains 40 files: 9 implementation files, 10 unit-test/fixture files, 2 documentation files, and 19 example/regression INPUT files. Each example/regression INPUT change replaces one relaxation selection.
Governance Notes
relax_methodis now scalar throughout.Input_Itemmetadata is the source of truth; generated YAML and Markdown references were checked but are not committed.