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 #1010, #1910, #719, #798, #1648) Generate PSy-layers and Kernel Subs using PSyIR lowering (instead of gen_code/f2pygen) #2834

Open
wants to merge 154 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
bc49de6
#1010 Start converting LFRic PSy-layer declarations and initialisatio…
sergisiso Apr 9, 2024
a3e1b35
Merge remote-tracking branch 'origin/1495_type_bound_methods' into 10…
sergisiso Apr 14, 2024
e864bc2
#1010 Continue porting LFRic declarations and initialisations to PSyIR
sergisiso Apr 22, 2024
df68488
#1010 Pass one more test using backend declarations instead of f2pygen
sergisiso Apr 30, 2024
cd515be
#1010 Bring to master
sergisiso Apr 30, 2024
0b90f7b
#1010 More tests use backend declarations instead of f2pygen
sergisiso Apr 30, 2024
96c1aa6
#1010 More tests use backend declarations instead of f2pygen
sergisiso Apr 30, 2024
5c74c42
#1010 More tests use backend declarations instead of f2pygen, pass cu…
sergisiso May 3, 2024
e661950
#1010 More tests use backend declarations instead of f2pygen, and add…
sergisiso May 6, 2024
64a6bfd
#1010 More tests use backend declarations instead of f2pygen
sergisiso May 7, 2024
6c55316
#1010 Update dynamo0p3_basis test to the fortran backend syntax
sergisiso May 13, 2024
93f88f3
#1010 Start updating stub generation tests for new backend
sergisiso May 21, 2024
77fe7ff
#1010 Bring to master
sergisiso Jun 11, 2024
99ffbbe
Merge remote-tracking branch 'origin/1010_remaining_lfric_lowering' i…
sergisiso Jun 11, 2024
99422e6
#1010 Fix tests in psyir
sergisiso Jun 18, 2024
9be02af
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Jun 18, 2024
2481022
#1010 Fix tests in psyir introduced by lastest update to master
sergisiso Jun 18, 2024
decd073
#1010 Merge master and refactored builtin tests
sergisiso Jul 2, 2024
0e05a0b
#1010 Fix output syntax in gocean opencl trans tests
sergisiso Jul 2, 2024
ef34fa1
#1010 Start updating dynamo0p3_transformations_test to check output w…
sergisiso Jul 2, 2024
62e41e5
#1010 Update more dynamo0p3_transformations_test test to use the psyi…
sergisiso Jul 4, 2024
8908239
#1010 Update more dynamo0p3_transformations_test test to use the psyi…
sergisiso Jul 10, 2024
930ddb9
#1010 Bring to master
sergisiso Jul 18, 2024
a2942f1
#1010 Fix some issues introduced due to previous merge with master
sergisiso Jul 19, 2024
cf63302
#1010 Fix issues with reference_element
sergisiso Jul 19, 2024
3d8969c
#1010 Start porting reductions to generic PSyIR
sergisiso Jul 19, 2024
98a899c
#1010 Remove file mistakenly introduced when brining the branch to ma…
sergisiso Jul 19, 2024
ddef4de
#1010 Move LFRic reductions to OpenMP classes
sergisiso Jul 24, 2024
b697236
#1010 Bring to master
sergisiso Jul 25, 2024
6ab2c8c
#1010 Modifications to pass more LFRic OpenMP reduction tests
sergisiso Jul 25, 2024
bbb31da
#1010 Modify the starting kernels comment in the invoke schedule
sergisiso Jul 25, 2024
6bf1383
#1010 Fix more LFRic OpenMP tests
sergisiso Jul 25, 2024
6787c5e
#1010 Fix a few more LFRic tests using the PSyIR backend
sergisiso Jul 25, 2024
960855f
#1010 Update more lfric transformations tests
sergisiso Aug 2, 2024
0d0d8e3
#1010 Continue fixing lfric tests after switching to PSyIR backend
sergisiso Aug 2, 2024
0cdb879
#1010 Fix more LFRic test syntax to match Fortran backend
sergisiso Aug 5, 2024
4c74023
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Aug 5, 2024
5c08043
#1010 Continue porting LFRic to PSyIR backend
sergisiso Aug 9, 2024
35180f8
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Aug 9, 2024
2a556b2
#1010 Fix more LFRic tests
sergisiso Aug 13, 2024
990afa5
#1010 Fix LFRic stencil tests for PSyIR backend
sergisiso Aug 14, 2024
46eee5c
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Aug 14, 2024
d3dab2d
#1010 Fix LFRic stencil stubs tests for PSyIR backend
sergisiso Aug 15, 2024
3ac82c5
#1010 LFRic uses wildcard import for constants_mod
sergisiso Aug 15, 2024
e8bfe66
#1010 Fix more LFRic tests for PSyIR backend
sergisiso Aug 15, 2024
d83f380
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Sep 12, 2024
8183b8a
1010 Fix test after moving LFRic to use the new backend
sergisiso Sep 12, 2024
55a4eaa
1010 Set LFRic loop bounds during lowering bounds initialisation
sergisiso Sep 16, 2024
225d346
1010 Fix some LFRic stub tests
sergisiso Sep 16, 2024
17f6749
1010 Fix more tests after switching to new PSyIR backend
sergisiso Sep 16, 2024
84f96e3
1010 Fix tests after moving LFRic to use the new backend
sergisiso Sep 16, 2024
c9938f3
1010 Fix psydata tests (except loop bounds and a few driver creator t…
sergisiso Sep 18, 2024
50ad16c
1010 Fix more LFRic tests
sergisiso Sep 18, 2024
3cc4589
1010 Fix LFRic quadrature tests
sergisiso Sep 19, 2024
c719f11
1010 Use generic symbol table in LFRic and fix more tests
sergisiso Sep 24, 2024
f0c87d2
1010 Fix more LFRic tests
sergisiso Sep 24, 2024
d398ed2
1010 Fix more LFRic tests and start updating mesh map code
sergisiso Sep 25, 2024
2a3fe85
#1010 Bring to master
sergisiso Oct 4, 2024
b0d5e98
#1010 Update more LFRic test to new backend
sergisiso Oct 4, 2024
009006f
#1010 Fix more LFRic test for the new backend
sergisiso Oct 5, 2024
14e0b23
#1010 Fix more LFRic test for the new backend
sergisiso Oct 5, 2024
eee5c9c
#1010 Do not store InvokeSchedules and SymbolTables inside other classes
sergisiso Oct 9, 2024
e3d2f2e
#1010 Fix issues with compilation tests
sergisiso Oct 12, 2024
501655a
#1010 Start cleaning up PR
sergisiso Oct 12, 2024
82d8706
#1010 Bring the failing tests down to 0 again (but some with xfails/e…
sergisiso Oct 14, 2024
a5c50fd
#1010 Bring the failing tests down to 0 again (but some with xfails/e…
sergisiso Oct 14, 2024
b134171
#2730 Generalise acc_parallel lfric script to also accept openmp dire…
sergisiso Oct 2, 2024
300afee
#2730 Add gen_code support for OpenMP target directives
sergisiso Oct 2, 2024
08e9221
#2730 Fix issues with LFRic OMP offloading and add it to the integrat…
sergisiso Oct 3, 2024
a0d5e2f
#2730 Fix CI failures
sergisiso Oct 3, 2024
0fb3098
#2730 Add tests for missing code coverage
sergisiso Oct 3, 2024
1f97c15
#2730 Update LFRic offloading envvar and fix comments and docstrings
sergisiso Oct 7, 2024
cfcc44d
#2730 Fix lfric nvfortran.mk syntax
sergisiso Oct 7, 2024
39c3037
#2733 update UG and changelog
arporter Oct 8, 2024
9edd419
Sorted the fspaces in the LFRic algorithm generation
DrTVockerodtMO Oct 10, 2024
298fa90
Added my name to modified by list
DrTVockerodtMO Oct 10, 2024
ea78b6f
Modified test to check for correct function space ordering
DrTVockerodtMO Oct 10, 2024
cf32395
Made the test use a shuffled input
DrTVockerodtMO Oct 10, 2024
9558dc4
#2743 update changelog and UG
arporter Oct 11, 2024
43a0e83
#1010 Restore missing set halo dirty comment
sergisiso Oct 14, 2024
d1ab352
#1010 Bring to master
sergisiso Oct 14, 2024
7cae96a
#1010 Start cleaning up PR
sergisiso Oct 14, 2024
ecd20d3
#1010 Cleaning up PR
sergisiso Oct 14, 2024
b81e2ed
#1010 Cleaning up PR
sergisiso Oct 14, 2024
b3a3d82
#1010 Bring to master
sergisiso Nov 1, 2024
dbac36c
#1010 Bring to master
sergisiso Nov 12, 2024
5a7b0a6
1010 Bring to master (with issues)
sergisiso Nov 17, 2024
36af0bf
#1010 Bring to master
sergisiso Dec 20, 2024
abc2feb
#1010 Fix flake8 errors
sergisiso Dec 20, 2024
0ffbb70
#1010 Fix some issues with the LFRic HaloEx tests
sergisiso Dec 29, 2024
65afad9
#1010 Fix remaining issues with LFRic lowering backend
sergisiso Dec 29, 2024
c754874
#1010 Clean up old comments and improve docstrings
sergisiso Dec 29, 2024
713a758
#1010 Fix compilation errors
sergisiso Dec 29, 2024
bbf58ab
#1010 Fix example and resolve some fixmes
sergisiso Dec 29, 2024
f3d3574
#1010 Temporary disable lfric psydata compilation
sergisiso Dec 30, 2024
b7cb593
#1010 Revert skipped example/tutorial and remove some unused code
sergisiso Dec 30, 2024
7d3ab2a
#1010 Remove unused code
sergisiso Dec 30, 2024
b9a64c1
#1010 Fix test
sergisiso Dec 30, 2024
9ff9eae
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Dec 30, 2024
dc1c142
#1010 Fix merge issue
sergisiso Dec 30, 2024
3ab9c4d
#1010 Fix flake8 issues
sergisiso Dec 30, 2024
852a826
#1010 Improve test coverage and fix integration test issue
sergisiso Dec 31, 2024
1dd394e
#1010 Remove some more old code and fix tests
sergisiso Jan 6, 2025
5d7d712
#1010 Do not generate th_idx and nthreads variables when not needed
sergisiso Jan 6, 2025
5dc9ec0
#1010 Fix some xfail tests
sergisiso Jan 9, 2025
e90cbcf
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Jan 12, 2025
3a4b983
#1010 Resolve some issues with psy_data
sergisiso Jan 22, 2025
3a18bb3
#1010 Move LFRic loop_start/stop symbols at the beginning
sergisiso Jan 22, 2025
cd18e86
#1010 Remove NOT_INITIALISED integer literals
sergisiso Jan 22, 2025
6ddb65e
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Jan 23, 2025
c345f0a
#1010 Clean up psy_data_node
sergisiso Jan 23, 2025
9ec3f54
#1010 Convert some array types to pointers
sergisiso Jan 23, 2025
57db171
#1010 Clean up PR
sergisiso Jan 23, 2025
92fed41
#1010 Improve naming, docstrings and comments
sergisiso Jan 27, 2025
bb53018
#1010 Clean up LFRicLoop code
sergisiso Jan 28, 2025
1a06860
#1010 Refactor LFRicCollections.declarations
sergisiso Jan 29, 2025
cdb2399
#1010 Clean up PR
sergisiso Jan 29, 2025
0614d93
#1010 Fix flake8 issues
sergisiso Jan 29, 2025
d7fcd56
#1010 Bring to master
sergisiso Jan 29, 2025
1a67f95
#1010 Fix typing issue with python3.8
sergisiso Jan 30, 2025
5d66448
#1010 Remove cursor argument from invoke_declarations
sergisiso Jan 30, 2025
ac88bd0
#1010 Improve tests and documentation
sergisiso Jan 30, 2025
6ac84f3
#1010 Remove leftover f2pygen in gocean and updated test syntax
sergisiso Jan 31, 2025
6cef2df
#1010 Fix compilation tests
sergisiso Jan 31, 2025
fe26a76
#1010 Remove remaining references to the gen_code method
sergisiso Feb 3, 2025
7040b7c
#1010 Rename gen_code variable to code in tests
sergisiso Feb 3, 2025
5996da2
#1010 Delete f2pygen classes
sergisiso Feb 3, 2025
8db5dfa
#1010 Clean up f2pygen mentions and fix some tests/coverage
sergisiso Feb 3, 2025
bbae102
#1010 Fix typos and tests
sergisiso Feb 10, 2025
0bdb80c
#1010 Change LFRic compilation assert location and add output global …
sergisiso Feb 10, 2025
973d654
#1010 Remove unneeded symbols from stub tests
sergisiso Feb 10, 2025
8ac5de3
#1010 Improve LFRic tests
sergisiso Feb 10, 2025
6dccea4
#1010 Remove commented out code
sergisiso Feb 10, 2025
0fcbc51
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Feb 10, 2025
b2049ad
#1010 Fix flake8 issues
sergisiso Feb 10, 2025
4fd0beb
#1010 Fix issue with older python versions
sergisiso Feb 10, 2025
ada35dc
#1010 Fix tests that had changed behaviour
sergisiso Feb 13, 2025
71f85e2
#1010 Revert some Compilation deletion and fix some coverage
sergisiso Feb 14, 2025
55341ea
#1010 LFric bounds names are now given by the index of counting only …
sergisiso Feb 14, 2025
b005d8f
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Feb 14, 2025
c1481f1
#1010 Remove unneeded code
sergisiso Feb 14, 2025
cd5b832
#1010 Fix flake8 issue
sergisiso Feb 14, 2025
17b73c1
#1010 Remove spurious nlayers delcaration from LFRic stubs
sergisiso Feb 14, 2025
b6d1ff9
#1010 Bring to master
sergisiso Feb 19, 2025
9e1a888
#1010 Bring to master
sergisiso Feb 24, 2025
b09a941
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Feb 24, 2025
e2c7464
#1010 Fix output syntax of extraction test
sergisiso Feb 24, 2025
434b0c3
#1010 Fix issues with symbols
sergisiso Feb 26, 2025
f4c2ebf
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Feb 26, 2025
ba10989
#1010 Fix arg_ordering tag lookup
sergisiso Feb 26, 2025
eff7b5c
#1010 Fix a wrong test and clean up code
sergisiso Feb 27, 2025
226302a
#1010 Recover missing test coverage
sergisiso Feb 27, 2025
8033d65
#1010 Use signatures for unused symbol removal in the LoopFuseTrans
sergisiso Feb 27, 2025
f8bc89a
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
sergisiso Feb 27, 2025
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
68 changes: 1 addition & 67 deletions doc/developer_guide/APIs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,6 @@ TBD
.. 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
.. ++++++++++++++++
..
Expand Down Expand Up @@ -633,8 +612,7 @@ operator are computed redundantly in the halo up to depth-1 (see the
requires a check that any loop which includes a kernel that reads from
an operator is limited to iterating in the halo up to
depth-1. PSyclone will raise an exception if an optimisation attempts
to increase the iteration space beyond this (see the ``gen_code()``
method in the ``LFRicKern`` class).
to increase the iteration space beyond this point.

To alleviate the above restriction one could add a configurable depth with
which to compute operators e.g. operators are always computed up to
Expand Down Expand Up @@ -1201,50 +1179,6 @@ the `w0` function space then at least one of the the `meta_arg`
arguments must be on the `w0` function space. However, this is not
checked in the current implementation.

GOcean1.0
=========

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
.. splitting the loop directive from its loop the start_parent_loop()
.. method can be used. This is available as a method in all fortran
.. generation calls. *We could have placed it in psyGen instead of
.. 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
.. objects private variables the OpenMP implementation uses its internal
.. xxx_get_private_list() method. This method first finds all loops
.. contained within the directive and adds each loops variable name as a
.. private variable. this method then finds all calls contained within
.. 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.
..
.. Create third transformation which goes over all loops in a schedule and
.. applies the OpenMP loop transformation.
NEMO
====

Expand Down
71 changes: 5 additions & 66 deletions doc/developer_guide/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,67 +40,6 @@ Modules
This section describes the functionality of the various Python modules
that make up PSyclone.

Module: f2pygen
===============

.. warning::
The f2pygen functionality has been superseded by the development of
the PSyIR and will be removed entirely in a future release.

`f2pygen` provides functionality for generating Fortran code from
scratch and supports the addition of a use statement to an existing
parse tree.

Variable Declarations
---------------------

Three different classes are provided to support the creation of
variable declarations (for intrinsic, character and derived-type
variables). An example of their use might be:

>>> from psyclone.f2pygen import (ModuleGen, SubroutineGen, DeclGen,
... CharDeclGen, TypeDeclGen)
>>> module = ModuleGen(name="testmodule")
>>> sub = SubroutineGen(module, name="testsubroutine")
>>> module.add(sub)
>>> sub.add(DeclGen(sub, datatype="integer", entity_decls=["my_int"]))
>>> sub.add(CharDeclGen(sub, length="10", entity_decls=["my_char"]))
>>> sub.add(TypeDeclGen(sub, datatype="field_type", entity_decls=["ufld"]))
>>> gen = str(module.root)
>>> print(gen)
MODULE testmodule
IMPLICIT NONE
CONTAINS
SUBROUTINE testsubroutine()
TYPE(field_type) ufld
CHARACTER(LEN=10) my_char
INTEGER my_int
END SUBROUTINE testsubroutine
END MODULE testmodule

The full interface to each of these classes is detailed below:

.. autoclass:: psyclone.f2pygen.DeclGen
:members:
:noindex:

.. autoclass:: psyclone.f2pygen.CharDeclGen
:members:
:noindex:

.. autoclass:: psyclone.f2pygen.TypeDeclGen
:members:
:noindex:

Adding code
-----------

`f2pygen` supports the addition of use statements to an existing
`fparser1` parse tree:

.. autofunction:: psyclone.f2pygen.adduse


.. _dev_configuration:

Module: configuration
Expand Down Expand Up @@ -252,7 +191,7 @@ Module: dynamo0p3
=================

Specialises various classes from the ``psyclone.psyGen`` module
in order to support the Dynamo 0.3 API.
in order to support the LFRic API.

When constructing the Fortran subroutine for either an Invoke or
Kernel stub (see :ref:`stub-generation`), there are various groups of
Expand All @@ -265,15 +204,15 @@ sub-class of the ``LFRicCollection`` abstract class:
:private-members:
:noindex:

(A single base class is used for both Invokes and Kernel stubs since it
allows the code dealing with variable declarations to be shared.)
A single ``LFRicCollection`` class is used for both Invokes and Kernel stubs
since it allows the code dealing with variable declarations to be shared.
A concrete sub-class of ``LFRicCollection`` must provide an
implementation of the ``_invoke_declarations`` method. If the
implementation of the ``invoke_declarations`` method. If the
quantities associated with the collection require initialisation
within the PSy layer then the ``initialise`` method must also be
implemented. If stub-generation is to be supported for kernels that
make use of the collection type then an implementation must also be
provided for ``_stub_declarations.``
provided for ``stub_declarations``.

Although instances of (sub-classes of) ``LFRicCollection`` handle all
declarations and initialisation, there remains the problem of
Expand Down
28 changes: 14 additions & 14 deletions doc/developer_guide/psy_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ The derived classes will typically control the behaviour
of ``PSyDataNode`` by providing additional parameters.

.. autoclass:: psyclone.psyir.nodes.PSyDataNode
:members: gen_code
:members:

There are two ways of passing options to the
``PSyDataNode``. The first one is used to pass
Expand All @@ -488,8 +488,8 @@ can be somewhat cryptic due to the need to be unique).
The region name is validated by ``PSyDataTrans``, and
then passed to the node constructor. The ``PSyDataNode``
stores the name as an instance attribute, so that they can
be used at code creation time (when ``gen_code`` is being
called). Below is the list of all options that the PSyData
be used at code creation time (PSyIR lowering).
Below is the list of all options that the PSyData
node supports in the option dictionary:

.. table::
Expand All @@ -516,15 +516,15 @@ node supports in the option dictionary:

Passing Parameter From a Derived Node to the ``PSyDataNode``
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The ``PSyDataTrans.gen_code`` function also accepts
an option dictionary, which is used by derived nodes
to control code creation. The ``gen_code`` function
is called internally, not directly by the user. If
the ``gen_code`` function of a node derived from
``PSyDataNode`` is called, it can define this
The ``PSyDataNode.lower_to_language_level`` function also accepts
an option dictionary, which is used by derived nodes to control code
creation.
The ``lower_to_language_level`` function is called internally, not
directly by the user. If the ``lower_to_language_level`` function of a
node derived from ``PSyDataNode`` is called, it can define this
option directory to pass the parameters to the ``PSyDataNode``'s
``gen_code`` function. Here are the options that are currently
supported by ``PSyDataNode``:
``lower_to_language_level`` function. Here are the options that are
currently supported by ``PSyDataNode``:

================ =========================================
Parameter Name Description
Expand Down Expand Up @@ -554,9 +554,9 @@ for more details.

The kernel extraction node ``ExtractNode`` uses the dependency
module to determine which variables are input- and output-parameters,
and provides these two lists to the ``gen_code()`` function of its base class,
a ``PSyDataNode`` node. It also uses the ``post_var_postfix`` option
as described under ``gen_code()`` above (see also
and provides these two lists to the ````lower_to_language_level``()`` function
of its base class, a ``PSyDataNode`` node. It also uses the ``post_var_postfix``
option as described under ``lower_to_language_level``()`` above (see also
:ref:`user_guide:extraction_libraries`).

.. _psydata_base_class:
Expand Down
12 changes: 4 additions & 8 deletions doc/developer_guide/psyir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,7 @@ psyclone.psyir.nodes.html#psyclone.psyir.nodes.Directive`.
.. warning::
Some parts of some Clauses are still under development, and not all clauses
are encoded in Clauses classes yet (for example OpenACC clauses). These
clause strings are instead generated inside the ``begin_string`` or
``gen_code`` methods during code generation.
clause strings are instead generated inside the ``begin_string``.

.. _named_arguments-label:

Expand Down Expand Up @@ -991,9 +990,7 @@ The Kernel-layer subclasses will be used to:
translated into LFRic PSyIR using the expected datatypes as
specified by the kernel metadata and associated LFRic rules.

3) replace the existing kernel stub generation implementation so that
the PSyIR back ends can be used and PSyclone will rely less on
``f2pygen`` and ``fparser1``. At the moment ``kernel_interface``
3) At the moment ``kernel_interface``
provides the same functionality as ``kern_stub_arg_list``, except
that it uses the symbol table (which keeps datatypes and their
declarations together).
Expand Down Expand Up @@ -1087,9 +1084,8 @@ correspond to and how the arguments relate to each other (they just
output strings).

