Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(closes #2629) Fix NEMOv5 issues #2698

Merged
merged 17 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,6 @@ jobs:
cd lib/profiling/nvidia/
F90=nvfortran make

# PSyclone passthrough for 5.0-beta of NEMO.
- name: NEMO 5.0 beta passthrough without optimisation
run: |
. .runner_venv/bin/activate
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
# PSYCLONE_HOME has `/bin` appended to it by the build system.
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
cd $NEMO_DIR
module load nvidia-hpcsdk/${NVFORTRAN_VERSION}
module load hdf5/${HDF5_VERSION} netcdf_c/${NETCDF_C_VERSION} netcdf_fortran/${NETCDF_FORTRAN_VERSION}
module load perl/${PERL_VERSION}
# We compile at -O1 to permit comparison of the results. (N.B. this test
# passes at -O3 with the Intel ifx compiler.)
./makenemo -r BENCH -m linux_nvidia_O1 -n BENCH_PASSTHROUGH clean -y
./makenemo -r BENCH -m linux_nvidia_O1 -n BENCH_PASSTHROUGH -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
del_key "key_xios key_iomput key_top" add_key "key_nosignedzero" -j 4
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH/EXP00
mpirun -np 4 ./nemo
diff run.stat ${PSYCLONE_NEMO_DIR}/KGOs/run.stat.bench.orca2.4mpi.10steps
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

# PSyclone passthrough for MetOffice NEMO
- name: NEMO MetOffice Passthrough
run: |
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/nemo_v5_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Author S. Siso, STFC Daresbury Lab

# This workflow will use a self-hosted runner to perform the more expensive
# integrations tests that are not run on GHA systems.
# NEMOv5 integrations tests that are not run on GHA systems.

name: NEMOv5 Integration Tests

Expand Down Expand Up @@ -93,10 +93,11 @@ jobs:

# Run Orca2
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_GCC/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_orca2_like namelist_cfg
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_test namelist_cfg
mpirun -np 4 ./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.orca2.4mpi.10steps run.stat
cat run.stat
tail run.stat
# This was produced with gfortran, so we can do an exact diff
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.test.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

Expand All @@ -111,10 +112,9 @@ jobs:
export NEMO_DIR=${HOME}/NEMOv5

# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
# We compile at -O1 to permit comparison of the results.
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -Mr8 -O1 -Minline -Mcray=pointer -Mpre -g"
export FCFLAGS="-i4 -Mr8 -O2 -Minline -Mcray=pointer -Mpre -g"

# Clean up and compile
# Without key_mpi_off it fails to compile (even without psyclone)
arporter marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -124,10 +124,10 @@ jobs:

# Run Orca2
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_NVHPC/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_orca2_like namelist_cfg
mpirun -np 4 ./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.orca2.4mpi.10steps run.stat
cat run.stat
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_test namelist_cfg
arporter marked this conversation as resolved.
Show resolved Hide resolved
./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.test.100steps run.stat
tail run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

Expand All @@ -153,13 +153,12 @@ jobs:

# Run Orca2
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_ONEAPI/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_orca2_like namelist_cfg
# It currently segfaults
# mpirun -np 4 ./nemo
# python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.orca2.4mpi.10steps run.stat
# cat run.stat
# export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
# echo "Time-stepping duration = " $VAR_TIME
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_test namelist_cfg
mpirun -np 6 ./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.test.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

- name: NEMO 5.0 gfortran OpenMP for CPUs
run: |
Expand All @@ -183,10 +182,10 @@ jobs:

# Run Orca2
cd $NEMO_DIR/tests/BENCH_OMP_THREADING_GCC/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_orca2_like namelist_cfg
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_test namelist_cfg
OMP_NUM_THREADS=4 mpirun -np 1 ./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.orca2.4mpi.10steps run.stat
cat run.stat
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.test.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME

Expand Down Expand Up @@ -214,9 +213,9 @@ jobs:

# Run Orca2
cd $NEMO_DIR/tests/BENCH_OMP_OFFLOAD_NVHPC/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_orca2_like namelist_cfg
mpirun -np 1 ./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.orca2.4mpi.10steps run.stat
cat run.stat
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_test namelist_cfg
./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.test.100steps run.stat
export VAR_TIME=$(awk '/ step /{print $3}' timing.output | head -n 1 | sed -e 's/s//')
echo "Time-stepping duration = " $VAR_TIME
7 changes: 7 additions & 0 deletions examples/nemo/scripts/KGOs/arch-linux_spack.fcm
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# This fcm file is intended to be used with the psyclone-spack nemo-build-environment recipe
# which will populate all environment variables but PSYCLONE_HOME and FCFLAGS, which should
# be populated manually for the desired target. For example, using:
# $ spack load nemo-build-environment%nvhpc
# $ export PSYCLONE_HOME=${PWD}/.venv
# $ export FCFLAGS="-i4 -Mr8 -O3 -Minline -Mcray=pointer -Mpre -mp"

%PSYCLONE_HOME ${PSYCLONE_HOME}
arporter marked this conversation as resolved.
Show resolved Hide resolved
%NCDF_INC -I${NCDF_F_HOME}/include -I${NCDF_C_HOME}/include -I${HDF5_HOME}/include
%NCDF_LIB -L${NCDF_F_HOME}/lib -lnetcdff -L${NCDF_C_HOME}/lib -lnetcdf
Expand Down
Loading
Loading