Skip to content

Commit

Permalink
Merge branch 'master' into 2779_split_element_order
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-jdendy authored Jan 6, 2025
2 parents fdb54f2 + d6dc2bd commit 6f0d1d6
Show file tree
Hide file tree
Showing 198 changed files with 5,148 additions and 2,006 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ on:
push

env:
CUDA_VERSION: 12.6.2
CUDA_VERSION: 12.6.3
GFORTRAN_VERSION: 14.2.0
HDF5_VERSION: 1.14.5
NETCDF_C_VERSION: 4.9.2
NETCDF_FORTRAN_VERSION: 4.6.1
NVFORTRAN_VERSION: 24.9
OPENMPI_VERSION: 5.0.5
NVFORTRAN_VERSION: 24.11
OPENMPI_VERSION: 5.0.6
PYTHON_VERSION: 3.13.0

jobs:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,20 +202,19 @@ jobs:
export COMPILER_ARCH=linux_intel
export ADD_KEYS="IEEE_IS_NAN=ieee_is_nan key_nosignedzero"
export DEL_KEYS="key_iomput"
export MODEL_DIR=/archive/ssiso/ecmwf_eORCA1_GO8/
export NAMELISTS_DIR=${NEMO_DIR}/testscripts_V40/output/openmp_outer_V40_eORCA1_GO8_Z75_20170906_cray_dp_1x1/
export INPUT_DIR=/archive/NEMO_INPUTS/NEMOv4/ECMWF/eORCA1_GO8/
export MPI_INC_DIR=${I_MPI_ROOT}/include
cd $PSYCLONE_NEMO_DIR
make -j 4 openmp_cpu
make -j 4 compile-openmp_cpu
export OMP_NUM_THREADS=4
make run-openmp_cpu |& tee output.txt
# Check the output is as expected for the first 6 digits
# Check the output is as expected (TODO #2787: improve numerical reproducibility)
tail -n 1 output.txt | grep -q " it : 10" || (echo "Error: 'it : 10' not found!" & false)
tail -n 1 output.txt | grep -q "|ssh|_max: 0.199714" || (echo "Error: '|ssh|_max: 0.199714' not found!" & false)
tail -n 1 output.txt | grep -q "|U|_max: 0.148409" || (echo "Error: '|U|_max: 0.148409' not found!" & false)
tail -n 1 output.txt | grep -q "S_min: 0.108530" || (echo "Error: 'S_min: 0.108530' not found!" & false)
tail -n 1 output.txt | grep -q "S_max: 0.404045" || (echo "Error: 'S_max: 0.404045' not found!" & false)
tail -n 1 output.txt | grep -q "|ssh|_max: 0.199" || (echo "Error: '|ssh|_max: 0.199' not found!" & false)
tail -n 1 output.txt | grep -q "|U|_max: 0.148" || (echo "Error: '|U|_max: 0.148' not found!" & false)
tail -n 1 output.txt | grep -q "S_min: 0.10" || (echo "Error: 'S_min: 0.10' not found!" & false)
tail -n 1 output.txt | grep -q "S_max: 0.404" || (echo "Error: 'S_max: 0.404' not found!" & false)
export VAR_TIME=$(grep -A 1 "Elapsed Time" output.txt | head -n 2 | tail -n 1 | awk '{print $1}')
echo $GITHUB_REF_NAME $GITHUB_SHA $VAR_TIME >> ${HOME}/store_results/performance_history_openmp_cpu
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
Expand Down
84 changes: 50 additions & 34 deletions .github/workflows/nemo_v5_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,25 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_GCC
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-fdefault-real-8 -O2 -fcray-pointer -ffree-line-length-none -g"
# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_GCC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_GCC -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_nosignedzero" -j 4 -v 1
# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_GCC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
mpirun -np 4 ./nemo
tail run.stat
# This was produced with gfortran, so we can do an exact diff
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.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
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.gfortran.small.100steps run.stat
- name: NEMO 5.0 nvidia passthrough
run: |
Expand All @@ -110,24 +109,25 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_NVHPC
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -Mr8 -O2 -Minline -Mcray=pointer -Mpre -g"
export FCFLAGS="-i4 -Mr8 -O1 -Kieee -nofma -Mnovect"
# Clean up and compile
# Without key_mpi_off it fails to compile (even without psyclone)
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_NVHPC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_NVHPC -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1
# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_NVHPC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
./nemo
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.100steps run.stat
tail run.stat
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.nvhpc.small.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 @@ -140,25 +140,24 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_PASSTHROUGH_ONEAPI
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-i4 -r8 -O2 -fp-model precise -fno-alias -g"
# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_ONEAPI clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_PASSTHROUGH_ONEAPI -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/passthrough.py \
add_key "key_nosignedzero" -j 4 -v 1
# Run test
cd $NEMO_DIR/tests/BENCH_PASSTHROUGH_ONEAPI/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
mpirun -np 6 ./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.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
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.oneapi.small.100steps run.stat
- name: NEMO 5.0 gfortran OpenMP for CPUs
run: |
Expand All @@ -169,25 +168,34 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_OMP_THREADING_GCC
# Set up FCM: PATHs are loaded from SPACK, we only need to set the FCFLAGS
cd $NEMO_DIR
cp $PSYCLONE_NEMO_DIR/KGOs/arch-linux_spack.fcm arch/arch-linux_spack.fcm
export FCFLAGS="-fdefault-real-8 -O2 -fcray-pointer -ffree-line-length-none -g -fopenmp"
# Clean up and compile
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_THREADING_GCC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_THREADING_GCC -p ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
export NEMOV5=1 # Enables specific NEMOV5 optimisations in the PSyclone transformation script
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py \
add_key "key_nosignedzero" -j 4 -v 1
# Run test
cd $NEMO_DIR/tests/BENCH_OMP_THREADING_GCC/EXP00
cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
OMP_NUM_THREADS=4 mpirun -np 1 ./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.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
diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.gfortran.small.100steps run.stat
export TIME_sec=$(grep "local proces" timing.output | head -n 1 | awk '{print $4}' | tr -d s)
${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
"mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
--quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
--password ${{ secrets.MONGODB_PASSWORD }} \
--eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
ci_test: "NEMOv5 OpenMP for CPU", nemo_version: "NEMOv5", system: "GlaDos",
compiler:"gfortran-14" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'
- name: NEMO 5.0 nvidia OpenMP for GPUs (managed memory)
run: |
Expand All @@ -198,24 +206,32 @@ jobs:
export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts
export PSYCLONE_HOME=${PWD}/.runner_venv
export NEMO_DIR=${HOME}/NEMOv5
export TEST_DIR=BENCH_OMP_OFFLOAD_NVHPC
# 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 -O3 -Minline -Mcray=pointer -Mpre -g -mp=gpu -gpu=managed"
export FCFLAGS="-i4 -Mr8 -O1 -Kieee -nofma -Mnovect -g -mp=gpu -gpu=managed"
# Clean up and compile
# Without key_mpi_off it fails to compile (even without psyclone)
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_OFFLOAD_NVHPC clean -y
./makenemo -r BENCH -m linux_spack -n BENCH_OMP_OFFLOAD_NVHPC -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} clean -y
./makenemo -r BENCH -m linux_spack -n ${TEST_DIR} -p ${PSYCLONE_NEMO_DIR}/omp_gpu_trans.py \
add_key "key_mpi_off key_nosignedzero" -j 4 -v 1
# Run test
cd $NEMO_DIR/tests/BENCH_OMP_OFFLOAD_NVHPC/EXP00
cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
./nemo
tail run.stat
python $PSYCLONE_NEMO_DIR/compare_ouput.py $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.small.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
# Run test (disabled because it is currently too slow)
# cd $NEMO_DIR/tests/${TEST_DIR}/EXP00
# cp $PSYCLONE_NEMO_DIR/KGOs/namelist_cfg_bench_small namelist_cfg
# ./nemo
# tail run.stat
# diff $PSYCLONE_NEMO_DIR/KGOs/run.stat.bench.nvhpc.small.100steps run.stat
# export TIME_sec=$(grep "local proces" timing.output | head -n 1 | awk '{print $4}' | tr -d s)
# ${HOME}/mongosh-2.1.1-linux-x64/bin/mongosh \
# "mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \
# --quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \
# --password ${{ secrets.MONGODB_PASSWORD }} \
# --eval 'db.GitHub_CI.insertOne({branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'",
# github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'",
# ci_test: "NEMOv5 OpenMP for GPU", nemo_version: "NEMOv5", system: "GlaDos",
# compiler:"nvhpc-24.5" , date: new Date(), elapsed_time: '"${TIME_sec}"'})'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
*~
*.a
*.o
*.psycache
gnu_opt_report.txt
*.mod
*.MOD
.cache
.coverage
*.swp
doc/*/_build
doc/*/*/_build
doc/reference_guide/source/autogenerated/
Expand All @@ -25,3 +27,5 @@ src/*.egg-info
.idea
.rtx.toml
.venv
cov.xml
.coverage.*
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img width="460" src="doc/logo/psyclone_v1.0.png">
</p>

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11190458.svg)](https://doi.org/10.5281/zenodo.11190458)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11190457.svg)](https://doi.org/10.5281/zenodo.11190457)
![Build Status](https://github.com/stfc/PSyclone/workflows/PSyclone%20tests%20and%20examples/badge.svg)
[![codecov](https://codecov.io/gh/stfc/PSyclone/branch/master/graph/badge.svg)](https://codecov.io/gh/stfc/PSyclone)

Expand Down Expand Up @@ -50,6 +50,10 @@ cloning this repository and using:

$ pip install .

or in developer (editable) mode using

$ pip install -e .

For more information about the installation process see
[this section of the User Guide](https://psyclone.readthedocs.io/en/latest/system_specific_setup.html).

Expand Down
60 changes: 57 additions & 3 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
1) PR #2827. Update Zenodo with release 3.0.0 and update link in
README.md.

2) PR #2759 for #2758. Fixes failure seen in compilation tests if
a previous build of infrastructure existed.

3) PR #2807 for #2806. Adds a new 'RESOLVE_IMPORTS' global variable
to transformation scripts which allows the user to instruct the
frontend to chase down some (or all) module imports when constructing
the PSyIR for existing code.

4) PR #2821 for #1247. Adds support for parsing comments from the fparser2
AST tree. There are two new FortranReader arguments to select the behaviour
for comments and directives (by default they are not parsed).

release 3.0.0 6th of December 2024

1) PR #2477 for #2463. Add support for Fortran Namelist statements.

2) PR #2367 for #2296. Extends ModuleInfo so that it can be queried
Expand Down Expand Up @@ -225,8 +242,8 @@

77) PR #2708 for #2663. Add LFRic OpenACC in the integration tests.

78) PR #2678 for #2636. Alter LFRic PSy-layer to lookup nlevels for
each kernel
78) PR #2678 for #2636. Alter LFRic PSy-layer to lookup nlayers for
each kernel.

79) PR #2687 for #2684. Add support for WHERE constructs that contain
references without range-notation (and prevent some incorrect cases).
Expand All @@ -247,7 +264,7 @@
Python used in the CI.

85) PR #2748. Revert Python used on RTD to 3.12 as 3.13 unsupported.

86) PR #2707 for #257. Fixes bugs in the loop-fusion transformation.

87) PR #2752 towards #2717. Adds Assignment.is_literal_assignment property.
Expand Down Expand Up @@ -298,6 +315,43 @@
113) PR #2769 for #2768. Generalises Sign2CodeTrans and Abs2CodeTrans
to allow non-floating point scalar literals.

114) PR #2461 for #2460. Renames DynamoPSy class to LFRicPSy and moves
into a new module lfric_psy.py in domain/lfric.

115) PR #2697 towards #2671. Fixes various issues relating to incorrect
parallelisation of loops in NEMO. Also adds support for array-
privatisation option.

116) PR #2804 towards #2737. Update PSyclone to use fparser 0.2.0 release.

117) PR #2803 for #2796. Fixes bug where PSyData nodes inserted within
LFRic loops did not have the associated variable declared.

118) PR #2792 for # 2766. Updates to all the examples and test
infrastructure now that the index ordering for operators in LFRic
has been changed.

119) PR #2775. Adds Call.get_callee() which matches the arguments of
a Call against the signature of potential callees.

120) PR #2628 for #2624. Improves debug_string output for Schedules.

121) PR #2800. Updates integration test dependencies and documentation
about compiling for GPUs.

122) PR #2811. Adds sphinx-autodoc-typehints package to 'doc'
dependencies so that Sphinx markup is able to make use of the
typehints that we are starting to add to the code base.

123) PR #2809 for #2737. Updates documentation on OpenMP to point to
examples of tranformations for CPU and GPU.

124) PR #2815 for #2636. Get nlayers from first field or operator
argument to each kernel in LFRic.

125) PR #2817 for #2816. Fix index type in initialisation of arrays
of fields in PSyAD test harness construction.

release 2.5.0 14th of February 2024

1) PR #2199 for #2189. Fix bugs with missing maps in enter data
Expand Down
1 change: 1 addition & 0 deletions doc/developer_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
'sphinx.ext.intersphinx', 'sphinx.ext.coverage',
'sphinx.ext.imgmath', 'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinxcontrib.bibtex', 'apilinks']
bibtex_bibfiles = ['../bibliography/references.bib']

Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/psyir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ class, for example:

.. code-block:: python
from psyclone.psyir.nodes.commentable_mixin import CommentableMixin
from psyclone.psyir.commentable_mixin import CommentableMixin
class MyNode(Node, CommentableMixin):
''' Example node '''
Expand Down
6 changes: 3 additions & 3 deletions doc/developer_guide/system_specific_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ Installing Documentation Tools
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Install Sphinx along with bibtex support for creating PSyclone documentation::

> sudo pip install sphinx sphinxcontrib.bibtex
> pip install .[doc]

You can now build html documentation::
You can now build html documentation. E.g., for the developer documentation::

> cd doc
> cd doc/developer_guide/
> make html

The latex package is required to create the pdf documentation
Expand Down
Loading

0 comments on commit 6f0d1d6

Please sign in to comment.