chore: remove commented-out code - #1803
Conversation
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.
There was a problem hiding this comment.
🟢 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
post_process/m_data_input.f90scalar_fielddeclaration ofib_markers, superseded by the liveinteger_fielddeclaration on the next linesimulation/m_bubbles_EL.fppwritestatements for avoidfraction.datheader that is no longer emitted; the branch still opens the filesimulation/m_collisions.fppprint, and a pair ofs_get_neighborhood_idxcalls that thecollision_lookupassignments above them replacedsimulation/m_riemann_state.fppcurrent_tau_shearandcurrent_tau_bulkthats_calculate_shear_stress_tensorands_calculate_bulk_stress_tensoralready docommon/include/macros.fppprintand threecudaGetErrorStringwritescommon/include/2dHardcodedIC.fppThe
macros.fppprint line had absorbed the noteset preferred location GPUduring an earlier comment re-wrap. That note describes the livecudaMemAdvisecall below it, so it is restored on its own line, matching theset accessed by CPUandprefetch to GPUstanzas that follow.Disabled GPU directives
! $:USE_GPU_MODULE()inm_body_forces,m_weno,m_global_parameters! $:GPU_LOOP(parallelism='[seq]')at four sites inm_compute_cbc! $:GPU_DECLARE(...)inm_global_parametersandm_phase_changeThese 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_markerscomment changed its declaration block, so the surviving line was re-aligned, and removingUSE_GPU_MODULEfromm_wenoleft a stray blank line in theuseblock.ffmt --check srcpasses on the result.Diff is 2 insertions and 29 deletions (24 comments, 3 blanks, and the
ib_markersline re-added with new alignment).Acknowledgement