Skip to content

[source_cell] parameter.h is widely used in source_cell's code #7632

Description

@Critsium-xy

Describe the Code Quality Issue

The single most pervasive violation of the "source_cell should only depend on source_base" rule is the direct use of the global singleton PARAM (extern Parameter PARAM, declared in source_io/module_parameter/parameter.h). Instead of receiving configuration through function arguments, these files reach into the process-wide global PARAM.inp.* / PARAM.sys.* / PARAM.globalv.* directly, which pulls source_cell into a hard dependency on source_io. Because source_io in turn depends on source_cell in 118 files, this is also a genuine circular dependency.

Additional Context

Production files (non-test) that include source_io/module_parameter/parameter.h:

# File
1 atom_pseudo.cpp
2 atom_spec.cpp
3 bcast_cell.cpp
4 cal_atoms_info.h
5 klist.cpp
6 k_vector_utils.cpp
7 read_atoms.cpp
8 read_atoms_helper.cpp
9 read_pp.cpp
10 read_pp_complete.cpp
11 read_atom_species.cpp
12 setup_nonlocal.cpp
13 unitcell.cpp
14 module_neighbor/sltk_atom_arrange.cpp
15 module_neighbor/sltk_grid_driver.cpp
16 module_symmetry/symmetry_basic.cpp
17 module_symmetry/symm_lattice.cpp
18 module_symmetry/symm_analysis.cpp
19 module_symmetry/symm_rho.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions