Skip to content

Commit

Permalink
Merge pull request #144 from jedwards4b/fix_avgdt_add_nthreads_to_gcomp
Browse files Browse the repository at this point in the history
### Description of changes
Fixes the avgdt variable to output in correct units of wallclock seconds per simulation day.

In the CESM driver only, add the nthreads value from nuopc.runconfig to each components attributes. Since the CESM driver is include with CMEPS - this is in fact a CMEPS change but only relevant to the driver.

### Specific notes

Contributors other than yourself, if any:

CMEPS Issues Fixed (include github issue #):

Are changes expected to change answers?
 - [X] bit for bit
 - [ ] different at roundoff level
 - [ ] more substantial 

Any User Interface Changes (namelist or namelist defaults changes)?
 - [ ] Yes
 - [X] No

Testing performed if application target is CESM:(either UFS-S2S or CESM testing is required):
- [X] (required) CIME_DRIVER=nuopc scripts_regression_tests.py
   - machines:
   - details (e.g. failed tests):
- [X] (required) CESM testlist_drv.xml
   - machines and compilers: cheyenne intel, baseline is apr05
   - details (e.g. failed tests):
- [ ] (optional) CESM prealpha test
   - machines and compilers
   - details (e.g. failed tests):

Testing performed if application target is UFS-S2S:
- [ ] (required) UFS-S2S testing
   - description:
   - details (e.g. failed tests):

Hashes used for testing:
- [ ] CESM:
  - repository to check out: https://github.com/ESCOMP/CESM.git
  - branch: nuopc_dev
  - hash:
- [ ] UFS-S2S, then umbrella repository to check out and associated hash:
  - repository to check out:
  - branch:
  - hash:
  • Loading branch information
jedwards4b authored Apr 6, 2021
2 parents d49d38b + 8c91c62 commit 448a81c
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 103 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
- id: load-env
run: sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev
run: |
sudo apt-get update
sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev
- id: build-ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
run: |
Expand Down
8 changes: 8 additions & 0 deletions cime_config/buildexe
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def _main_func():
ocn_model = case.get_value("COMP_OCN")
atm_model = case.get_value("COMP_ATM")
gmake_args = get_standard_makefile_args(case)
esmf_aware_threading = case.get_value("ESMF_AWARE_THREADING")

# Determine valid components
valid_comps = []
Expand Down Expand Up @@ -73,6 +74,8 @@ def _main_func():
gmake_args += " {}_PRESENT=FALSE".format(comp)
if skip_mediator:
gmake_args += " MED_PRESENT=FALSE"
if esmf_aware_threading:
gmake_args += " USER_CPPDEFS=-DESMF_AWARE_THREADING"

gmake_args += " IAC_PRESENT=FALSE"
expect((num_esp is None) or (int(num_esp) == 1), "ESP component restricted to one instance")
Expand All @@ -93,6 +96,11 @@ def _main_func():
makefile = os.path.join(casetools, "Makefile")
exename = os.path.join(exeroot, cime_model + ".exe")

# always rebuild file esm.F90 this is because cpp macros in that file may have changed
esm = os.path.join(bld_root,"esm.o")
if os.path.isfile(esm):
os.remove(esm)

# always relink
if os.path.isfile(exename):
os.remove(exename)
Expand Down
9 changes: 9 additions & 0 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,15 @@
<desc>TRUE implies that at least one of the components is built threaded (DO NOT EDIT)</desc>
</entry>

<entry id="ESMF_AWARE_THREADING">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<group>mach_pes</group>
<file>env_mach_pes.xml</file>
<desc>TRUE indicates that the ESMF Aware threading method is used</desc>
</entry>

<entry id="USE_PETSC">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
12 changes: 1 addition & 11 deletions cime_config/config_component_cesm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@
<desc>run DOI</desc>
</entry>

<entry id="DRV_THREADING">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<group>run_flags</group>
<file>env_run.xml</file>
<desc>Turns on component varying thread control in the driver.
Used to set the driver namelist variable "drv_threading".</desc>
</entry>

<entry id="SAVE_TIMING">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down Expand Up @@ -541,7 +531,7 @@
<values match="last">
<value compset="_CLM.+CISM\d">TRUE</value>
<!-- Turn on two-way coupling for TG compsets - even though there are no
feedbacks for a TG compset, this will give us additional diagnostics -->
feedbacks for a TG compset, this will give us additional diagnostics -->
<value compset="_DLND.+CISM\d">TRUE</value>
</values>
<group>run_glc</group>
Expand Down
10 changes: 0 additions & 10 deletions cime_config/config_component_ufs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@
<desc>run DOI</desc>
</entry>

<entry id="DRV_THREADING">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>FALSE</default_value>
<group>run_flags</group>
<file>env_run.xml</file>
<desc>Turns on component varying thread control in the driver.
Used to set the driver namelist variable "drv_threading".</desc>
</entry>

<entry id="SAVE_TIMING">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
Expand Down
43 changes: 9 additions & 34 deletions cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,31 +178,6 @@
</values>
</entry>

<!-- <entry id="cpl_cdf64"> -->
<!-- <type>logical</type> -->
<!-- <category>expdef</category> -->
<!-- <group>DRIVER_attributes</group> -->
<!-- <desc> -->
<!-- default: true -->
<!-- </desc> -->
<!-- <values> -->
<!-- <value>.true.</value> -->
<!-- </values> -->
<!-- </entry> -->

<entry id="drv_threading" modify_via_xml="DRV_THREADING">
<type>logical</type>
<category>performance</category>
<group>DRIVER_attributes</group>
<desc>
turn on run time control of threading per pe per component by the driver
default: false
</desc>
<values>
<value>$DRV_THREADING</value>
</values>
</entry>

<entry id="run_barriers" modify_via_xml="COMP_RUN_BARRIERS">
<type>logical</type>
<category>performance</category>
Expand Down Expand Up @@ -732,7 +707,7 @@
<category>single_column</category>
<group>ALLCOMP_attributes</group>
<desc>
DOMAIN file needed for single column model IF and only if
DOMAIN file needed for single column model IF and only if
a nearest neighbor search is done to match the PTS_LAT and PTS_LON
to the closest point in the domain file. This file is ONLY used in
single column mode.
Expand Down Expand Up @@ -1072,7 +1047,7 @@
</desc>
<values>
<value>$MASK_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1085,7 +1060,7 @@
</desc>
<values>
<value>$ATM_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1098,7 +1073,7 @@
</desc>
<values>
<value>$LND_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1111,7 +1086,7 @@
</desc>
<values>
<value>$OCN_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1124,7 +1099,7 @@
</desc>
<values>
<value>$ICE_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1137,7 +1112,7 @@
</desc>
<values>
<value>$ROF_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1150,7 +1125,7 @@
</desc>
<values>
<value>$GLC_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand All @@ -1163,7 +1138,7 @@
</desc>
<values>
<value>$WAV_DOMAIN_MESH</value>
<value single_column='true'>null</value>
<value single_column='true'>null</value>
</values>
</entry>

Expand Down
20 changes: 20 additions & 0 deletions cime_config/testdefs/testlist_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@
</options>
</test>

<test compset="B1850" grid="f19_g17" name="ERS_Vnuopc_Ld5" testmods="allactive/nuopc_cap_io">
<machines>
<machine name="cheyenne" compiler="intel" category="nuopc"/>
<machine name="theia" compiler="intel" category="nuopc"/>
<machine name="izumi" compiler="intel" category="nuopc"/>
</machines>
<options>
<option name="wallclock"> 00:40:00 </option>
</options>
</test>

<!-- ======================================= -->
<!-- C compsets -->
<!-- ======================================= -->
Expand Down Expand Up @@ -386,6 +397,15 @@
<option name="wallclock"> 00:20:00 </option>
</options>
</test>
<test compset="I2000Clm50BgcCropRtm" grid="f10_f10_mg37" name="SMS_D_Ld5_Vnuopc" testmods="rtm/default">
<machines>
<machine name="cheyenne" compiler="intel" category="nuopc"/>
<machine name="izumi" compiler="nag" category="nuopc"/>
</machines>
<options>
<option name="wallclock"> 00:20:00 </option>
</options>
</test>

<!-- ======================================= -->
<!-- TG compsets -->
Expand Down
Loading

0 comments on commit 448a81c

Please sign in to comment.