Skip to content

Commit cda3eb1

Browse files
committed
Bring to master
2 parents 44171be + 5287120 commit cda3eb1

359 files changed

Lines changed: 12225 additions & 9330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/compilation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ env:
5656
HDF5_VERSION: "2.1"
5757
NETCDF_C_VERSION: "4.10"
5858
NETCDF_FORTRAN_VERSION: "4.6"
59-
NVFORTRAN_VERSION: "26.3"
59+
NVFORTRAN_VERSION: "26.5"
6060
OPENMPI_VERSION: "5.0"
6161
PYTHON_VERSION: "3.14"
6262
NUM_PARALLEL: 16
@@ -87,7 +87,7 @@ jobs:
8787
python -m pip install --upgrade pip
8888
# Uncomment the below to use the submodule version of fparser rather
8989
# than the latest release from pypi.
90-
pip install external/fparser
90+
# pip install external/fparser
9191
pip install .[test,psydata,doc,treesitter]
9292
- name: Unit tests with compilation - gfortran
9393
run: |

.github/workflows/extraction_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
python -m pip install --upgrade pip
7575
# Uncomment the below to use the submodule version of fparser rather
7676
# than the latest release from pypi.
77-
pip install external/fparser
77+
# pip install external/fparser
7878
pip install .[test]
7979
# Install BAF, and its version of Fab:
8080
# ------------------------------------

.github/workflows/lfric_test.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242
push
4343

