Skip to content

Commit

Permalink
#1010 Bring to master
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Nov 1, 2024
2 parents b81e2ed + 715dccb commit b3a3d82
Show file tree
Hide file tree
Showing 50 changed files with 1,680 additions and 556 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ on:
push

env:
CUDA_VERSION: 12.6.0
CUDA_VERSION: 12.6.2
GFORTRAN_VERSION: 14.2.0
HDF5_VERSION: 1.14.4.3
HDF5_VERSION: 1.14.5
NETCDF_C_VERSION: 4.9.2
NETCDF_FORTRAN_VERSION: 4.6.1
NVFORTRAN_VERSION: 24.7
NVFORTRAN_VERSION: 24.9
OPENMPI_VERSION: 5.0.5
PYTHON_VERSION: 3.12.5
PYTHON_VERSION: 3.13.0

jobs:
run_if_on_mirror:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lfric_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: self-hosted
env:
LFRIC_APPS_REV: 3269
PYTHON_VERSION: 3.12.5
PYTHON_VERSION: 3.13.0

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ jobs:
if: ${{ github.repository == 'stfc/PSyclone-mirror' }}
runs-on: self-hosted
env:
HDF5_VERSION: 1.14.4.3
HDF5_VERSION: 1.14.5
NETCDF_C_VERSION: 4.9.2
NETCDF_FORTRAN_VERSION: 4.6.1
NVFORTRAN_VERSION: 23.7
ONEAPI_VERSION: 2024.2.1
PERL_VERSION: 5.40.0
PYTHON_VERSION: 3.12.5
PYTHON_VERSION: 3.13.0

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- run: sudo apt-get install -y graphviz doxygen
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
Expand All @@ -83,7 +83,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- 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 @@ -99,7 +99,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.12]
python-version: [3.7, 3.8, 3.13]
steps:
- uses: actions/checkout@v4
with:
Expand Down
16 changes: 16 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,22 @@
83) PR #2743 for #2742. Ensure generated code for function spaces in
LFRic is always in a consistent order.

84) PR #2746. Update minor versions of CUDA, HDF5, nvfortran and
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.

88) PR #2753 towards #2717. Adds DataNode.is_character method.

89) PR #2712 for #2711. Adds support for user-supplied Kernels that
operate on dofs (in the LFRic API).

99) PR #2685 for #2027. Improves datatype and shape inference.

release 2.5.0 14th of February 2024

1) PR #2199 for #2189. Fix bugs with missing maps in enter data
Expand Down
94 changes: 47 additions & 47 deletions doc/developer_guide/APIs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ TBD

.. Generating API-specific code
.. ============================
..
..
.. This section explains how to create a new API in PSyclone. PSyclone
.. currently supports the following APIs: lfric and gocean.
..
..
.. config.py
.. ---------
..
..
.. The names of the supported APIs and the default API are specified in
.. ``configuration.py``. When adding a new API you must add the name you would like
.. to use to the ``_supported_api_list``.
..
..
.. parse.py
.. --------
..
..
.. The parser reads the algorithm code and associated kernel metadata.
..
..
.. The parser currently assumes that all APIs will use the ``invoke()``
.. API for the algorithm-to-psy layer but that the content and structure
.. of the metadata in the kernel code may differ. If the algorithm API
.. differs, then the parser will need to be refactored. This is beyond
.. the scope of this document and is currently not considered in the
.. PSyclone software architecture.
..
..
.. The kernel metadata however, will be different from one API to
.. another. To parse this kernel-API-specific metadata a
.. ``KernelTypeFactory`` is provided which should return the appropriate
Expand All @@ -79,7 +79,7 @@ TBD
.. in the ``KernelTypeFactory`` class. If the kernel metadata happens to be
.. the same as another existing API then the existing ``KernelType``
.. subclass can be used for the new API.
..
..
.. The ``KernelType`` subclass needs to specialise the class constructor
.. and initialise the ``KernelType`` base class with the
.. supplied arguments. The role of the ``KernelType`` subclass is to create
Expand All @@ -88,95 +88,95 @@ TBD
.. this is appends the kernel-metadata-specific subclass instance is
.. appended to the ``_arg_descriptors`` list provided by the ``KernelType``
.. base class.
..
..
.. TBC
..
..
.. This information
..
..
.. KernelType base class assumes kernel metadata stored as a type. Searches for that type.
.. Checks whether the metadata is public (it should be ?)
.. Assumes iterates_over variable.
.. Binding to a procedure - assumes one of two styles.
.. Assumes a meta_args type
.. *What about our func_args type???*
..
..
.. type x
.. meta_args=
.. *meta_func=*
.. iterates_over=
.. code => or code =
.. end type x
..
..
.. The descriptor class ...
..
..
.. psyGen.py
.. ---------
..
..
.. factory
.. +++++++
..
..
.. A new file needs to be created and the following classes found in
.. psyGen.py need to be subclassed.
..
..
.. PSy, Invokes, Invoke, InvokeSchedule, Loop, Kern, Arguments, Argument
.. You may also choose to subclass the Inf class if required.
..
..
.. The subclass of the PSy class then needs to be added as an option to
.. the create method in the PSyFactory class.
..
..
.. Initialisation
.. ++++++++++++++
..
..
.. The parser information passed to the PSy layer is used to create an
.. invokes object which in turn creates a list of invoke objects. Each
.. invoke object contains an InvokeSchedule which consists of loops and
.. calls. Finally, a call contains an arguments object which itself
.. contains a list of argument objects.
..
..
.. To make sure the subclass versions of the above objects are created
.. the __init__ methods of the subclasses must make sure they create
.. the appropriate objects.
..
..
.. Some of the baseclass constructors (__init__ methods) support the
.. classname being provided. This allow them to instantiate the
.. appropriate objects without knowing what they are.
..
..
.. gen_code()
.. ++++++++++
..
..
.. All of the above classes (with the exception of PSy which supports a
.. gen() method) have the gen_code() method. This method passes the
.. parent of the generation tree and expect the object to add the code
.. associated with the object as a child of the parent. The object is
.. then expected to call any children. This approach is powerful as it
.. lets each object concentrate on the code that it is responsible for.
..
..
.. Adding code in gen_code()
.. +++++++++++++++++++++++++
..
..
.. The f2pygen classes have been developed to help create appropriate
.. fortran code in the gen_code() method.
..
..
.. When writing a gen_code() method for a particular object and API it is
.. natural to add code as a child of the parent provided by the callee of
.. the method. However, in some cases we do not want code to appear at
.. the current position in the hierarchy.
..
..
.. The add() method
.. ++++++++++++++++
..
..
.. PSyclone supports this via the add() method
..
..
.. explicitly place at the appropriate place in the hierarchy. For example,
.. parent.parent.add(...)
..
..
.. optional argument. default is auto. This attempts to place code in the
.. expected place. For example, specify a declaration. auto finds a
.. correct place to put this code.
..
..
.. Specify position explicitly
.. "before", "after", "first", "last"
..
..
.. Sometimes don't know exactly where to place. On example that is
.. supported is when you want to add something before or after a loop
.. nest. start_parent_loop(). This method recurses up until the parent is
Expand Down Expand Up @@ -333,7 +333,7 @@ grey) then we get:

.. image:: dofs_cont_halos.png
:width: 230

An example for a depth-1 halo implementation with the earlier mesh
split into 2 partitions is given below, with the halo cells drawn in
grey and halo dofs coloured red. An example local indexing scheme is
Expand Down Expand Up @@ -403,9 +403,9 @@ Loop iterators
--------------

In the current implementation of the LFRic API it is possible to
iterate (loop) either over cells or dofs. At the moment all coded
kernels are written to iterate over cells and all Built-in kernels are
written to iterate over dofs, but that does not have to be the case.
iterate (loop) either over cells or dofs. At the moment coded
kernels can be written to iterate over cells or dofs and all Built-in kernels
are written to iterate over dofs, but that does not have to be the case.

The loop iteration information is specified in the kernel metadata. In
the case of Built-ins there is kernel metadata but it is part of
Expand Down Expand Up @@ -994,7 +994,7 @@ If an application is being built in parallel then it is possible that
different invocations of PSyclone will happen simultaneously and
therefore we must take care to avoid race conditions when querying the
filesystem. For this reason we use ``os.open``::

fd = os.open(<filename>, os.O_CREAT | os.O_WRONLY | os.O_EXCL)

The ``os.O_CREATE`` and ``os.O_EXCL`` flags in combination mean that
Expand All @@ -1020,7 +1020,7 @@ of a given colour may be safely updated in parallel
Example of the colouring of the horizontal cells used to
ensure the thread-safe update of shared dofs (black
circles). (Courtesy of S. Mullerworth, Met Office.)

The loop over colours must then be performed sequentially but the loop
over cells of a given colour may be done in parallel. A loop that
requires colouring may be transformed using the ``Dynamo0p3ColourTrans``
Expand Down Expand Up @@ -1206,13 +1206,13 @@ TBD

.. OpenMP Support
.. --------------
..
..
.. Loop directives are treated as first class entities in the psyGen
.. package. Therefore they can be added to psyGen's high level
.. representation of the fortran code structure in the same way as calls
.. and loops. Obviously it is only valid to add a loop directive outside
.. of a loop.
..
..
.. When adding a call inside a loop the placement of any additional calls
.. or declarations must be specified correctly to ensure that they are
.. placed at the correct location in the hierarchy. To avoid accidentally
Expand All @@ -1222,7 +1222,7 @@ TBD
.. f2pygen*. This method returns the location at the top of any loop
.. hierarchy and before any comments immediately before the top level
.. loop.
..
..
.. The OpenMPLoopDirective object needs to know which variables are
.. shared and which are private. In the current implementation default
.. shared is used and private variables are listed. To determine the
Expand All @@ -1233,13 +1233,13 @@ TBD
.. the directive and adds each calls list of private variables, returned
.. with the local_vars() method. Therefore the OpenMPLoopDirective object
.. relies on calls specifying which variables they require being local.
..
..
.. Next ...
..
..
.. Update transformation for colours
..
.. OpenMPLoop transformation in transformations.py.
..
..
.. OpenMPLoop transformation in transformations.py.
..
.. Create third transformation which goes over all loops in a schedule and
.. applies the OpenMP loop transformation.
Expand Down
4 changes: 2 additions & 2 deletions doc/developer_guide/working_practises.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,13 @@ computational cost (so that we 'fail fast'):
3. All links within the Sphinx documentation (rst files) are checked (see
note below);

4. All of the examples are tested (for Python versions 3.7, 3.8 and 3.12)
4. All of the examples are tested (for Python versions 3.7, 3.8 and 3.13)
using the ``Makefile`` in the ``examples`` directory. No compilation is
performed; only the ``transform`` (performs the PSyclone transformations)
and ``notebook`` (runs the various Jupyter notebooks) targets are used.
The ``transform`` target is run 2-way parallel (``-j 2``).

5. The full test suite is run for Python versions 3.7, 3.8 and 3.12 but
5. The full test suite is run for Python versions 3.7, 3.8 and 3.13 but
without the compilation checks. ``pytest`` is passed the ``-n auto`` flag
so that it will run the tests in parallel on as many cores as are
available (currently 2 on GHA instances).
Expand Down
Loading

0 comments on commit b3a3d82

Please sign in to comment.