Skip to content

Commit

Permalink
new workflow and compset aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Nov 20, 2024
1 parent 5ad92d4 commit 92cc047
Show file tree
Hide file tree
Showing 23 changed files with 335 additions and 69 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
workflow_call:
inputs:
compiler:
type: string
required: true

jobs:
test:
# This statement avoids failures in another instance (another compiler) to cancel this run
# it also prevents canceling the run using the cancel button on the github website
# another form (if: success() || failure()) should allow the cancel button to work but tests with that form didnt act as expected
if: always()
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CIME_MODEL: cesm
CIME_DRIVER: nuopc
# Since self runners can only run one step at a time this needs statement is not required
# needs: setup
runs-on: hpc-runner
defaults:
run:
shell: bash {0}
steps:
- name: Run ${{ inputs.compiler }} tests
# Allows the next step to run even if this one fails
continue-on-error: true
run: |
pwd
cd cime/scripts
module load cmake
# Need to use main queue to avoid memory overflow errors
qcmd -q main -v PROJECT=P93300606 -A P93300606 -l walltime=02:00:00 -- ./create_test --xml-machine derecho\
--xml-category github --no-run --compiler ${{ inputs.compiler }} --test-id ${GITHUB_RUN_ID}${{ inputs.compiler }}
- name: check status
run: |
cd $SCRATCH
# if no fails and no passes in expected fails then cleanup and exit 0 otherwise exit 1
./cs.status.${GITHUB_RUN_ID}${{ inputs.compiler }} --expected-fails-file $GITHUB_WORKSPACE/cime_config/testfiles/ExpectedTestFails.xml | grep FAIL | grep -v FAILURE
retcode = $?
if [ $retcode -eq 0 ]; then
exit 1
fi
# tests pass, clean up
rm -fr *.${GITHUB_RUN_ID}${{ inputs.compiler }}
exit 0
32 changes: 32 additions & 0 deletions .github/workflows/derecho.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: cesm-derecho-hosted
run-name: ${{ github.actor }} is testing the project

on:
pull_request:
branches: [ cesm3.0-alphabranch ]
types: [ labeled ]

jobs:

setup:
# only run this workflow if the label run-pr-tests is applied
if: ${{ github.event.label.name == 'run-pr-tests' }}
# currently hpc-runner is derecho.hpc.ucar.edu
runs-on: hpc-runner

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run git-fleximod
run: |
pwd
module list
./bin/git-fleximod update
build:
strategy:
matrix:
compiler: [gnu, intel, intel-oneapi, nvhpc]
uses: ./.github/workflows/build.yaml
with:
compiler: ${{ matrix.compiler }}
4 changes: 2 additions & 2 deletions .github/workflows/fleximod_test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
on:
push:
branches: [ master, cesm3.0-alphabranch ]
branches: [ cesm3.0-alphabranch ]
pull_request:
branches: [ master, cesm3.0-alphabranch ]
branches: [ cesm3.0-alphabranch ]
jobs:
fleximod-test:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
url = https://github.com/jedwards4b/ccs_config_cesm.git
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm1.0.8
fxtag = ccs_config_cesm1.0.10_update_default_ww3grid03
fxrequired = ToplevelRequired

[submodule "cime"]
Expand All @@ -56,9 +56,9 @@

[submodule "cam"]
path = components/cam
url = https://www.github.com/ESCOMP/CAM
url = https://www.github.com/jedwards4b/CAM
fxDONOTUSEurl = https://www.github.com/ESCOMP/CAM
fxtag = cam6_4_046
fxtag = remove_mct_submodule_update_config_component01
fxrequired = ToplevelRequired

[submodule "clm"]
Expand Down
38 changes: 21 additions & 17 deletions .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@
import argparse
from git_fleximod import utils

__version__ = "0.9.2"
__version__ = "0.9.3"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
which contains a file called filename """
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None

try:
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
output_to_caller=True ).rstrip()
except:
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None
return Path(root)

def get_parser():
description = """
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def main():
excludelist=excludelist,
)
if not gitmodules.sections():
sys.exit("No submodule components found")
sys.exit(f"No submodule components found, root_dir={root_dir}")
retval = 0
if action == "update":
submodules_update(gitmodules, root_dir, fxrequired, force)
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def sparse_checkout(self):
if superroot:
gitroot = superroot.strip()
else:
gitroot = self.root_dir.strip()
gitroot = self.root_dir
# Now need to move the .git dir to the submodule location
rootdotgit = os.path.join(self.root_dir, ".git")
while os.path.isfile(rootdotgit):
Expand Down
6 changes: 3 additions & 3 deletions .lib/git-fleximod/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.9.2"
version = "0.9.3"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <jedwards@ucar.edu>"]
maintainers = ["Jim Edwards <jedwards@ucar.edu>"]
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/jedwards4b/git-fleximod/"

