-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'worleyph/cam/pdf_closure_call_opt' (PR #1033)
Working around implicit array copies in CLUBB subroutine calls In the routine advance_clubb_core (in cam/src/physics/clubb/advance_clubb_core_module.F90) there are loops of the form: do k = 1, gr%nz, 1 call pdf_closure & (... zm2zt( wpthlp, k ), rtpthlp_zt(k), sclrm(k,:), & ! intent(in) wpsclrp_zt(k,:), sclrp2_zt(k,:), sclrprtp_zt(k,:),& ! intent(in) sclrpthlp_zt(k,:), k, & ! intent(in) wphydrometp_zt(k,:), wp2hmp(k,:), & ! intent(in) ... rtphmp_zt(k,:), thlphmp_zt(k,:), & ! intent(in) wpsclrprtp(k,:), wpsclrp2(k,:), sclrpthvp_zt(k,:),& ! intent(out) wpsclrpthlp(k,:), sclrprcp_zt(k,:), wp2sclrp(k,:),& ! intent(out) ... ) Each of the 15 arrays of the form XXX(k,:) is declared internally as an array of size XXX(:), and the compilers apparently are creating local temporaries and copying into and out of these. This is pretty low level (being inside loops over first chunks, then local columns, and then nadv). Explicitly allocating temporary arrays of the correct dimensions and copying into (for intent(in)) and out of (for intent(out)) external to the call to pdf_closure improves performance. For the Intel compiler on Titan, this drops the cost by around 15%. For the PGI compiler on Titan, this decreases the cost by a factor of 6. This modification only modifies two of the loops containing calls to pdf_closure, as these are the only two that are exercized in the current ACME test cases. There are two others that should be modified in analogous ways if l_use_ice_latent is true. Fixes #1031 [BFB] * worleyph/cam/pdf_closure_call_opt: Rearranged code so that it passes Skybridge testing Added an if condition for fixing ONE TRIP behavior of some compilers. Working around implicit array segment copies
- Loading branch information
Showing
1 changed file
with
93 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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