Skip to content

Fix type instability and ghost-index bugs in DMStag corner/index helpers#244

Open
filoferra wants to merge 3 commits into
JuliaParallel:mainfrom
filoferra:dmstag-type-inference
Open

Fix type instability and ghost-index bugs in DMStag corner/index helpers#244
filoferra wants to merge 3 commits into
JuliaParallel:mainfrom
filoferra:dmstag-type-inference

Conversation

@filoferra

Copy link
Copy Markdown
Contributor

Fixes non-concrete return types (and the allocations that come with them) in DMStag's corner/index helpers.

Benchmarked on a 20x21 DMStag (ghosted boundaries, stencil width 2, single rank) via @allocated, Base.return_types, and @inferred.

Function Before After
getcorners_dmstag 1040 B/call, not inferred 80 B/call, inferred
getghostcorners_dmstag 864 B/call, not inferred 80 B/call, inferred
local_indices_dmstag 2944 B/call, not inferred 80 B/call, inferred

Renamed DMStagGetIndices to local_indices_dmstag (old name kept as Base.@deprecate alias) for julia convention

Filippo Ferrazzini and others added 3 commits July 2, 2026 15:50
getcorners_dmstag/getghostcorners_dmstag built intermediate Vectors and splatted them into CartesianIndex(...), making the return type non-concrete and boxing every downstream loop.
Old name kept as Base.@deprecate alias, and add global_indices_dmstag for the equivalent non-ghosted indices.
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.

2 participants