4444
env:
45-
LFRIC_APPS_HASH: d8cab8417d873eb686e7fe74707da03742eaa9d9
45+
LFRIC_APPS_HASH: 56054ba955cc97a8529afc3844139ab58bd7d359
4646
PYTHON_VERSION: "3.14"
4747
GNU_TOOLCHAIN: gnu14_openmpi
4848
NVHPC_TOOLCHAIN: nvhpc26_3_openmpi
@@ -85,7 +85,7 @@ jobs:
8585
python -m pip install --upgrade pip
8686
# Uncomment the below to use the submodule version of fparser rather
8787
# than the latest release from pypi.
88-
pip install external/fparser
88+
# pip install external/fparser
8989
pip install .[test]
9090
# Fetch the specified version of LFRic apps
9191
cd /archive/psyclone-tests/latest-run
@@ -116,7 +116,7 @@ jobs:
116116
cp ${PSYCLONE_LFRIC_DIR}/does_nothing.py ${OPT_DIR}/global.py
117117
# Clean previous version and compile again
118118
rm -rf working-gh-passthrough
119-
./build/local_build.py -j ${NUM_PARALLEL} -v -p psyclone-test -w working-gh-passthrough gungho_model
119+
./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test -w working-gh-passthrough gungho_model
120120
# Run
121121
cd applications/gungho_model/example
122122
rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run
@@ -148,9 +148,14 @@ jobs:
148148
# Clean previous version and compile again
149149
rm -rf working-gh-ompoffload
150150
export BUILD_START="${SECONDS}"
151-
LFRIC_OFFLOAD_DIRECTIVES=omp ./build/local_build.py -v -j ${NUM_PARALLEL} -p psyclone-test \
152-
-w working-gh-ompoffload gungho_model
151+
LFRIC_OFFLOAD_DIRECTIVES=omp ./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test \
152+
-w working-gh-ompoffload gungho_model |& tee output.txt
153+
# Piping to tee ignores the errcode of the first command, make sure we account for it
154+
if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
155+
exit ${PIPESTATUS[0]}
156+
fi
153157
export BUILD_ELAPSED=$((${SECONDS}-${BUILD_START}))
158+
${PSYCLONE_LFRIC_DIR}/aggregate_gpu_stats.sh output.txt
154159
cd applications/gungho_model/example
155160
rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run
156161
export OMP_NUM_THREADS=12
@@ -180,7 +185,7 @@ jobs:
180185
cp ${PSYCLONE_LFRIC_DIR}/gpu_offloading.py ${OPT_DIR}/global.py
181186
# Clean previous version and compile again
182187
rm -rf working-gh-accoffload
183-
LFRIC_OFFLOAD_DIRECTIVES=acc ./build/local_build.py -v -j ${NUM_PARALLEL} -p psyclone-test \
188+
LFRIC_OFFLOAD_DIRECTIVES=acc ./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test \
184189
-w working-gh-accoffload gungho_model
185190
cd applications/gungho_model/example
186191
rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run
@@ -210,7 +215,7 @@ jobs:
210215
cp ${PSYCLONE_LFRIC_DIR}/everything_everywhere_all_at_once.py ${OPT_DIR}/global.py
211216
# Clean previous version and compile again
212217
rm -rf working-gh_alltrans
213-
./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test -v -w working-gh-alltrans gungho_model
218+
./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test -w working-gh-alltrans gungho_model
214219
# Run
215220
cd applications/gungho_model/example
216221
rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run
@@ -239,7 +244,7 @@ jobs:
239244
cp ${PSYCLONE_LFRIC_DIR}/tiledcolouring_and_omp.py ${OPT_DIR}/global.py
240245
# Clean previous version and compile again
241246
rm -rf working-gh-omptiling
242-
./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test -v -w working-gh-omptiling gungho_model
247+
./build/local_build.py -j ${NUM_PARALLEL} -p psyclone-test -w working-gh-omptiling gungho_model
243248
# Run
244249
cd applications/gungho_model/example
245250
rm -f timer.txt gungho_model-checksums.txt # In case there were from a previous run
@@ -264,7 +269,7 @@ jobs:
264269
# Build the 'meto-ex1a' platform, that includes psyclone-transmutation
265270
rm -rf working-atm-transmuted
266271
export BUILD_START="${SECONDS}"
267-
./build/local_build.py -v -p meto-ex1a -j 16 -w working-atm-transmuted lfric_atm
272+
./build/local_build.py -p meto-ex1a -j 16 -w working-atm-transmuted lfric_atm
268273
export BUILD_ELAPSED=$((${SECONDS}-${BUILD_START}))
269274
270275
# Run the app with 8 threads and no MPI
@@ -279,6 +284,26 @@ jobs:
279284
echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}"
280285
echo "build_time=${BUILD_ELAPSED}" >> "${GITHUB_OUTPUT}"
281286
287+
- name: LFRic Atm nvfortran
288+
id: lfric_atm_nvfortran
289+
run: |
290+
# Set up environment
291+
source /archive/psyclone-spack/psyclone-spack-Dec25/spack-repo/share/spack/setup-env.sh
292+
spack unload && spack load lfric-build-environment %${NVHPC_TOOLCHAIN}
293+
source .runner_venv/bin/activate
294+
export PSYCLONE_LFRIC_DIR=${GITHUB_WORKSPACE}/examples/lfric/scripts
295+
export LFRIC_DIR=/archive/psyclone-tests/latest-run/lfric_apps
296+
cd ${LFRIC_DIR}
297+
298+
# Currently we just compile the 'meto-ex1a' with the nvidia compiler, this won't
299+
# create offloading directives and fails at runtime because lfric_atm needs XIOS
300+
# enabled, but we want to make sure we keep the nvfortran build working.
301+
rm -rf working-atm-gpu
302+
export BUILD_START="${SECONDS}"
303+
./build/local_build.py -p meto-ex1a -j 16 -w working-atm-gpu lfric_atm
304+
export BUILD_ELAPSED=$((${SECONDS}-${BUILD_START}))
305+
306+
282307
upload_if_on_mirror:
283308
if: ${{ github.repository == 'stfc/PSyclone-mirror' }}
284309
runs-on: ubuntu-latest

.github/workflows/linkcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
name: Run linkspector
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@v5
1010
- name: Run linkspector
1111
uses: umbrelladocs/action-linkspector@v1
1212
with:

