Skip to content

Commit 214d998

Browse files
authored
Preparation for Transition to C6 (#78)
* Added C6 env and mk files * added ci_build_driver for c6 * Updated NEP10 CI test driver * Update NWA and NEP CI driver * add c6 gha-ci workflow * Start modifying xmls * fixed c6 GHA workflow * revert changes for workflow * fix build script in CEFI_MOM6_c6-ci.yaml * Increase NWA CI layout * Update xml for c6 * fixed diag yaml convert * Update run script and change default FRE for PPAN * turn off analysis for now * revert back platform change * Update platforms.xml * add module unload darshan-runtime * move data folders properties to platforms.xml * fre/test works on PPAN now * fre/test does not work on PP * Update CEFI_NWA12_cobalt.xml * Update CEFI_NWA12_cobalt_fms2_yaml.xml * Update CEFI_NWA12_cobalt.xml * Update CEFI_NWA12_cobalt_fms2_yaml.xml * change fre version on PPAN * FRE/test now works on PPAN * Update CEFI_NWA12_cobalt_fms2_yaml.xml FRE/test now works on PPAN
1 parent 33500c1 commit 214d998

File tree

13 files changed

+643
-113
lines changed

13 files changed

+643
-113
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: CEFI-MOM6_c6-ci
2+
3+
on:
4+
# Triggers this workflow on pull request event with "CEFI_MOM6_RT_gaea_c6" label
5+
pull_request:
6+
branches: [ "main" ]
7+
types: [ labeled ]
8+
9+
#
10+
env:
11+
TEST_DIR: ${{ github.workspace }}/${{ github.run_id }}
12+
PR_NUMBER: ${{ github.event.number }}
13+
14+
#
15+
jobs:
16+
checkout-build:
17+
if: ${{ github.event.label.name == 'CEFI_MOM6_RT_gaea_c6' }}
18+
runs-on: self-hosted
19+
timeout-minutes: 600
20+
strategy:
21+
max-parallel: 1
22+
23+
steps:
24+
- name: Checkout CEFI-regional-MOM6
25+
uses: actions/checkout@v4
26+
with:
27+
path: ${{ github.run_id }}/CEFI_MOM6_CHECK
28+
fetch-depth: 1
29+
submodules: recursive
30+
31+
- name: Build MOM6SIS2
32+
run: |
33+
cd ${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/builds
34+
jobid=$(sbatch --parsable ci_build_driver_c6.sh | awk -F';' '{print $1}' | cut -f1)
35+
#
36+
sleep 1
37+
while :; do
38+
job_status=$(squeue -h -j "$jobid" -o "%T" 2>/dev/null)
39+
if [ -z "$job_status" ]; then
40+
echo "Job with ID $jobid is not found or completed."
41+
break
42+
else
43+
echo "Job with ID $jobid is still running."
44+
echo "Job Status: $job_status"
45+
fi
46+
sleep 60 # Adjust the sleep duration as needed
47+
done
48+
#
49+
check_file="${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/builds/build/gaea-ncrc6.intel23/ocean_ice/repro/MOM6SIS2"
50+
if [ -f "$check_file" ]; then
51+
echo "PASSED: $check_file"
52+
else
53+
echo "FAILED: $check_file"
54+
exit 1
55+
fi
56+
57+
run-CEFI_MOM6-ci:
58+
needs: checkout-build
59+
runs-on: self-hosted
60+
strategy:
61+
max-parallel: 2
62+
matrix:
63+
case: ["NWA12.COBALT"] #["NWA12.COBALT", "NEP10.COBALT"]
64+
steps:
65+
- name: Run Experiment ${{ matrix.case }}
66+
run: |
67+
cd ${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/exps/${{ matrix.case }}
68+
jobid=$(sbatch --parsable driver.sh | awk -F';' '{print $1}' | cut -f1)
69+
#
70+
sleep 1
71+
while :; do
72+
job_status=$(squeue -h -j "$jobid" -o "%T" 2>/dev/null)
73+
if [ -z "$job_status" ]; then
74+
echo "Job with ID $jobid is not found or completed."
75+
break
76+
else
77+
echo "Job with ID $jobid is still running."
78+
echo "Job Status: $job_status"
79+
fi
80+
sleep 60 # Adjust the sleep duration as needed
81+
done
82+
#
83+
expected_string="All restart files are identical, PASS"
84+
check_file="${{ env.TEST_DIR }}/CEFI_MOM6_CHECK/exps/${{ matrix.case }}/${{ matrix.case }}_o.$jobid"
85+
if [ -f "$check_file" ]; then
86+
if grep -qF "$expected_string" $check_file; then
87+
echo "PASSED: ${{ matrix.case }}"
88+
else
89+
echo "FAILED: ${{ matrix.case }}"
90+
exit 1
91+
fi
92+
else
93+
echo "Can not find $check_file. STOP"
94+
exit 10
95+
fi
96+
97+
add-pass-label:
98+
needs: run-CEFI_MOM6-ci
99+
runs-on: self-hosted
100+
if: ${{ needs.run-CEFI_MOM6-ci.result == 'success' }}
101+
steps:
102+
- name: Add "pass_CEFI_MOM6_RT" label on success
103+
run: |
104+
TOKEN=${{ secrets.GITHUB_TOKEN }}
105+
RT_TEST_LABEL="CEFI_MOM6_RT_gaea_c6"
106+
PASS_LABEL="pass_CEFI_MOM6_RT"
107+
108+
# Remove the "CEFI_MOM6_RT_gaea_c6" label
109+
curl -X DELETE \
110+
-H "Authorization: Bearer $TOKEN" \
111+
-H "Accept: application/vnd.github.v3+json" \
112+
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues/${{ env.PR_NUMBER }}/labels/$RT_TEST_LABEL"
113+
114+
# Add the "pass_CEFI_MOM6_RT" label
115+
curl -X POST \
116+
-H "Authorization: Bearer $TOKEN" \
117+
-H "Accept: application/vnd.github.v3+json" \
118+
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues/${{ env.PR_NUMBER }}/labels" \
119+
-d "{\"labels\":[\"$PASS_LABEL\"]}"
120+
121+
clean-up:
122+
needs: add-pass-label
123+
runs-on: self-hosted
124+
strategy:
125+
max-parallel: 1
126+
steps:
127+
- name: Clean-up
128+
run: |
129+
cd ${{ github.workspace }}
130+
rm -rf ${{ github.run_id }}

builds/ci_build_driver_c6.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
#SBATCH --nodes=1
3+
#SBATCH --time=60
4+
#SBATCH --job-name="MOM6SIS2_ci_build"
5+
#SBATCH --output=MOM6SIS2_ci_build_o.%j
6+
#SBATCH --error=MOM6SIS2_ci_build_e.%j
7+
#SBATCH --qos=debug
8+
#SBATCH --partition=batch
9+
#SBATCH --clusters=c6
10+
#SBATCH --account=ira-cefi
11+
12+
#
13+
[ -d "build" ] && rm -rf build
14+
15+
#
16+
echo "Build MOM6SIS2-COBALT for CI testing started: " `date`
17+
18+
#
19+
machine_name="gaea"
20+
platform="ncrc6.intel23"
21+
target="repro"
22+
flavor="fms1_mom6sis2"
23+
24+
FMSlib_PATH="/ncrc/home2/Yi-cheng.Teng/github/FMS/2024.02_FMS1"
25+
rootdir=$(pwd)
26+
abs_rootdir=$rootdir
27+
28+
echo $abs_rootdir
29+
30+
#load modules
31+
source $MODULESHOME/init/bash
32+
source $rootdir/$machine_name/$platform.env
33+
. $rootdir/$machine_name/$platform.env
34+
35+
makeflags="NETCDF=3"
36+
37+
if [[ $target =~ "repro" ]] ; then
38+
makeflags="$makeflags REPRO=1"
39+
fi
40+
41+
srcdir=$abs_rootdir/../src
42+
43+
#
44+
sed -i 's/static pid_t gettid(void)/pid_t gettid(void)/g' $srcdir/FMS/affinity/affinity.c
45+
46+
#
47+
if [[ $flavor == "fms1_mom6sis2" ]] ; then
48+
echo "build mom6sis2 with FMS1 cap"
49+
50+
mkdir -p build/$machine_name-$platform/ocean_ice/$target
51+
pushd build/$machine_name-$platform/ocean_ice/$target
52+
rm -f path_names
53+
$srcdir/mkmf/bin/list_paths $srcdir/MOM6/{config_src/infra/FMS1,config_src/memory/dynamic_symmetric,config_src/drivers/FMS_cap,config_src/external/ODA_hooks,config_src/external/database_comms,config_src/external/drifters,config_src/external/stochastic_physics,pkg/GSW-Fortran/{modules,toolbox}/,src/{*,*/*}/} $srcdir/SIS2/{config_src/dynamic_symmetric,config_src/external/Icepack_interfaces,src} $srcdir/icebergs/src $srcdir/FMS/{coupler,include}/ $srcdir/{ocean_BGC/generic_tracers,ocean_BGC/mocsy/src}/ $srcdir/{atmos_null,ice_param,land_null,coupler/shared/,coupler/full/}/
54+
55+
compiler_options='-DINTERNAL_FILE_NML -DMAX_FIELDS_=600 -DNOT_SET_AFFINITY -Duse_deprecated_io -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 -D_USE_LEGACY_LAND_ -Duse_AM3_physics'
56+
57+
$srcdir/mkmf/bin/mkmf -t $abs_rootdir/$machine_name/$platform.mk -o "-I${FMSlib_PATH}/shared/$target" -p MOM6SIS2 -l "-L${FMSlib_PATH}/shared/$target -lfms" -c "$compiler_options" path_names
58+
59+
make $makeflags MOM6SIS2
60+
61+
fi
62+
63+
64+
65+
echo "Build MOM6SIS2-COBALT for CI testing ended: " `date`

builds/gaea/ncrc6.intel23.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
source $MODULESHOME/init/tcsh
2+
module unload cray-netcdf cray-hdf5 fre
3+
module unload PrgEnv-pgi PrgEnv-intel PrgEnv-gnu PrgEnv-cray
4+
module load PrgEnv-intel/8.5.0
5+
module unload intel intel-classic intel-oneapi
6+
module load intel-classic/2023.2.0
7+
module load cray-hdf5/1.12.2.11
8+
module load cray-netcdf/4.9.0.9
9+
module load libyaml/0.2.5
10+
module list
11+
ftn --version

0 commit comments

Comments
 (0)