Skip to content

Reduce the mean sea-level pressure with the Field's own sum - #815

Open
dkytezab wants to merge 2 commits into
mainfrom
dkz/reactant-mean-sea-level-pressure
Open

dkytezab wants to merge 2 commits into
mainfrom
dkz/reactant-mean-sea-level-pressure

Conversation

@dkytezab

Copy link
Copy Markdown
Collaborator

Closes #814. Draft.

mean_sea_level_pressure reduces with sum(p₀), Oceananigans's reduction on the Field, instead of sum(interior(p₀)), a generic reduction over a view of device memory that errors on ReactantState. sum(p₀) returns a plain number on every architecture (Float32 on a Float32 ReactantState grid, the MWE in #814) and is rank-local like before, so the all_reduce across ranks is unchanged.

No new test: the function reads ERA5 single-level data, and the reduction on its own is what #814's MWE checks. Not yet run locally.

🤖 Generated with Claude Code

`sum(interior(p₀))` is a generic reduction over a view of device memory, which on ReactantState reads
element by element and errors. `sum(p₀)` reduces on the field's architecture and stays rank-local, so the
`all_reduce` across ranks is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dkytezab
dkytezab marked this pull request as ready for review October 23, 2026 20:42
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...umericalEarthBreezeExt/breeze_nested_atmosphere.jl 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mean_sea_level_pressure fails on ReactantState: generic sum over interior of a device field

3 participants