Skip to content

chore: remove commented-out code - #1803

Merged
sbryngelson merged 1 commit into
masterfrom
cleanup/remove-commented-out-code
Sep 2, 2026
Merged

chore: remove commented-out code#1803
sbryngelson merged 1 commit into
masterfrom
cleanup/remove-commented-out-code

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Removes 24 commented-out source lines across 11 files. Nothing executable changes: every deleted line is a comment, and the only two added lines are a restored note and an ffmt re-alignment.

Found while investigating sbryngelson/ffmt#9, where re-wrapping mangled several of these blocks. The formatter fix is separate; this removes the lines that had no reason to be there in the first place.

Dead code

File What
post_process/m_data_input.f90 a scalar_field declaration of ib_markers, superseded by the live integer_field declaration on the next line
simulation/m_bubbles_EL.fpp three write statements for a voidfraction.dat header that is no longer emitted; the branch still opens the file
simulation/m_collisions.fpp a debug print, and a pair of s_get_neighborhood_idx calls that the collision_lookup assignments above them replaced
simulation/m_riemann_state.fpp zeroing of current_tau_shear and current_tau_bulk that s_calculate_shear_stress_tensor and s_calculate_bulk_stress_tensor already do
common/include/macros.fpp a debug print and three cudaGetErrorString writes
common/include/2dHardcodedIC.fpp three abandoned alternative B-field and energy formulas beside the live one in the MHD blast case

The macros.fpp print line had absorbed the note set preferred location GPU during an earlier comment re-wrap. That note describes the live cudaMemAdvise call below it, so it is restored on its own line, matching the set accessed by CPU and prefetch to GPU stanzas that follow.

Disabled GPU directives

  • ! $:USE_GPU_MODULE() in m_body_forces, m_weno, m_global_parameters
  • ! $:GPU_LOOP(parallelism='[seq]') at four sites in m_compute_cbc
  • ! $:GPU_DECLARE(...) in m_global_parameters and m_phase_change

These read as parked experiments rather than active toggles. Git history keeps them if a backend ever needs one revived.

Left alone

Nine comments that a statement-shaped scan flags but that are prose, not code: ! r(th) = a + b*th, ! tan(Omega/2) = numerator / denominator, the Orszag-Tang initial-condition description, and similar.

Verification

Two deletions had formatting consequences, both applied by ffmt 0.4.4: removing the ib_markers comment changed its declaration block, so the surviving line was re-aligned, and removing USE_GPU_MODULE from m_weno left a stray blank line in the use block. ffmt --check src passes on the result.

Diff is 2 insertions and 29 deletions (24 comments, 3 blanks, and the ib_markers line re-added with new alignment).


Acknowledgement

  • I confirm this PR meets the above expectations and reflects my own understanding and real-world context.

Deletes 24 commented-out source lines that no longer serve a purpose.
Nothing executable changes.

Dead code:

- m_data_input.f90: a scalar_field declaration of ib_markers superseded
  by the live integer_field declaration on the next line.
- m_bubbles_EL.fpp: three write statements for a voidfraction.dat header
  that is no longer emitted.
- m_collisions.fpp: a debug print, and a pair of s_get_neighborhood_idx
  calls replaced by the collision_lookup assignments above them.
- m_riemann_state.fpp: zeroing of current_tau_shear and current_tau_bulk
  that s_calculate_shear_stress_tensor and s_calculate_bulk_stress_tensor
  already perform.
- macros.fpp: a debug print and three cudaGetErrorString writes. The
  print line had absorbed the "set preferred location GPU" note during a
  comment re-wrap, so that note is restored on its own line to match the
  sibling stanzas.
- 2dHardcodedIC.fpp: three abandoned alternative B-field and energy
  formulas beside the live one in the MHD blast case.

Disabled GPU directives:

- USE_GPU_MODULE in m_body_forces, m_weno, m_global_parameters
- GPU_LOOP(parallelism='[seq]') at four sites in m_compute_cbc
- GPU_DECLARE in m_global_parameters and m_phase_change

Git history keeps these if a backend ever needs one revived.

Removing the ib_markers comment changed its declaration block, so ffmt
re-aligned the surviving line; removing USE_GPU_MODULE from m_weno left
a stray blank line in the use block. Both were applied by ffmt 0.4.4.
Copilot AI lite review requested due to automatic review settings September 2, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The diff is comment-only cleanup (plus harmless alignment/comment reflow) with no executable logic changes observed in the reviewed hunks.

Pull request overview

Removes legacy commented-out “dead code” and parked GPU-macro experiments across simulation/post_process/common, plus a small comment reflow to restore a CUDA UVM note in the Fypp macro helpers.

Changes:

  • Deleted commented-out debug/alternative-formula blocks and disabled GPU macro directives that were no longer serving as active toggles.
  • Removed stale commented assignments in viscous source calculations and old header writes for voidfraction.dat.
  • Restored/realigned a note describing the live cudaMemAdvise “preferred location” stanza and re-aligned one declaration affected by comment removal.
File summaries
File Description
src/simulation/m_weno.fpp Removes a commented-out USE_GPU_MODULE macro line from the use block.
src/simulation/m_riemann_state.fpp Removes commented-out zeroing of stress tensors next to the live tensor calculation calls.
src/simulation/m_global_parameters.fpp Drops commented-out GPU macro lines adjacent to active GPU_DECLARE usage.
src/simulation/m_compute_cbc.fpp Removes commented-out GPU_LOOP(parallelism='[seq]') markers above CPU do loops.
src/simulation/m_collisions.fpp Removes commented debug print and a commented-out neighborhood-index call line.
src/simulation/m_bubbles_EL.fpp Removes commented-out legacy header writes for voidfraction.dat creation path.
src/simulation/m_body_forces.fpp Removes a commented-out USE_GPU_MODULE macro line from the module header.
src/post_process/m_data_input.f90 Removes a stale commented ib_markers declaration and re-aligns the live one.
src/common/m_phase_change.fpp Removes commented-out GPU_DECLARE lines for locals now covered by loop-private declarations.
src/common/include/macros.fpp Restores a standalone comment note (“set preferred location GPU”) and removes commented cudaGetErrorString writes.
src/common/include/2dHardcodedIC.fpp Removes commented-out alternative B-field/energy formulas next to the live MHD IC expression.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sbryngelson
sbryngelson merged commit 814f7a5 into master Sep 2, 2026
87 of 90 checks passed
@sbryngelson
sbryngelson deleted the cleanup/remove-commented-out-code branch September 2, 2026 18:44
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.69%. Comparing base (ac08ffe) to head (fac0995).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1803   +/-   ##
=======================================
  Coverage   61.69%   61.69%           
=======================================
  Files          84       84           
  Lines       21620    21621    +1     
  Branches     3196     3203    +7     
=======================================
+ Hits        13338    13339    +1     
  Misses       6090     6090           
  Partials     2192     2192           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants