Port check diffusive CFL loop in MOM tracer hor diff - #89
Open
uwagura wants to merge 1 commit into
Open
Conversation
GPU Port CoverageOverall: 2046 / 5662 portable executed lines ported (36.1%) Files touched by this PR: 36 / 42 portable executed lines ported (85.7%) Full per-file / per-routine breakdown: see the "gpu-port-report" job summary and artifact. |
edoyango
approved these changes
Aug 7, 2026
edoyango
left a comment
Collaborator
There was a problem hiding this comment.
clearly i wasn't disciplined enough with wrapping sections with !$omp target update! thx for persisting with this.
Ofc the hang decided not to show up when i actually want it, but it looks reasonable and reproduces answers.
Comment on lines
+394
to
+398
| do concurrent (j=js:je, i=is:ie) DO_LOCALITY(reduce(max:max_CFL)) | ||
| CFL(i,j) = 2.0*((khdt_x(I-1,j) + khdt_x(I,j)) + & | ||
| (khdt_y(i,J-1) + khdt_y(i,J))) * G%IareaT(i,j) | ||
| if (max_CFL < CFL(i,j)) max_CFL = CFL(i,j) | ||
| enddo ; enddo | ||
| max_CFL = max(max_CFL, CFL(i,j)) | ||
| enddo |
Collaborator
There was a problem hiding this comment.
Suggested change
| do concurrent (j=js:je, i=is:ie) DO_LOCALITY(reduce(max:max_CFL)) | |
| CFL(i,j) = 2.0*((khdt_x(I-1,j) + khdt_x(I,j)) + & | |
| (khdt_y(i,J-1) + khdt_y(i,J))) * G%IareaT(i,j) | |
| if (max_CFL < CFL(i,j)) max_CFL = CFL(i,j) | |
| enddo ; enddo | |
| max_CFL = max(max_CFL, CFL(i,j)) | |
| enddo | |
| do concurrent (j=js:je, i=is:ie) DO_LOCALITY(reduce(max:max_CFL)) | |
| max_CFL = max(max_CFL, 2.0*((khdt_x(I-1,j) + khdt_x(I,j)) + & | |
| (khdt_y(i,J-1) + khdt_y(i,J))) * G%IareaT(i,j)) | |
| enddo |
This is just a suggestion, so you don't have to take it since it's noncritical. CFL (the array) isn't used anywhere else, so it could be removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a block of code in MOM_tracer_hor_diff that only ran when
check_diffusive_CFLwas true. This setting is true in benchmark_ALE, but not in benchmark. Since thekhdt_*arrays needed for this block of code were set on the device , the host values used for this calculation contained garbage values in benchmark_ALE, which could occasionally cause thenum_ittsvariable set in this block to take on extremely large values and make the benchmark_ALE config appear to hang.This PR simply ports this block of code so that
max_CFL, and by extensionnum_itts, are always set correctly.