Skip to content

Commit

Permalink
#1010 Delete f2pygen classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Feb 3, 2025
1 parent 7040b7c commit 5996da2
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 3,137 deletions.
44 changes: 0 additions & 44 deletions doc/developer_guide/APIs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1179,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
61 changes: 0 additions & 61 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
4 changes: 1 addition & 3 deletions doc/developer_guide/psyir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -990,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
14 changes: 0 additions & 14 deletions src/psyclone/domain/common/psylayer/psyloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,20 +330,6 @@ def args_filter(self, arg_types=None, arg_accesses=None, unique=False):
all_args.extend(call_args)
return all_args

def gen_mark_halos_clean_dirty(self, parent):
'''
Generates the necessary code to mark halo regions as clean or dirty
following execution of this loop. This default implementation does
nothing.
TODO #1648 - this method should be removed when the corresponding
one in LFRicLoop is removed.
:param parent: the node in the f2pygen AST to which to add content.
:type parent: :py:class:`psyclone.f2pygen.BaseGen`
'''

def _halo_read_access(self, arg):
'''Determines whether the supplied argument has (or might have) its
halo data read within this loop. Returns True if it does, or if
Expand Down
Loading

0 comments on commit 5996da2

Please sign in to comment.