Skip to content

Naming cleanup: misnamed MPI gather routine, stutter type names, builtin-shadowing locals #1507

Description

@sbryngelson

A grab-bag of low-value but verified naming issues. Each is independent and low-risk; filed as one combined cleanup.

1. mpi_bcast_time_step_values does a GATHER, not a broadcastsrc/common/m_mpi_common.fpp:257. The body is:

call MPI_GATHER(time_avg, 1, mpi_p, proc_time(0), 1, mpi_p, 0, MPI_COMM_WORLD, ierr)

and the doc comment even says "Gather per-rank time step wall-clock times onto rank 0." The bcast in the name is simply wrong. Rename to s_mpi_gather_time_step_values (also picks up the missing s_ prefix). Public routine — update callers (grep mpi_bcast_time_step_values).

2. Stutter type namessrc/common/m_boundary_common.fpp:24-25: MPI_BC_TYPE_TYPE and MPI_BC_BUFFER_TYPE. MPI_BC_TYPE_TYPE has a doubled _TYPE. Suggest mpi_bc_type_dtype / mpi_bc_buffer_dtype. Module-private → contained blast radius.

3. Builtin-shadowing locals in toolchain/mfc/case_validator.py:

  • format = self.get("format") (L1529) shadows the format builtin.
  • for dir in ["x", "y", "z"]: shadows the dir builtin at L428, L825, L931, L1163, L1339.
    Rename loop var to axis and the local to output_format/fmt. (Note the file is internally inconsistent — it already uses format_val/direction elsewhere.)

4. Bare is1/is2/is3 module names in src/simulation/m_cbc.fpp:64 lack the disambiguating suffix used elsewhere (is1_weno, is1_muscl, is1_viscous). m_riemann_solvers.fpp/m_rhs.fpp also use bare is1/is2/is3, so if renamed for clarity it should be done consistently — lowest-priority item; could be left as-is.

None of these touch generated output → no golden-file risk. Items 1-2 are the most worthwhile (an outright-wrong name and a stutter); 3 is a lint-hygiene win; 4 is optional.


Filed from a repo-wide code-cleanliness review; verified against master @ 40dde5e.

Code references

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    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