Skip to content

Commit

Permalink
Merge branch 'master' into 2588_get_routine_psyir
Browse files Browse the repository at this point in the history
  • Loading branch information
arporter committed Jul 3, 2024
2 parents bde3866 + ae4bc50 commit 624afbd
Show file tree
Hide file tree
Showing 286 changed files with 9,593 additions and 10,273 deletions.
13 changes: 13 additions & 0 deletions .github/linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dirs:
- .
useGitIgnore: true
ignorePatterns:
- pattern: '^https://mybinder.org/v2/gh/stfc/psyclone'
replacementPatterns:
- pattern: '^https:\/\/(psyclone.*\.readthedocs\.io\/en)\/stable$'
replacement: 'https://$1/latest'
aliveStatusCodes:
- 200
- 401
- 502
- 503
16 changes: 16 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Linkspector
on: [pull_request]
jobs:
check-links:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
name: Run linkspector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
fail_on_error: true
config_file: '.github/linkspector.yml'
14 changes: 0 additions & 14 deletions .github/workflows/mlc_config.json

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,28 @@ 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 -p passthrough del_key "key_xios key_iomput key_top" add_key "key_nosignedzero" clean -y
./makenemo -r BENCH -m linux_nvidia_O1 -n BENCH_PASSTHROUGH -p passthrough 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
28 changes: 11 additions & 17 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,17 @@ on:
workflow_dispatch:

jobs:
markdown-link-check:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
# Check all markdown files for dead links. See the 'mlc_config.json'
# file in the project root directory for configuration.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
sphinx-link-check:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
# Check all Sphinx documentation for dead links.
runs-on: ubuntu-latest
env:
GITHUB_PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get install -y graphviz doxygen
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
Expand All @@ -89,8 +80,10 @@ jobs:
# Check doctests of developer's guide
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
# Sphinx since version 7.2 (7.2.0/1/2) aborts with
Expand All @@ -108,7 +101,7 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.12]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
# This is required to get the commit history for merge commits for
Expand Down Expand Up @@ -146,7 +139,8 @@ jobs:
- name: Run tutorials
run: |
( make -C tutorial/practicals transform > /dev/null )
( make -C tutorial/notebooks notebook )
# Jupyter notebooks are out-of-date
# ( make -C tutorial/notebooks notebook )
- name: Test with pytest
if: ${{ !(matrix.python-version == 3.8) }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cloning this repository and using:
For more information about the installation process see
[this section of the User Guide](https://psyclone.readthedocs.io/en/latest/system_specific_setup.html).

<!--- TODO #2627
# Try it on Binder #
Some of the examples are available as Jupyter notebooks. These may
Expand All @@ -62,12 +63,11 @@ software. This can take several minutes. You can track its progress
by clicking the 'show' link next to the 'Build logs' heading.)
* [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stfc/psyclone/master?filepath=tutorial%2Fnotebooks%2Fintroduction.ipynb) The **PSyclone Tutorial**. Note that we currently recommend following the more up-to-date README files under the `tutorials/practicals` directory.
* [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stfc/psyclone/master?filepath=examples%2Fnemo%2Feg4%2Fcopy_stencil.ipynb) Uses PSyclone's NEMO API to process some simple Fortran code, display the resulting PSyIR and then re-generate Fortran.
* [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stfc/psyclone/master?filepath=examples%2Fgocean%2Feg1%2Fopenmp.ipynb) Uses PSyclone's GOcean API to process example code that conforms to the PSyKAl separation of concerns. Transformations are applied in order to fuse various loops before parallelising the result with OpenMP.
* [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/stfc/psyclone/master?filepath=examples%2Fgocean%2Feg1%2Fdag.ipynb) demonstrates the generation of a DAG for the PSy layer of the previous example.

--->

# Structure #

Expand Down
49 changes: 49 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,55 @@

39) PR #2564 for $2462. Generalise ModuleManager.

40) PR #2598 towards #2543. Refresh the PSyKAl-related documentation
in both the User and Developer Guides.

41) PR #2611. Update Integration tests nvhpc mpi library path.

42) PR #2614 towards #2604. Fixes broken links to the docs in the
various tutorial READMEs.

43) PR #2587 for #1989. Improves the statistics produced by the
generated PSyKE driver code.

44) #PR #2602 for #1596. Exclude assumed-size variable references from
the ACCKernels regions.

45) PR #2603 for #1841. Refactors the ArrayRange2Loop transformation
(merging in functionality from the NEMO-specific version). Renames it
to ArrayAssignment2LoopsTrans.

46) PR #2615 for #2610. Fixes various spurious warnings that were
being produced by the lfric/eg17/full_example_extract example.

47) PR #2625 for #2619. Adds a create function for OMPParallelDoDirective
to avoid issues from using its parent class' create method.

48) PR #2609 for #2407. The OpenACC routine directive and transformation
now accept a "parallelism" attribute to set the level of parallelism, which
is mandatory in recent OpenACC standards.

49) PR #2626 for #2622. Adds convenience methods to the SymbolTable for
manipulating Routine argument lists.

50) PR #2607 FOR #2600. Update psyclone command and script interface
to remove mention of 'nemo' API.

