NCAR / ccpp-physics

GFS physics for CCPP
Other
59 stars 146 forks source link

Add logic to reduce optimization for host-model provided GFS_typedefs.F90 #869

Closed climbfuji closed 2 years ago

climbfuji commented 2 years ago

Add logic to reduce optimization for multiple files, independent of their preceding paths, including the host-model provided GFS_typedefs.F90.

For GFS_typedefs.F90, this is slightly more complicated because the relative path to the file depends on the host model. The solution presented here will add -O1 to any GFS_typedefs.F90 when using Intel in release (PROD), regardless of the host model. We definitely do not want host-model specific code in CMakeLists.txt.

Duplicates for the auto-generated cmake include files need to be removed. This can also be done in the framework before writing the files, but even if that gets done having a second check here doesn't hurt.

This should fix the problem that @junwang-noaa reported (exceeding memory on wcoss_dell_p3 in compile jobs).

Tested to compile (and do the right thing) on Hera with Intel in PROD mode.

junwang-noaa commented 2 years ago

The compile works with -o0 option. Let me try creating baseline for Ted's PR.

grantfirl commented 2 years ago

@junwang-noaa Do you want this merged into #761 or brought in separately?

junwang-noaa commented 2 years ago

@grantfirl Please merge Dom's change to PR#761. I manually copied the code. So far no compile jobs failed in the baseline creation.

grantfirl commented 2 years ago

@climbfuji The fact that a host model file needs changes to a ccpp-physics CMakeLists.txt file for compilation is not intuitive to me. I thought that the build system refactor done a while back was supposed to create the correct separation in the various CMakeLists.txt?

grantfirl commented 2 years ago

@junwang-noaa I've provided instructions for the developer to bring in this bugfix: https://github.com/NCAR/ccpp-physics/pull/761#issuecomment-1058225529

junwang-noaa commented 2 years ago

Great! Once the baseline creation is done, I will check out a clean copy of your ufs-weather-model branch and run final RT on dell.