.github/workflows/nemo_tests.yml

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ env:
4545
HDF5_VERSION: "2.1"
4646
NETCDF_C_VERSION: "4.10"
4747
NETCDF_FORTRAN_VERSION: "4.6"
48-
NVFORTRAN_VERSION: "26.3"
48+
NVFORTRAN_VERSION: "26.5"
49+
NVHPC_TOOLCHAIN: nvhpc26_3_openmpi
4950
INTEL_TOOLCHAIN: intel25_3_openmpi
5051
PERL_VERSION: "5.42"
5152
PYTHON_VERSION: "3.14"
@@ -85,7 +86,7 @@ jobs:
8586
python -m pip install --upgrade pip
8687
# Uncomment the below to use the submodule version of fparser rather
8788
# than the latest release from pypi.
88-
pip install external/fparser
89+
# pip install external/fparser
8990
pip install .[test]
9091
# Compile nvidia profiling tools
9192
module load nvidia-hpcsdk/${NVFORTRAN_VERSION}
@@ -130,6 +131,8 @@ jobs:
130131
module load perl/${PERL_VERSION}
131132
make clean
132133
export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script
134+
export PARALLEL_DIRECTIVES="omp_offloading+omp_threading"
135+
export REPRODUCIBLE=1
133136
make -j ${NUM_PARALLEL} openmp_gpu
134137
make -j ${NUM_PARALLEL} compile-openmp_gpu
135138
export NV_ACC_POOL_THRESHOLD=75
@@ -171,27 +174,39 @@ jobs:
171174
- name: NEMO MetOffice OpenACC loops for GPU
172175
id: nemo_acc_loops
173176
run: |
177+
source /archive/psyclone-spack/psyclone-spack-Dec25/spack-repo/share/spack/setup-env.sh
178+
spack unload && spack load nemo-build-environment %${NVHPC_TOOLCHAIN}
174179
. .runner_venv/bin/activate
180+
181+
# Set envvars
175182
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
176183
export PROFILE_HOME=${GITHUB_WORKSPACE}/lib/profiling/nvidia/
177184
export NEMO_DIR=${PREFIX}/UKMO-NEMOv4
178-
cd $PSYCLONE_NEMO_DIR
179-
module load nvidia-hpcsdk/${NVFORTRAN_VERSION}
180-
module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION}
181-
module load perl/${PERL_VERSION}
182-
make clean
183-
make -j ${NUM_PARALLEL} openacc_loops
184-
COMPILER_ARCH=linux_nvidia_acc_gpu make -j ${NUM_PARALLEL} compile-openacc_loops
185+
export TEST_DIR=SPITZ12_ACC_LOOPS_NVHPC
186+
export PSYCLONE_COMPILER=$MPIF90
187+
export MPIF90=psyclonefc
188+
export PARALLEL_DIRECTIVES="acc_offloading"
189+
export REPRODUCIBLE=1
190+
export PSYCLONE_OPTS="--enable-cache -l output -s ${PSYCLONE_NEMO_DIR}/insert_loop_parallelism.py"
191+
export FCFLAGS="-i4 -Mr8 -O2 -Mnovect -Mnofma -g -acc -mp=gpu -gpu=mem:managed,math_uniform"
192+
export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script
193+
194+
# Compile
195+
cd ${PREFIX}/UKMO-NEMOv4
196+
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
197+
rm -rf cfgs/${TEST_DIR}
198+
./makenemo -r SPITZ12 -m linux_spack -n ${TEST_DIR} \
199+
add_key "IEEE_IS_NAN=ieee_is_nan key_nosignedzero" \
200+
del_key "key_iomput key_mpp_mpi key_si3" -j ${NUM_PARALLEL}
201+
202+
# Run test
185203
export NV_ACC_POOL_THRESHOLD=75
186204
export CUDA_VISIBLE_DEVICES=1
187-
make run-openacc_loops
188-
# Check the output is as expected (TODO #2895: improve numerical reproducibility)
189-
make output-openacc_loops | grep -q " it : 10" || (echo "Error: 'it : 10' not found!" & false)
190-
make output-openacc_loops | grep -q "|ssh|_max: 0.259483" || (echo "Error: '|ssh|_max: 0.259483' not found!" & false)
191-
make output-openacc_loops | grep -q "|U|_max: 0.458515" || (echo "Error: '|U|_max: 0.458515' not found!" & false)
192-
make output-openacc_loops | grep -q "S_min: 0.482686" || (echo "Error: 'S_min: 0.482686' not found!" & false)
193-
make output-openacc_loops | grep -q "S_max: 0.407622" || (echo "Error: 'S_max: 0.407622' not found!" & false)
194-
export VAR_TIME=$(grep -A 1 "Elapsed Time" <(make -s time-openacc_loops) | head -n 2 | tail -n 1 | awk '{print $1}')
205+
cd cfgs/${TEST_DIR}/EXP00/
206+
ln -sf /archive/psyclone-tests/nemo-inputs/UKMO-eORCA1_GO8_NEMOv4/*.nc .
207+
./nemo
208+
diff run.stat $PSYCLONE_NEMO_DIR/KGOs/run.stat.nemo4.spitz12.nvhpc.10steps
209+
export VAR_TIME=$(grep -A 1 "Elapsed Time" timing.output | head -n 2 | tail -n 1 | awk '{print $1}')
195210
echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}"
196211
197212
# PSyclone, compile and run ECMWF NEMO with OpenMP for CPUs. This uses
@@ -205,21 +220,25 @@ jobs:
205220
source .runner_venv/bin/activate
206221
207222
# Set up envvars
223+
export TEST_DIR=SPITZ12_OMP_CPU
208224
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
209225
export PSYCLONE_COMPILER=$MPIF90
210226
export MPIF90=psyclonefc
211-
export PSYCLONE_OPTS="--enable-cache -l output -s ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py -I ${MPI_HOME}/include"
227+
export PARALLEL_DIRECTIVES="omp_threading"
228+
export PSYCLONE_OPTS="--enable-cache -l output -s ${PSYCLONE_NEMO_DIR}/insert_loop_parallelism.py -I ${MPI_HOME}/include"
212229
export FCFLAGS="-i4 -r8 -O2 -heap-arrays -fp-model=precise -g -qopenmp"
213230
export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script
214231
215232
# Compile
216233
cd ${PREFIX}/ECMWF-NEMOv4
217-
./makenemo -r SPITZ12 -m linux_spack -n SPITZ12_psyclone -j ${NUM_PARALLEL} \
234+
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
235+
rm -rf cfgs/${TEST_DIR}
236+
./makenemo -r SPITZ12 -m linux_spack -n ${TEST_DIR} -j ${NUM_PARALLEL} \
218237
add_key "IEEE_IS_NAN=ieee_is_nan key_nosignedzero" \
219238
del_key "key_iomput"
220239
221240
# Run NEMO
222-
cd cfgs/SPITZ12_psyclone/EXP00/
241+
cd cfgs/${TEST_DIR}/EXP00/
223242
ln -sf /archive/psyclone-tests/nemo-inputs/ECMWF-eORCA1_GO8/* .
224243
export OMP_NUM_THREADS=12
225244
./nemo
@@ -240,6 +259,8 @@ jobs:
240259
module load perl/${PERL_VERSION}
241260
make clean
242261
export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script
262+
export PARALLEL_DIRECTIVES="omp_offloading+omp_threading"
263+
export REPRODUCIBLE=1
243264
export ASYNC_PARALLEL=1
244265
make -j ${NUM_PARALLEL} openmp_gpu
245266
make -j ${NUM_PARALLEL} compile-openmp_gpu
@@ -290,7 +311,7 @@ jobs:
290311
{
291312
ci_test: "NEMOv4 OpenACC loops for GPU",
292313
nemo_version: "MEMO MO 4.0.2",
293-
compiler:"nvhpc-'"$NVFORTRAN_VERSION"'",
314+
compiler:"'"${NVHPC_TOOLCHAIN}"'",
294315
elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_acc_loops}}"',
295316
'"$COMMON_FIELDS"'
296317
},

0 commit comments

Comments
 (0)