Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 1010_remaining_lfri…
Browse files Browse the repository at this point in the history
…c_lowering
  • Loading branch information
sergisiso committed Jan 12, 2025
2 parents 5dc9ec0 + b051810 commit e90cbcf
Show file tree
Hide file tree
Showing 1,758 changed files with 3,624 additions and 2,097 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2020-2024, Science and Technology Facilities Council.
# Copyright (c) 2020-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lfric_test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2023-2024, Science and Technology Facilities Council.
# Copyright (c) 2023-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ jobs:
check-links:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
name: Run linkspector
runs-on: ubuntu-latest
# TODO 2838: linkspector doesn't support ubuntu-latest at the moment.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Run linkspector
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2024, Science and Technology Facilities Council.
# Copyright (c) 2024-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nemo_v5_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2024, Science and Technology Facilities Council.
# Copyright (c) 2024-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2020-2024, Science and Technology Facilities Council.
# Copyright (c) 2020-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -36,6 +36,7 @@
# Modified by A. J. Voysey, Met Office
# Modified by J. Henrichs, Bureau of Meteorology
# Modified by N. Nobre, STFC Daresbury Lab
# Modified by A. B. G. Chalk, STFC Daresbury Lab

# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions.
Expand Down Expand Up @@ -103,7 +104,8 @@ jobs:
- run: cd doc/developer_guide; make html; make doctest
build:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
runs-on: ubuntu-latest
# TODO 2837: Switch to ubuntu-latest once Python 3.7 support is removed.
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.13]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2023, Science and Technology Facilities Council.
# Copyright (c) 2023-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ src/*.egg-info
.venv
cov.xml
.coverage.*
*.psycache
__pycache__
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2024, Science and Technology Facilities Council.
Copyright (c) 2017-2025, Science and Technology Facilities Council.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2017-2022, Science and Technology Facilities Council.
# Copyright (c) 2017-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion apt.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2019-2020, Science and Technology Facilities Council.
# Copyright (c) 2019-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion bin/psyad
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2021, Science and Technology Facilities Council
# Copyright (c) 2021-2025, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion bin/psyclone
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2017, Science and Technology Facilities Council
# Copyright (c) 2017-2025, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion bin/psyclone-kern
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2017-2022, Science and Technology Facilities Council
# Copyright (c) 2017-2025, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
16 changes: 16 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@
AST tree. There are two new FortranReader arguments to select the behaviour
for comments and directives (by default they are not parsed).

5) PR #2836 for #2835. Reverts GHA to use Ubuntu 22.04 as python-3.7
not available in ubuntu-latest and linkspector is also broken.

6) PR #2820 for #2773. Adds support for the Vernier timing library.

7) PR #2840 for #2839. Raise error in FortranReader if ignore_directives
is True but ignore_comments is True.

8) PR #2832 for #2831. Reorders the arguments to the parser to meet best
practices.

9) PR #2842 for #2841. Update all copyright date ranges for 2025.

10) PR #2810. Adds caching of the fparser2 parse tree to FileInfo. Is
disabled by default.

release 3.0.0 6th of December 2024

1) PR #2477 for #2463. Add support for Fortran Namelist statements.
Expand Down
2 changes: 1 addition & 1 deletion config/psyclone.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2017-2024, Science and Technology Facilities Council
# Copyright (c) 2017-2025, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/_ext/apilinks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2022-2024, Science and Technology Facilities Council.
# Copyright (c) 2022-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2023, Science and Technology Facilities Council.
# Copyright (c) 2023-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/APIs.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
.. BSD 3-Clause License
..
.. Copyright (c) 2019-2024, Science and Technology Facilities Council.
.. Copyright (c) 2019-2025, Science and Technology Facilities Council.
.. All rights reserved.
..
.. Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/code_snippets/newnode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2020-2024, Science and Technology Facilities Council
# Copyright (c) 2020-2025, Science and Technology Facilities Council
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

# General information about the project.
project = "PSyclone Developer Guide"
project_copyright = '2017-2024, STFC Daresbury Laboratory'
project_copyright = '2017-2025, STFC Daresbury Laboratory'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/dependency.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
BSD 3-Clause License
Copyright (c) 2021-2024, Science and Technology Facilities Council.
Copyright (c) 2021-2025, Science and Technology Facilities Council.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.. -----------------------------------------------------------------------------
BSD 3-Clause License
Copyright (c) 2017-2024, Science and Technology Facilities Council.
Copyright (c) 2017-2025, Science and Technology Facilities Council.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
66 changes: 65 additions & 1 deletion doc/developer_guide/module_manager.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
.. BSD 3-Clause License
..
.. Copyright (c) 2019-2024, Science and Technology Facilities Council.
.. Copyright (c) 2019-2025, Science and Technology Facilities Council.
.. All rights reserved.
..
.. Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -41,6 +41,8 @@

