Remove j and add blocking for excf_nl_9c #222
Remove j and add blocking for excf_nl_9c #222MetBenjaminWent wants to merge 18 commits intoMetOffice:mainfrom
Conversation
There was a problem hiding this comment.
The changes are removing the j loop. When OpenMP was over j, it is now over i. Where j was blocked, i is blocked. Where the loop is OpenMP schedule is dynamic the i loop is blocked. The OpenMP clauses remain the same. This is a sensible approach. The only change required is for j to be set to 1 as a parameter for performance. There is also a trivial comment change.
There are a lot of whitespace changes but these are necessary as one loop is removed so the indentation should change.
| @@ -765,9 +765,9 @@ subroutine excf_nl_9c ( & | |||
| !----------------------------------------------------------------------- | |||
| ! 0. Calculate top-of-b.l. velocity scales and Prandtl number. | |||
| !----------------------------------------------------------------------- | |||
|
|
|||
| j = 1 | |||
There was a problem hiding this comment.
Please can j be a parameter?
| end do | ||
| end do | ||
| !$OMP end do | ||
|
|
||
| !$OMP do SCHEDULE(STATIC) | ||
|
|
||
| ! Note parallelised over j as k isn't independent |
There was a problem hiding this comment.
I think this comment will need to change to i?
|
It would seem that a parameter is a little unhappy! I'll have another investigation. |
|
Due to KGO failings now, I'm looking at grabbing the listing files to see if they indicate some changes. |
I've found this subroutine is very sensitive - even just setting a logical switch to a parameter (with the same setting as used to be passed in from um_physics_init_mod, see 1a95f12) broke kgo for me, so I backed off that bit of tidying up - as I wanted my first go at using git-hub to be as simple as possible! |
Yeah that is understandable rolling it back to what does work safely. I have seen in the past with CCE in other schemes, LFRic's current fast-debug (O2) settings (which are currently slightly harsher than the UM's) over-optimising things, especially when we change the source in ways which may be presenting other optimisations to the compiler, but in turn alters the KGOs. |
|
Listing files: |
iboutle
left a comment
There was a problem hiding this comment.
Happy with the KGO changes, but I think the KGO change for gungho_model_baroclinic must be accidental (since excf_nl wouldn't even be called in this run!)
Thanks Ian, yeah that seems to be on HoT given the nightlies: |
|
I'm happy as boundary_layer code owner but can't find anywhere to formally approve at the moment. |
Ditto for coupling aspects. |
Adrian-Lock
left a comment
There was a problem hiding this comment.
Happy with these changes




PR Summary
Sci/Tech Reviewer: @christophermaynard
Code Reviewer: @Pierre-siddall
Remove the j loop which is adversely affecting performance in the boundary layer, and improve blocking loops. Also parameterise j.
NOTE : Since parametising
j, 2x tests are failing KGO. As noted by the CO, this appears to be a sensitive routine with CCE O2. As advised by the listing files, the compiler is picking some different optimations as a result of all of the changes. Updating them shows they hold, confirming it is not a threading issue related to the change.Updated KGOs for:
lfric_atm_nwp_gal9-C12_ex1a_cce_fast-debug-64bitlfric_coupled_nwp_gal9-C48_ex1a_cce_fast-debug-64bitCode Quality Checklist
Testing
trac.log
Post KGO and Parameteration changes:
Test Suite Results - lfric_apps - excf_nl_9c_adjusted/run10
Suite Information
Task Information
❌ failed tasks - 6
Trac log pre paramertisation changes.
Test Suite Results - lfric_apps - excf_nl_9c_adjusted/run7
Suite Information
Task Information
✅ succeeded tasks - 51
Test Suite Results - lfric_apps - excf_nl_9c_adjusted/run8
Suite Information
Task Information
❌ failed tasks - 2
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review