fab.steps.psyclone_transmute#

A preprocessor and code generation step using PSyclone’s transmute (Fortran to Fortran) ability. stfc/PSyclone

Functions

psyclone_transmute(config, fortran_files[, ...])

PSyclone runner step.

transmute_one_file(arg)

Transmutes a single file.

Classes

MpCommonArgs(config, suffix, ...)

Runtime data for child processes to read.

class fab.steps.psyclone_transmute.MpCommonArgs(config, suffix, transformation_script, cli_args, overrides_folder, override_files)#

Runtime data for child processes to read.

Contains data used to calculate the prebuild hash.

fab.steps.psyclone_transmute.psyclone_transmute(config, fortran_files, transformation_script=None, cli_args=None, suffix=None, overrides_folder=None, artefact_set=None)#

PSyclone runner step.

Note

This step reads pre-processed Fortran files and produces replacement Fortran files. So it must be run before the Analyse step.

This step stores results as prebuilds to speed up subsequent builds. To generate the prebuild hashes, it analyses the files, storing prebuilt results for these also.

Parameters:
  • config (BuildConfig) – The fab.build_config.BuildConfig object where we can read settings such as the project workspace folder or the multiprocessing flag.

  • fortran_files (Sequence[Path]) – list of files to transform.

  • transformation_script (Callable[[Path, BuildConfig], Path] | None) – The function to get Python transformation script. It takes in a file path and the config object, and returns the path of the transformation script or None. If no function is given or the function returns None, no script will be applied and PSyclone still runs. (default: None)

  • cli_args (list[str] | None) – Passed through to the psyclone cli tool. (default: None)

  • overrides_folder (Path | None) – Optional folder containing hand-crafted override files. Must be part of the subsequently analysed source code. Any file produced by psyclone will be deleted if there is a corresponding file in this folder. (default: None)

  • suffix (str | None) – a suffix to be added to create the new filename. (default: None)

  • artefact_set (ArtefactSet | None) – an optional artefact set. If specified, the input files names will be replaced with the newly transmuted ones. (default: None)

fab.steps.psyclone_transmute.transmute_one_file(arg)#

Transmutes a single file. This function is called in parallel from psyclone_transmute.

Parameters:

arg (tuple[Path, MpCommonArgs]) – all required data, stored in MpCommonArgs

Return type:

tuple[Path, Path] | tuple[Exception, None]