-
Notifications
You must be signed in to change notification settings - Fork 355
Add the option for inactive top cells #825
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
Add the option for inactive top cells #825
Conversation
TestingCOMPASS (3/22)As a baseline in COMPASS, I'm using the The COMPASS branch used for testing is the one in MPAS-Dev/compass#55 plus the same commit from above for the The results from the E3SMThe following E3SM tests are bit-for-bit when compared with
These tests are failing with diffs (the first is the same as a test above but not in
The following E3SM tests have passed (but where not compared with E3SM/master):
|
|
@cbegeman, as I noted above, a corresponding PR into |
@cbegeman, could you re-test on Grizzly with the new COMPASS branch I created? I'll re-test on Anvil. |
Yes, we get bfb with the new COMPASS branch on Grizzly. |
@cbegeman, E3SM tests vs. baseline are failing. Here are some details. When I do a test merge at the following commits, I am indicating which pass and which fail Commits failing:
Commits passing:
So the problem is c85f36c. We need to take that commit out. |
If the QU240 analysis is failing without this, I wonder if it's also failing with ocean/develop. It's hard to see how this could be caused by our changes. |
f881969
to
e063a30
Compare
So QU240-Analysis is now passing with MPAS-Dev/compass#55, which suggests that the difference is due to the xylar/compass/add_z_level_sub_ice_shelf_2D commits. I'll retest this branch without commit c85f36c with xylar/compass/add_z_level_sub_ice_shelf_2D. Tests also pass with xylar/compass/add_z_level_sub_ice_shelf_2D so we're good to go without that commit. |
If it's still failing, let me know. Something to fix for phase 2. |
@cbegeman, I haven't had a chance yet but I'll retest everything on Anvil soon, then try again on Compy. |
@@ -1759,11 +1759,11 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{ | |||
.or.lat>- 2.5.and.lat< 2.5 & | |||
.or.lat> 35.0.and.lat< 40.0 & | |||
.or.lat> 55.0.and.lat< 60.0 ) then | |||
do k = 1, config_reset_debugTracers_top_nLayers | |||
do k = minLevelCell(iCell), minLevelCell(iCell)+config_reset_debugTracers_top_nLayers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upper limit of this loop should also have the -1
appended (like line 1750)
8c840f5
to
7cd11b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still working on 3 (slow) tests on Compy. I will update my "Testing" comment and post the list of completed tests on E3SM-Project/E3SM#4171 once they are done. |
@dengwirda and @philipwjones please approve. We hope to merge today or tomorrow. |
@mattdturner @cbegeman @xylar Has anyone looked at the performance/timing diffs for these changes in any of the tests with optimization on? |
@philipwjones, I don't believe so. We were not given a clear idea of what we needed to be looking at in which tests. This is a bit part of what we were requesting your help with both in your review here and in the design doc. |
@philipwjones I just ran a quick test on Chrysalis. Test case: Before these changes:
After these changes are applied:
|
@philipwjones Timing differences between the runs appear to be in the noise: Test case: Before these changes: Test case: Before these changes: Test case: Before these changes: |
Thanks @cbegeman and @mattdturner - I also ended up doing a couple of quick tests. PGI on Summit may be slightly faster but in the noise. Intel/grizzly slightly slower at 1-2% level but Intel tends to do a better job of vectorizing so probably more impacted by this change and not surprising. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve based on testing by myself and others, prior discussions on design, and visual inspection of a few routines.
Thanks for the testing, @philipwjones! That's helpful. I'm also not surprised to see a little slowdown. I was guessing that PGI might show some (especially because it's the only compiler where we're seeing non-bit-for-bit results for the optimized code). I'll see what timings look like when my last run on Compy finishes. |
N = maxLevelCell(iCell) | ||
|
||
! A is lower diagonal term | ||
A(1)=0.0_RKIND | ||
do k = 2, N | ||
A(Nsurf)=0.0_RKIND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a slightly different treatment of zeroing-out unneeded entries in the tridiagonals between tracer_vmix_tend_implicit
and vel_vmix_tend_implicit
?
It looks like A(1:Nsurf) = 0.0
, etc is done in vel_vmix
, but only A(Nsurf) = 0.0
in tracer_vmix
. I think there may only be a difference in unused values that are out of range, so I don't think this will impact results in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I didn't catch that because it is unused but we should be consistent. I'm happy to commit this change, but I might include it in phase 2 if including it here would hold up the merge since our tests are pretty much complete. @xylar or @mark-petersen do you have opinions about whether to commit this now or later?
A(Nsurf)=0.0_RKIND | |
A(1:Nsurf)=0.0_RKIND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm personally not worried about this, and think it can go into phase II --- I think the only difference would be that some array entries (that are never used) could be allocated with undefined values rather than being zeroed out.
This shouldn't happen in the minLevelCell=1
case anyway though, as A(1:Nsurf)
and A(Nsurf)
, etc should do the same zeroing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved based on visual inspection + compiling/running locally.
@dengwirda Thanks for your review! |
Timing on Compy
|
…xt (PR #4171) Update mpas-source: Add the option for inactive top cells Brings in a new mpas-source submodule with changes only to the ocean core. Inactive top cells are introduced to add flexibility to the vertical coordinate below ice shelves. For all existing mesh configurations, this simply substitutes arrays with values of 1 rather than a fixed character 1 for the lower bound of vertical loops in the code. See MPAS-Dev/MPAS-Model#825. [non-BFB] only for compy with PGI optimized (BFB in debug mode)
Update mpas-source: Add the option for inactive top cells Brings in a new mpas-source submodule with changes only to the ocean core. Inactive top cells are introduced to add flexibility to the vertical coordinate below ice shelves. For all existing mesh configurations, this simply substitutes arrays with values of 1 rather than a fixed character 1 for the lower bound of vertical loops in the code. See MPAS-Dev/MPAS-Model#825. [non-BFB] only for compy with PGI optimized (BFB in debug mode)
Thanks so much for the hard work on this, @cbegeman! Feel free to delete you branch and any others lying around from your testing. |
Change three init mode namelist options In conjunction with MPAS-Dev/MPAS-Model#825, The following namelist changes are needed: * config_alter_ICs_for_pbcs --> config_alter_ICs_for_pbs (to support both top and bottom cells) * config_pbc_alteration_type --> config_pc_alteration_type * config_use_rx1_constraint = .true. --> config_init_vertical_grid_type = 'haney-number' (to support a new z-level vertical grid)
Add the option for inactive top cells MPAS-Dev#825
…n/develop Enhance inactive top cells feature #840 Here, we extend the capability for Inactive top cells introduced by #825 to apply to additional model configurations besides those needed to run a basic ice shelf test case. More detail about the scope of this development is documented in #811. The variable minLevelCell and related minLevelEdge* and minLevelVertex* variables are added by analogy with maxLevel* variables. By default, there are no inactive top cells and minLevel* = 1. The main code changes are to k-loop limits and designating surface quantities as those at minLevel*.
…next (PR #4219) Update mpas-source: Enhance inactive top cells feature Brings in a new mpas-source submodule with changes only to the ocean core. It extends the capability for inactive top cells introduced by MPAS-Dev/MPAS-Model#825 to apply to additional model configurations besides those needed to run a basic ice shelf test case. More detail about the scope of this development is documented in MPAS-Dev/MPAS-Model#811. [BFB]
…4219) Update mpas-source: Enhance inactive top cells feature Brings in a new mpas-source submodule with changes only to the ocean core. It extends the capability for inactive top cells introduced by MPAS-Dev/MPAS-Model#825 to apply to additional model configurations besides those needed to run a basic ice shelf test case. More detail about the scope of this development is documented in MPAS-Dev/MPAS-Model#811. [BFB]
Add z-level versions of the sub-ice-shelf 2D test case These tests were used to test and debug the new minLevel* additions in MPAS-Dev/MPAS-Model#825 z_level_full_cells_const_S -- a test case with constant T and S, full top and bottom cells, and the JM equation of state. Should still remain stationary to nearly machine precision z_level -- the same test case but with stratified S (and rho) and partial top and bottom cells. The partial cells will induce further pressure gradient errors and a small flow. z_level has been added to the nightly regression suite.
Inactive top cells are introduced to add flexibility to the vertical coordinate below ice shelves.
This PR introduces phase 1 in the development documented in #811, which touches only the code needed to run a basic ice shelf test case.
The variable
minLevelCell
and relatedminLevelEdge*
andminLevelVertex*
variables are introduced by analogy withmaxLevel*
variables. By default, there are no inactive top cells andminLevel*
= 1. The main code changes are to k-loop limits and designating surface quantities as those atminLevel*
.