[version]
current = "0.9.2"
current = "0.9.3"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
4 changes: 2 additions & 2 deletions .lib/git-fleximod/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def logger():
"submodule_name": "test_optional",
"status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0",
"status2" : "test_optional at tag MPIserial_2.4.0",
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)",
"status3" : "test_optional not checked out, out of sync at tag MPIserial_2.5.1, expected tag is MPIserial_2.4.0 (optional)",
"status4" : "test_optional at tag MPIserial_2.4.0",
"gitmodules_content": """
[submodule "test_optional"]
Expand All @@ -46,7 +46,7 @@ def logger():
"submodule_name": "test_alwaysoptional",
"status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c",
"status2" : "test_alwaysoptional at hash e5cf35c",
"status3" : "out of sync at tag None, expected tag is e5cf35c",
"status3" : "out of sync at tag MPIserial_2.5.1, expected tag is e5cf35c",
"status4" : "test_alwaysoptional at hash e5cf35c",
"gitmodules_content": """
[submodule "test_alwaysoptional"]
Expand Down
60 changes: 37 additions & 23 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,64 @@
- grid (optional regular expression match for grid to work with the compset)
</help>

<!-- 1850 compsets Default, Mosart, Wave for CESM3 -->
<!-- Concentration driven compsets for CESM3 -->

<compset>
<alias>BLT1850</alias>
<lname>1850_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<alias>B1850C_MTt4s</alias>
<lname>1850C_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<compset>
<alias>BLT1850_MARBL</alias>
<lname>1850_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<alias>B1850CM</alias>
<lname>1850C_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<compset>
<alias>BMT1850_MARBL</alias>
<lname>1850_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_SWAV</lname>
</compset>

<compset>
<alias>BLTHIST</alias>
<lname>HIST_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<alias>B1850C_MTso</alias>
<lname>1850C_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<compset>
<alias>BMT1850</alias>
<lname>1850_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<lname>1850C_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<compset>
<alias>BMT1850_MARBL</alias>
<lname>1850_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<alias>BHISTC_MTso</alias>
<lname>HISTC_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<compset>
<alias>BMTHIST</alias>
<lname>HIST_CAM70%MT_CLM60%BGC-CROP_CICE_MOM6_MOSART_DGLC%NOEVOLVE_SWAV</lname>
<alias>BHISTC_MTt4s</alias>
<lname>HISTC_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>
<compset>
<alias>BHISTCM</alias>
<lname>HISTC_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>


<!-- Prognostic wave -->


<!-- Data wave -->
<compset>
<alias>B1850C_LTso</alias>
<lname>1850C_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>
<compset>
<alias>BLT1850</alias>
<lname>1850C_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>
<compset>
<alias>BHISTC_LTso</alias>
<lname>HISTC_CAM70%LT_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<!-- Emissions driven compsets for CESM3 -->

<compset>
<alias>B1850E_MTt4s</alias>
<lname>1850E_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>
<compset>
<alias>B1850EM</alias>
<lname>1850E_CAM70%MT%CT4S_CLM60%BGC-CROP_CICE_MOM6%MARBL-BIO_MOSART_DGLC%NOEVOLVE_WW3</lname>
</compset>

<!-- SOM compsets -->

Expand Down
8 changes: 4 additions & 4 deletions cime_config/config_pes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<rootpe_cpl>0</rootpe_cpl>
</rootpe>
</pes>
<pes pesize="M" compset="CAM.*%MT.*MOM6%[^_]*MARBL-BIO">
<!-- <pes pesize="M" compset="CAM.*%MT.*MOM6%[^_]*MARBL-BIO">
<comment></comment>
<ntasks>
<ntasks_atm>5400</ntasks_atm>
Expand Down Expand Up @@ -107,10 +107,10 @@
<rootpe_wav>0</rootpe_wav>
<rootpe_cpl>0</rootpe_cpl>
</rootpe>
</pes>
</pes> -->
<pes pesize="XL" compset="CAM.*%LT.*MOM6(?!.*%MARBL-BIO)">
<comment>20 ypd/ 7100 pe-hrs/simyr expected</comment>
<ntasks>
<ntasks>
<ntasks_atm>5400</ntasks_atm>
<ntasks_lnd>1792</ntasks_lnd>
<ntasks_rof>1792</ntasks_rof>
Expand Down Expand Up @@ -154,7 +154,7 @@
<ntasks_ice>3608</ntasks_ice>
<ntasks_ocn>3300</ntasks_ocn>
<ntasks_glc>4</ntasks_glc>
<ntasks_wav>1</ntasks_wav>
<ntasks_wav>64</ntasks_wav>
<ntasks_cpl>5400</ntasks_cpl>
</ntasks>
<nthrds>
Expand Down
Loading

0 comments on commit 92cc047

Please sign in to comment.