Skip to content

Adjust gpu default block sizes in Isopycnal to account for halos and loop bounds - #87

Open
uwagura wants to merge 1 commit into
MOM6-GPU:dev/gpufrom
uwagura:fix/isopyncal-blocking
Open

Adjust gpu default block sizes in Isopycnal to account for halos and loop bounds#87
uwagura wants to merge 1 commit into
MOM6-GPU:dev/gpufrom
uwagura:fix/isopyncal-blocking

Conversation

@uwagura

@uwagura uwagura commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

My original implementation of blocking in MOM_isopycnal_slopes did not account for halos, or the fact that the loop bounds in this module run from js-1 to je in the meridional direction and is-1 to ie in the zonal direction. Since the default block size did not cover the entire range of these loops, we were performing multiple iterations in the zonal and meridional directions on the gpu and launching extra kernels. This PR fixes the default block sizes for gpu runs to account for the halos and loop bounds, which reduces the number of kernel launches and gives a a slight speedup.

…ctually covers range iterated over in calc_isoneutral_slopes
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

GPU Port Coverage

Overall: 2043 / 5662 portable executed lines ported (36.1%)
Since base branch: +0 ported lines (+-0.0 pp)

Files touched by this PR: 0 / 78 portable executed lines ported (0.0%)

Full per-file / per-routine breakdown: see the "gpu-port-report" job summary and artifact.

Full line-by-line coverage report

@JorgeG94 JorgeG94 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good

integer, dimension(2) :: EOSdom ! The i-computational domain for the equation of state
integer :: i, j, k, is, ie, js, je, nz
integer :: niblock, njblock, nkblock
integer :: isoneutral_halo

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
integer :: isoneutral_halo
integer, parameter :: isoneutral_halo = 1

Not sure what alistair + bob think if parameters, but imo neater and maybe helps the compiler.

! Local variables
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)+1) :: e ! The interface heights relative to mean sea level [Z ~> m]
integer :: niblock, njblock, nkblock
integer :: isoneutral_halo

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
integer :: isoneutral_halo
integer, parameter :: isoneutral_halo = 2

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.

3 participants