Skip to content

Fix Cray GPU routine macros: INLINENEVER directive and cray_inline scoping#1406

Open
sbryngelson wants to merge 2 commits intoMFlowCode:masterfrom
sbryngelson:cray-macro-fix
Open

Fix Cray GPU routine macros: INLINENEVER directive and cray_inline scoping#1406
sbryngelson wants to merge 2 commits intoMFlowCode:masterfrom
sbryngelson:cray-macro-fix

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

@sbryngelson sbryngelson commented May 7, 2026

Summary

  • Renames !DIR$ NOINLINE!DIR$ INLINENEVER in the cray_noinline branch of GPU_ROUTINE (the correct Cray CCE directive name)
  • Adds the missing $:cray_noinline_directive emission in the Cray+OpenACC path
  • Introduces cray_inline=True option for GPU_ROUTINE emitting !DIR$ INLINEALWAYS, used by s_compute_pressure
  • Fixes a scoping bug where !DIR$ INLINEALWAYS was incorrectly emitted on non-Cray OpenACC builds (e.g. NVIDIA nvfortran); the directive is now Cray-only, matching the cray_noinline pattern

Test plan

  • Verify Cray CCE OpenACC build compiles with correct !DIR$ INLINENEVER / !DIR$ INLINEALWAYS directives on targeted routines
  • Verify NVIDIA nvfortran OpenACC build does not emit any !DIR$ directives
  • Verify OpenMP target offload build is unaffected
  • Verify CPU-only build is unaffected
  • ./mfc.sh precheck -j 8 passes (all 6 lint gates)

@qodo-code-review
Copy link
Copy Markdown
Contributor

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

📝 Walkthrough

Walkthrough

The pull request updates GPU routine compilation directives for Cray Fortran. The GPU_ROUTINE macro in parallel_macros.fpp was modified to emit the Cray directive !DIR$ INLINENEVER <function_name> instead of !DIR$ NOINLINE <function_name> for its no-inline path, with adjustments to how the directive is computed and emitted across backend-specific conditional branches. Additionally, a directive emission line was added to the Cray+OpenACC inline branch. In m_variables_conversion.fpp, the s_compute_pressure routine's GPU compilation directive was changed from cray_noinline=True to cray_inline=True.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers the main changes and motivation, but the checklist is incomplete: Testing section lacks detail, GPU changes checklist is not expanded, and test plan items are unchecked. Expand the Testing section with specific details about how changes were validated across different compilers (Cray, NVIDIA nvfortran, OpenMP). Check the test plan items or provide evidence that verification was performed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main changes: fixing Cray GPU routine macros with INLINENEVER directive and cray_inline scoping fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.73%. Comparing base (d513442) to head (ee97ba7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1406      +/-   ##
==========================================
- Coverage   64.75%   64.73%   -0.02%     
==========================================
  Files          71       71              
  Lines       18721    18719       -2     
  Branches     1551     1547       -4     
==========================================
- Hits        12123    12118       -5     
  Misses       5640     5640              
- Partials      958      961       +3     

☔ View full report in Codecov by Sentry.
📢 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.

1 participant