Skip to content

[Dependency] module_parameter is included almost everywhere. #7597

Description

@Critsium-xy

Describe the Code Quality Issue

The definition of the global input singleton PARAM (module_parameter/) currently lives inside source_io, yet it is included by nearly every module:

Directory including module_parameter/parameter.h Files
source_lcao 105
source_io 77
source_pw 53
source_estate 48
source_cell 36
source_hsolver 23
source_relax 18
source_esolver 14
source_hamilt 14
source_md 12
source_psi 12
source_main 3

Consequence: this single fact pins source_io to the very bottom ("depended on by everyone"). Yet io itself must also write dos/wannier/cube (which requires seeing high-level data), so io straddles L0↔L8 and becomes an unbreakable "god module".

Additional Context

It seems that a CI test has been added to block this problem from worsening. But this is still a huge problem in code quality.

Task list for Issue attackers (only for developers)

  • Identify the specific code file or section with the code quality issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified issue.
  • Refactor the code to improve code quality, following the suggested solution.
  • Ensure the refactored code adheres to the project's coding standards.
  • Test the refactored code to ensure it functions as expected.
  • Update any relevant documentation, if necessary.
  • Submit a pull request with the refactored code and a description of the changes made.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions