Remove dead ACC loop directives in s_derive_center_of_mass#1282
Remove dead ACC loop directives in s_derive_center_of_mass#1282sbryngelson wants to merge 2 commits intoMFlowCode:masterfrom
Conversation
The two $:GPU_LOOP(parallelism='[seq]') directives before the c_m zero-initialization loops in s_derive_center_of_mass were outside any GPU parallel region and were silently ignored by the compiler (CCE 19.0.0 warns ftn-7255: "loop marked for accelerator worksharing but not inside an accelerator region"). The initialization runs on CPU before the GPU_UPDATE that pushes c_m to device. Replace the nested loop with a simple Fortran array assignment, which is idiomatic and eliminates the dead directives. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code ReviewHead SHA: b1dc5c9 Files changed: 1
Summary:
Findings: No issues found. The change is correct and minimal. Improvement opportunities (optional):
|
Review Summary by QodoRemove dead ACC loop directives in s_derive_center_of_mass
WalkthroughsDescription• Remove dead ACC loop directives causing compiler warnings • Replace nested loop with idiomatic Fortran array assignment • Simplify c_m initialization while maintaining correctness Diagramflowchart LR
A["Nested loop with GPU_LOOP directives"] -->|"Replace with"| B["Array assignment c_m = 0.0"]
B -->|"Result"| C["Eliminates ftn-7255 warning"]
C -->|"Maintains"| D["Correct GPU_UPDATE behavior"]
File Changes1. src/simulation/m_derived_variables.fpp
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
Claude Code ReviewHead SHA: e96a3b8 Files changed: 1
Summary
FindingsNo correctness issues. The change is correct and minimal:
Opportunities
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe file 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Claude Code ReviewHead SHA: e96a3b8 Files changed: 1
Summary:
Findings: No correctness issues found.
Improvement opportunity (minor, optional): Overall: clean, minimal, and correct fix. Approved. ✓ |
There was a problem hiding this comment.
Pull request overview
This PR removes dead/ineffective GPU loop directives in s_derive_center_of_mass and replaces a nested zero-initialization loop with an idiomatic Fortran whole-array assignment, eliminating a CCE warning about accelerator worksharing outside an accelerator region.
Changes:
- Replace CPU-side nested loops initializing
c_mwithc_m(:, :) = 0.0_wp. - Remove two
$:GPU_LOOP(parallelism='[seq]')directives that expanded to ignored!$acc loop seqoutside an accelerator region.
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoRemove dead ACC loop directives in s_derive_center_of_mass
WalkthroughsDescription• Remove dead ACC loop directives causing CCE compiler warnings • Replace nested initialization loop with idiomatic array assignment • Simplify code while maintaining identical functionality Diagramflowchart LR
A["Nested loop with<br/>GPU_LOOP directives"] -->|"Replace with"| B["Array assignment<br/>c_m = 0.0"]
B -->|"Result"| C["No compiler warnings<br/>Same functionality"]
File Changes1. src/simulation/m_derived_variables.fpp
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
Claude Code ReviewHead SHA: e96a3b8 Files changed: 1
Summary:
Findings: No correctness issues found. The change is straightforward and safe:
No issues found. This is a clean removal of dead/incorrect GPU directives with no functional change. Ready to merge. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1282 +/- ##
=======================================
Coverage 44.95% 44.95%
=======================================
Files 70 70
Lines 20504 20503 -1
Branches 1946 1946
=======================================
Hits 9217 9217
+ Misses 10166 10165 -1
Partials 1121 1121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
s_derive_center_of_mass(m_derived_variables.fpp), two$:GPU_LOOP(parallelism='[seq]')directives appeared before thec_mzero-initialization loops, outside any GPU parallel region.!$acc loop seqwith no surrounding!$acc parallel/!$acc kernels, so the compiler silently ignored them. CCE 19.0.0 correctly warns:ftn-7255: loop marked for accelerator worksharing but not inside an accelerator region.$:GPU_UPDATE(device='[c_m]')immediately after — the structure is correct, the directives were just dead code.c_m(:, :) = 0.0_wp, which is idiomatic Fortran and eliminates the spurious directives.Test plan
ftn-7255warning is gone from the CCE 19.0.0 (cpe/25.03) build ofsimulations_derive_center_of_massproduces identical results (center-of-mass values unchanged)🤖 Generated with Claude Code