.. _module_manager:



Module Manager
##############

Expand Down Expand Up @@ -135,3 +137,65 @@ which prints the filenames of all modules used in ``tl_testkern_mod``:
Module: constants_mod constants_mod.f90
Module: fs_continuity_mod fs_continuity_mod.f90
Module: kernel_mod kernel_mod.f90



FileInfo
========

FileInfo is a class that is used to store information about Fortran files.

This information can include:

- The source code itself
- The fparser tree information
- The PSyIR tree information

All this information is gathered in this single class since this also
allows for caching of it, see next section



Caching
=======

The `ModuleManager` and `FileInfo` support a caching of the
fparser tree representation of a source code.
(Support for PSyIR is planned)

This caching has to be **explicitly enabled** in the constructor
of `ModuleManager`.


.. testcode ::
mod_manager = ModuleManager.get(use_caching=True)
Most of the time in the PSyIR generation is currently spent in the
fparser tree generation. Consequently, this leads to significant
speed-ups in the process of reading and parsing the source code
of modules.

The default cache file is named the same way as the source file,
but replaces the file extension with `.psycache`. E.g., a cache file
for the source file `foo.f90` will be called `foo.psycache`.

The caching algorithm to obtain the fparser tree OR PSyIR is briefly described as follows:

- If fparser tree / PSyIR was read before: RETURN fparser tree or PSyIR
- If source code is not yet read:

- Read the content of the file
- Create the source's checksum.
- Read cache file if it exists:

- If the checksum of the cache is the same as the one of the source:

- load the fparser tree / PSyIR from the cache file and RETURN fparser tree or PSyIR
- Create the fparser tree / PSyIR from the source code
- Save cache file IF it was not loaded before:

- Update cache information
- Store to cache file
- RETURN fparser tree or PSyIR
2 changes: 1 addition & 1 deletion doc/developer_guide/modules.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
.. BSD 3-Clause License
..
.. Copyright (c) 2019-2024, Science and Technology Facilities Council.
.. Copyright (c) 2019-2025, Science and Technology Facilities Council.
.. All rights reserved.
..
.. Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2018-2023, Science and Technology Facilities Council.
# Copyright (c) 2018-2025, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
10 changes: 5 additions & 5 deletions doc/developer_guide/psy_data.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
.. BSD 3-Clause License
..
.. Copyright (c) 2019-2024, Science and Technology Facilities Council.
.. Copyright (c) 2019-2025, Science and Technology Facilities Council.
.. All rights reserved.
..
.. Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -72,8 +72,8 @@ the same time as checking that read-only values are indeed not modified,
different module names and data types must be used.

PSyData divides its application into different classes. For example,
the class "profile" is used for all profiling tools (e.g. TAU, DrHook or the
NVIDIA profiling tools). This class name is used as a prefix for
the class "profile" is used for all profiling tools (e.g. TAU, Vernier,
DrHook, or the NVIDIA profiling tools). This class name is used as a prefix for
the module name, the ``PSyDataType`` and functions. So if a profiling application
is linked the above code will actually look like this::

Expand Down Expand Up @@ -101,7 +101,7 @@ The class prefixes supported at the moment are:
Class Prefix Description
======================= =======================================================
profile All libraries related to profiling tools like TAU,
DrHook, NVIDIA's profiling tools etc. See
DrHook, NVIDIA's profiling tools, Vernier etc. See
:ref:`user_guide:profiling` for details.
extract For libraries used for kernel data extraction. See
:ref:`user_guide:psyke` for details.
Expand Down Expand Up @@ -970,7 +970,7 @@ by storing pointers to the profiling data to be able to
print all results in a ProfileFinalise() subroutine.
Some of the wrapper libraries use the PSyData base class (e.g. dl_timer,
simple_timing, template), others do not (e.g. NVIDIA profiling, TAU,
DrHook wrapper).
Vernier, DrHook wrapper).

.. _psyke:

Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/psyir.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
.. BSD 3-Clause License
..
.. Copyright (c) 2019-2024, Science and Technology Facilities Council.
.. Copyright (c) 2019-2025, Science and Technology Facilities Council.
.. All rights reserved.
..
.. Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/developer_guide/psyir_backends.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -----------------------------------------------------------------------------
BSD 3-Clause License
Copyright (c) 2017-2024, Science and Technology Facilities Council.
Copyright (c) 2017-2025, Science and Technology Facilities Council.
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit e90cbcf

Please sign in to comment.