The logic and declaration of kernel variables is handled separately by
the ``gen_stub`` method in ``LFRicKern`` and the ``gen_code`` method in
``LFRicInvoke``. In both cases these methods make use of the subclasses
of ``LFRicCollection`` to declare variables.
the ``stub_declarations`` and ``invoke_declarations`` methods in the
appropirate ``LFRicCollection``.

When using the symbol table in the LFRic PSyIR we naturally capture
arguments and datatypes together. The ``KernelInterface`` class is
Expand Down
10 changes: 5 additions & 5 deletions doc/user_guide/dynamo0p3_topclasses.dot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ digraph "classes_dynamo0p3" {
charset="utf-8"
rankdir=BT

"20" [label="{LFRicInvoke|\l|arg_for_funcspace()\lfield_on_space()\lgen_code()\lis_coloured()\lunique_fss()\lunique_proxy_declarations()\l}", shape="record"];
"20" [label="{LFRicInvoke|\l|arg_for_funcspace()\lfield_on_space()\lis_coloured()\lunique_fss()\lunique_proxy_declarations()\l}", shape="record"];
"21" [label="{LFRicInvokeSchedule|\l|view()\l}", shape="record"];
"35" [label="{DynamoInvokes|\l|}", shape="record"];
"36" [label="{LFRicPSy|\l|}", shape="record"];
"45" [label="{Invoke|\l|first_access()\lgen()\lgen_code()\lunique_declarations()\lunique_declns_by_intent()\l}", shape="record", style=filled, fillcolor="antiquewhite"];
"46" [label="{InvokeSchedule|\l|gen_code()\lview()\l}", shape="record"];
"47" [label="{Invokes|\l|gen_code()\lgen_ocl_init()\lget()\l}", shape="record", style=filled, fillcolor="antiquewhite"];
"54" [label="{Node|\l|addchild()\lancestor()\lbackward_dependence()\lcalls()\ldag()\ldag_gen()\lfollowing()\lforward_dependence()\lgen_c_code()\lgen_code()\lindent()\lis_openmp_parallel()\lis_valid_location()\lkern_calls()\llist()\llist_to_string()\lloops()\lpreceding()\lreductions()\lsameParent()\lsameRoot()\lupdate()\lview()\lwalk()\l}", shape="record"];
"45" [label="{Invoke|\l|first_access()\lgen()\lunique_declarations()\lunique_declns_by_intent()\l}", shape="record", style=filled, fillcolor="antiquewhite"];
"46" [label="{InvokeSchedule|\l|view()\l}", shape="record"];
"47" [label="{Invokes|\l|gen_ocl_init()\lget()\l}", shape="record", style=filled, fillcolor="antiquewhite"];
"54" [label="{Node|\l|addchild()\lancestor()\lbackward_dependence()\lcalls()\ldag()\ldag_gen()\lfollowing()\lforward_dependence()\lgen_c_code()\lindent()\lis_openmp_parallel()\lis_valid_location()\lkern_calls()\llist()\llist_to_string()\lloops()\lpreceding()\lreductions()\lsameParent()\lsameRoot()\lupdate()\lview()\lwalk()\l}", shape="record"];
"55" [label="{PSy|\l|inline()\l}", shape="record", style=filled, fillcolor="antiquewhite"];
"56" [label="{Schedule|\l|view()\l}", shape="record", style=filled, fillcolor="antiquewhite"];

Expand Down
5 changes: 0 additions & 5 deletions doc/user_guide/dynamo0p3_topclasses.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions doc/user_guide/gocean1p0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,7 @@ Rules
#####

Kernel arguments follow a set of rules which have been specified for
the GOcean 1.0 API. These rules are encoded in the ``gen_code()``
method of the ``GOKern`` class in the ``gocean1p0.py`` file. The
rules, along with PSyclone's naming conventions, are:
the GOcean 1.0 API. The rules, along with PSyclone's naming conventions, are:

1) Every kernel has the indices of the current grid point as the first two arguments, ``i`` and ``j``. These are integers and have intent ``in``.

