Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug for Nx Ny in swath grid #2840

Merged
merged 5 commits into from
May 23, 2024
Merged

Fix a bug for Nx Ny in swath grid #2840

merged 5 commits into from
May 23, 2024

Conversation

metdyn
Copy link
Contributor

@metdyn metdyn commented May 22, 2024

Types of change(s)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist

  • Tested this change with a run of GEOSgcm
  • Ran the Unit Tests (make tests)

Description

In swath grid, e.g.,
im_world 135
jm_world 7851
when Ncore=3456
the default gives Nx ~ sqrt(2Ncore), Ny= Ncore /Nx
such that floor ( im_world / Nx ) = 1

function generate_new_decomp tries to correct it, but violate Nx * Ny = Ncore.
Printout below:

 bf check fill consistency
 ims            2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           2           2           2
           2           2           2           1           1           1
           1           1           1           1           1           1
 jms          164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         163         163         163
         163         163         163         163         163         163
         163         163         163         163         163         163
         163         163         163         163         163         163
 im_world          135
 jm_world         7851
 af  this%generate_newnxy
 af check fill consistency
 ims            4           4           4           4           4           4
           4           4           4           4           4           4
           4           4           4           4           4           4
           4           4           4           4           4           4
           4           4           4           3           3           3
           3           3           3           3           3           3
 jms          164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         164         164         164
         164         164         164         163         163         163
         163         163         163         163         163         163
         163         163         163         163         163         163
         163         163         163         163         163         163
 im_world          135
 jm_world         7851

Related Issue

@metdyn metdyn requested a review from a team as a code owner May 22, 2024 06:34
tclune
tclune previously approved these changes May 22, 2024
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

I will approve, but you might want to look at how domain decomposition is done in MAPL3 for this problem:

associate (aspect_ratio => real(dims(1))/dims(2))
nx_start = max(1, floor(sqrt(petCount * aspect_ratio)))
do nx = nx_start, 1, -1
if (mod(petcount, nx) == 0) then ! found a decomposition
exit
end if
end do
end associate

@metdyn
Copy link
Contributor Author

metdyn commented May 22, 2024

Thanks. I have added a note to indicate using the same algorithm from above. I am checking if this modification works for 124416 cores.

@metdyn
Copy link
Contributor Author

metdyn commented May 22, 2024

I am able to run MAPL C720 with ncore=3456, not specifying NX and NY for swath.
This setup will accomodate the 6hr Epoch swath running on 100,000 cores.

CS grid:           NX: 24 ;   NY: 144
        sampler: DEBUG: Xdim, Ydim   96 8100
        sampler: DEBUG:  nx, ny (check_and_fill_consistency) =     48     72
        sampler: DEBUG: Xdim, Ydim  135 8051
        sampler: DEBUG:  nx, ny (check_and_fill_consistency) =     64     54
        sampler: DEBUG: Xdim, Ydim  135 7851
        sampler: DEBUG:  nx, ny (check_and_fill_consistency) =     64     54

@tclune tclune self-requested a review May 23, 2024 12:43
@tclune tclune added 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. Changelog Skip Skips the Changelog Enforcer labels May 23, 2024
@tclune tclune merged commit 3d4c7d8 into develop May 23, 2024
42 of 46 checks passed
@tclune tclune deleted the feature/ygyu/NxNy_swath branch May 23, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch. Changelog Skip Skips the Changelog Enforcer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants