Skip to content

Shift the RightFaceFolded fold upwards by one row#5408

Merged
simone-silvestri merged 28 commits intomainfrom
ss-bp/update-fpivot-tripolar
Mar 25, 2026
Merged

Shift the RightFaceFolded fold upwards by one row#5408
simone-silvestri merged 28 commits intomainfrom
ss-bp/update-fpivot-tripolar

Conversation

@simone-silvestri
Copy link
Copy Markdown
Collaborator

@simone-silvestri simone-silvestri commented Mar 17, 2026

Given the difficulties of #5381 which probably require one extra MPI pass we want to avoid, we have decided to revisit the definition of a RightFaceFolded tripolar grid by shifting upwards by one row the tripolar fold. This has a couple of consequences:

  • fields Centered in y have a nice and well-behaved prognostic domain that goes from 1:Ny where all the halos are filled by the fold BC
  • fields on y-Faces are a bit more problematic since the prognostic domain extends up to Ny+1, where the Ny+1 row mirrors the Center Ny row for a RightCenterFolded tripolar grid, where half is prognostic and half is repeated. With this fold location we can leverage the symmetry with the UPivot boundary condition. The main downside is the need to extend all the kernels to Ny + 1 given that the prognostic domain extends one-row up. For all other purposes, the RightFaceFolded topology switches from behaving as a Periodic/FullyConnected/RightConnected/RightCenterFolded topology to behaving as a Bounded/LeftConnected topology, where the Face fields have one extra point than the Center fields.

For this reason this PR introduces a grid_worksize, which is the size of the grid used for kernel launching (I am up to changing the name). This defaults to size(grid) for all grids except for a right-face-folder tripolar grids where it returns Ny+1 at the second spot.

cc @briochemc


Adding these TripolarGrid visualisations from validation/, made with the code in this PR:

image

Also adding this visualisation taken from PR #5405 below (not merged yet so I copied the julia code, updated it, and ran it). If anything was off the half circles would not be centred around the pivot points, so LGTM!

image

@briochemc
Copy link
Copy Markdown
Collaborator

FWIW it passed the more comprehensive tests from PR #5405 locally for me! 🚀

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

Probably a good practice is to merge #5099 so that we have a test that exercises the dynamics next to the seam and we are sure that this PR does not change the dynamics on a RightFaceFolded tripolar grid

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.03%. Comparing base (e3dc01d) to head (d7b4e27).

Files with missing lines Patch % Lines
...Models/interleave_communication_and_computation.jl 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5408      +/-   ##
==========================================
+ Coverage   74.00%   74.03%   +0.03%     
==========================================
  Files         398      399       +1     
  Lines       22834    22830       -4     
==========================================
+ Hits        16898    16903       +5     
+ Misses       5936     5927       -9     
Flag Coverage Δ
buildkite 68.93% <81.39%> (+0.68%) ⬆️
julia 68.93% <81.39%> (+0.68%) ⬆️
reactant_unit 3.77% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

@briochemc I opened this PR so cannot approve. If you approve though, I merge

simone-silvestri and others added 2 commits March 25, 2026 08:08
Copy link
Copy Markdown
Collaborator

@briochemc briochemc left a comment

Choose a reason for hiding this comment

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

I'm happy to merge this as I think it's cleaner than what we had before. I'm also eager to move on to the distributed version because I can't seem to get any speedup on my Claude-bloated PR with extra MPI passes 😅

@simone-silvestri simone-silvestri merged commit 85ba915 into main Mar 25, 2026
41 of 66 checks passed
@simone-silvestri simone-silvestri deleted the ss-bp/update-fpivot-tripolar branch March 25, 2026 12:20
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.

4 participants