Expand Down
4 changes: 2 additions & 2 deletions doc/user_guide/psyke.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ PSyclone modifies the Schedule of the selected ``invoke_0``:
Schedule[invoke='invoke_0' dm=False]
0: Loop[type='dofs',field_space='any_space_1',it_space='dofs',
upper_bound='ndofs']
Literal[value:'NOT_INITIALISED']
Literal[value:'NOT_INITIALISED']
Reference[name:'loop0_start']
Reference[name:'loop0_stop']
Literal[value:'1']
Schedule[]
0: BuiltIn setval_c(f5,0.0)
Expand Down
8 changes: 4 additions & 4 deletions examples/lfric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ Kernel call 'matrix_vector_code' was found in
InvokeSchedule[invoke='invoke_0', dm=False]
...
Loop[type='', field_space='any_space_1', it_space='cells', upper_bound='ncells']
Literal[value:'NOT_INITIALISED']
Literal[value:'NOT_INITIALISED']
Reference[name:'loop0_start']
Reference[name:'loop0_stop']
Literal[value:'1']
Schedule[]
CodedKern matrix_vector_kernel_code(m_lumped,ones,mb) [module_inline=False]
Loop[type='dofs', field_space='any_space_1', it_space='dofs', upper_bound='ndofs']
Literal[value:'NOT_INITIALISED']
Literal[value:'NOT_INITIALISED']
Reference[name:'loop1_start']
Reference[name:'loop1_stop']
Literal[value:'1']
Schedule[]
BuiltIn x_divideby_y(self_mb_lumped_inv,ones,m_lumped)
Expand Down
4 changes: 0 additions & 4 deletions src/psyclone/alg_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,6 @@ def _adduse(location, name, only=None, funcnames=None):
tree. This will be added at the first valid location before the
current location.

This function should be part of the fparser2 replacement for
f2pygen (which uses fparser1) but is kept here until this is
developed, see issue #240.

:param location: the current location (node) in the parse tree to which \
to add a USE.
:type location: :py:class:`fparser.two.utils.Base`
Expand Down
2 changes: 0 additions & 2 deletions src/psyclone/core/component_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

'''This module provides a class to manage indices in variable accesses.'''

from __future__ import print_function, absolute_import


from psyclone.errors import InternalError

Expand Down
Loading
Loading