Skip to content

stfc/PSyclone

Repository files navigation

Build Status codecov

PSyclone is a source-to-source Fortran compiler designed to programmatically optimise, parallelise and instrument HPC applications via user-provided transformation scripts. By encapsulating the performance-portability aspects (e.g. whether to parallelise with OpenMP or OpenACC), these scripts enable a separation of concerns between the scientific implementation and the optimisation choices. This allows each aspect to be explored and developed largely independently. Additionally, PSyclone supports the development of kernel-based Fortran-embedded DSLs following the PSyKAl model developed in the GungHo project.

PSyclone is currently used to support the LFRic mixed finite-element PSyKAl DSL for the UK MetOffice's next generation modelling system and the GOcean finite-difference PSyKAl DSL for a prototype 2D ocean modelling system. It is also used to insert GPU offloading directives into existing directly-addressed MPI applications such as the NEMO ocean model.

For more detailed information see the psyclone.pdf in this directory or the PSyclone User Guide.

Installation

You can install the latest release of psyclone from PyPI by using:

$ pip install psyclone

or, if you want an isolated installation in a python virtual environment:

$ python -m venv <virtual_env_name>
$ source <virtual_env_name>/bin/activate
$ pip install psyclone

Alternatively, you can install the latest upstream version of psyclone by cloning this repository and using:

$ pip install .

For more information about the installation process see this section of the User Guide.

Try it on Binder

Some of the examples are available as Jupyter notebooks. These may be launched using Binder from the links below. (Note that the first time this is done, Binder has to construct a Container and install the necessary software. This can take several minutes. You can track its progress by clicking the 'show' link next to the 'Build logs' heading.)

  • Binder The PSyclone Tutorial. Note that we currently recommend following the more up-to-date README files under the tutorials/practicals directory.

  • Binder Uses PSyclone's NEMO API to process some simple Fortran code, display the resulting PSyIR and then re-generate Fortran.

  • Binder 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 demonstrates the generation of a DAG for the PSy layer of the previous example.

Structure

Path Description
bin/ Top-level driver scripts for PSyclone and the PSyclone kernel tool
changelog Information on changes between releases
doc/ Documentation source using Sphinx
examples/ Simple examples
psyclone.pdf Generated documentation
README.md This file
README.gource Information on how to generate a gource video from the repository
README.uml Information on how to create UML class diagrams from the source using pyreverse
src/psyclone The Python source code
src/psyclone/tests/ Unit and functional tests using pytest
tutorial/notebooks Tutorial using Jupyter notebooks
tutorial/practicals Hands-on exercises using a local installation of PSyclone