Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Parameterize SubtileGridSizer to allow variation of the padding on non-interface field#347

Merged
FlorianDeconinck merged 9 commits intoNOAA-GFDL:developfrom
FlorianDeconinck:feat/better_hybridization_with_fortran
Jan 8, 2026
Merged

Parameterize SubtileGridSizer to allow variation of the padding on non-interface field#347
FlorianDeconinck merged 9 commits intoNOAA-GFDL:developfrom
FlorianDeconinck:feat/better_hybridization_with_fortran

Conversation

@FlorianDeconinck
Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck commented Dec 29, 2025

🧱🧱 BLOCKED BEHIND GridTools/gt4py#2426 🧱🧱

Description

In order to allow zero-copy memory mapping from Fortran (case of GEOS) we need to parameterize GridSizer and children to allow variation of the padding on non-interface field. This PR takes care of it by requiring the backend and checking it's Fortran friendliness. Further discussion should question the need for padding altogether.

This will lead to an API break down the road, as we know require the backend to be given to the SubtileGridSizer.

Also:

  • Add function to check that backend is "fortran aligned"

How has this been tested?

New unit test.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. add new modules to docs/docstrings/)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

@FlorianDeconinck FlorianDeconinck added the Enhancement New feature or request label Dec 29, 2025
@FlorianDeconinck
Copy link
Collaborator Author

@oelbert for visibility.

In Pace after the January release, you will be required to give backend to the SubtileGridSizer. For now nothing change but warning will pop.

@fmalatino fmalatino self-requested a review December 29, 2025 18:44
romanc
romanc previously requested changes Jan 7, 2026
Copy link
Collaborator

@romanc romanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can avoid it, I wouldn't change the GridSizer base class (see inline).

@FlorianDeconinck FlorianDeconinck marked this pull request as ready for review January 7, 2026 14:48
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just generally if we're already touching this: Is there a case where we want to turn on or off (ij) and k padding independently - physics vs dynamics? Or do we acutally think padding shoud in the long term go completely and not worry about it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need to do padding for cache line prefetch, we can do it via the strides rather than element count. So I'd vote no, it should just go away.

@FlorianDeconinck FlorianDeconinck added this pull request to the merge queue Jan 8, 2026
Merged via the queue into NOAA-GFDL:develop with commit d233c87 Jan 8, 2026
6 checks passed
Copy link
Collaborator

@romanc romanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

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

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants