Remove dead ACC loop directives in s_derive_center_of_mass#1282
Draft
sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
Draft
Remove dead ACC loop directives in s_derive_center_of_mass#1282sbryngelson wants to merge 1 commit intoMFlowCode:masterfrom
sbryngelson wants to merge 1 commit 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):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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