51) PR #2575 towards #2201. Allow FileContainer to have symbols of their
inner subroutines. It also solves an issue with missing PURE, ELEMENTAL, ...

52) PR #2632 for #2116. Update the code-transformation tutorial.

53) PR #2639 for #2638. Upgrade CI markdown-linkcheck to linkspector.

54) PR #2583 towards #2577. Adds partial support for pointer
assignments. (Array accessors within structures are not supported.)
Pointer *declarations* will still result in symbols of
UnsupportedFortranType.

55) PR #2445 for #2444. Changes the kernel-extraction tooling so
that filenames are construction using dashes instead of colons.

release 2.5.0 14th of February 2024

1) PR #2199 for #2189. Fix bugs with missing maps in enter data
Expand Down
8 changes: 8 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ of the repository:
In both cases ``latexmk`` is also required to be installed on
the system in order to generate the
[pdf documentation](../psyclone.pdf).

The user documentation can make use of Sphinx's math support for
html if `dvipng` is installed. This library is not listed as
a dependency for the `doc` target due to its dependency on latex. But
if `dvipng` is available on a system,
Sphinx's math support can be enabled for the PSyclone documentation by
setting the environment variable `$SPHINXTAG` to `-t has_dvipng`.
The pdf output will always use Sphinx's math support.
24 changes: 4 additions & 20 deletions doc/developer_guide/APIs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ indexed in the following way.
:width: 120

When the distributed memory option is switched on in the LFRic API
(see the :ref:`distributed_memory` Section) the cells in the model are
(see the :ref:`psykal_usage` Section) the cells in the model are
partitioned amongst processors and halo cells are added at the
boundaries to a depth determined by the LFRic infrastructure. In this
case the LFRic infrastructure maintains the global cell index and
Expand Down Expand Up @@ -275,7 +275,7 @@ index 2 and the cell above that contains dof index 3 etc.

As discussed in the previous section, when the distributed memory
option is switched on in the LFRic API (see the
:ref:`distributed_memory` Section) the cells in the model are
:ref:`psykal_usage` Section) the cells in the model are
partitioned amongst processors and halo cells are added at the
boundaries to a depth determined by the LFRic infrastructure. This
results in the dofs being replicated in the halo cells, leading to a
Expand Down Expand Up @@ -308,7 +308,7 @@ that contains dof index 3 etc.
:width: 140

As already explained, when the distributed memory option is switched
on in the LFRic API (see the :ref:`distributed_memory` Section)
on in the LFRic API (see the :ref:`psykal_usage` Section)
the cells in the model are partitioned amongst processors and halo
cells are added at the boundaries.

Expand Down Expand Up @@ -1259,22 +1259,6 @@ These scripts may be found in ``examples/nemo/scripts`` and their
use is described in the ``README.md`` file in that directory.


PSyIR Construction
------------------

Since NEMO is an existing code, the way it is handled in PSyclone is
slightly different from those APIs that mandate a PSyKAl separation of
concerns (LFRic and GOcean1.0). As with the other APIs, fparser2 is
used to parse the supplied Fortran source file and construct a parse
tree (in ``psyclone.generator.generate``). This parse tree is then
passed to the ``NemoPSy`` constructor which uses the ``fparser2`` PSyIR
frontend to construct the equivalent PSyIR. (This PSyIR is
'language-level' in that it does not contain any domain-specific
constructs.) Finally, the PSyIR is passed to the ``NemoInvokes``
constructor which applies various 'raising' transformations which
raise the level of abstraction by introducing domain-specific
information.

Implicit Loops
--------------

Expand All @@ -1283,7 +1267,7 @@ use of array notation is encouraged in the NEMO Coding Conventions
:cite:`nemo_code_conv` and identifying these loops can be important
when introducing, e.g. OpenMP. These implicit loops are not
automatically represented as PSyIR Loop instances but can be converted
to explicit loops using the ``NemoAllArrayRange2LoopTrans``
to explicit loops using the ``ArrayAssignment2LoopsTrans``
transformation.


Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/coding-style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ domain:

psyir:
This directory contains all classes and functions related to the PSyIR
(PSyclone Internal Representation). The directory itself does not contain
(PSyclone Intermediate Representation). The directory itself does not contain
any source files (except `__init__.py` to shorten the import paths).

psyir/transformations
Expand Down
5 changes: 0 additions & 5 deletions doc/developer_guide/dependency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
from psyclone.psyir.tools import DependencyTools
from psyclone.transformations import OMPLoopTrans

# Make sure we use nemo here, otherwise depending on order the
# wrong API might be set.
from psyclone.configuration import Config
Config.get().api = "nemo"

code = '''subroutine sub()
integer :: i, j, k, a(11, 11)
a(i,j) = 1
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion doc/developer_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
psyir
psyir_symbols
psyir_backends
parsing
psykal
module_manager
APIs
modules
Expand Down
4 changes: 2 additions & 2 deletions doc/developer_guide/psyir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
.. L. Turner, Met Office
The PSyclone Internal Representation (PSyIR)
############################################
The PSyclone Intermediate Representation (PSyIR)
################################################

The PSyclone Intermediate Representation (PSyIR) is a language-independent
Intermediate Representation that PSyclone uses to represent the PSy (Parallel
Expand Down
Loading

0 comments on commit 624afbd

Please sign in to comment.