fab.steps.psyclone module

A preprocessor and code generation step for PSyclone. https://github.com/stfc/PSyclone

fab.steps.psyclone.tool_available()

Check if the psyclone tool is available at the command line.

Return type:

bool

fab.steps.psyclone.preprocess_x90(config, common_flags=None)
class fab.steps.psyclone.MpCommonArgs(config, analysed_x90, kernel_roots, transformation_script, cli_args, all_kernel_hashes, overrides_folder, override_files, transformation_script_hash=0)

Bases: object

Runtime data for child processes to read.

Contains data used to calculate the prebuild hash.

config: BuildConfig
analysed_x90: Dict[Path, AnalysedX90]
kernel_roots: List[Path]
transformation_script: Path
cli_args: List[str]
all_kernel_hashes: Dict[str, int]
overrides_folder: Optional[Path]
override_files: List[str]
transformation_script_hash: int = 0
fab.steps.psyclone.psyclone(config, kernel_roots=None, transformation_script=None, cli_args=None, source_getter=None, overrides_folder=None)

Psyclone runner step.

Note

This step produces Fortran, so it must be run before the Analyse step.

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

Kernel files are just normal Fortran, and the standard Fortran analyser is used to analyse them

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

  • kernel_roots (Optional[List[Path]]) – (default: None) Folders containing kernel files. Must be part of the analysed source code.

  • transformation_script (Optional[Path]) – (default: None) The Python transformation script.

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

  • source_getter (Optional[ArtefactsGetter]) – (default: None) Optional override for getting input files from the artefact store.

  • overrides_folder (Optional[Path]) – (default: 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.

fab.steps.psyclone.do_one_file(arg)
fab.steps.psyclone.run_psyclone(generated, modified_alg, x90_file, kernel_roots, transformation_script, cli_args)
fab.steps.psyclone.make_parsable_x90(x90_path)

Take out the leading name keyword in calls to invoke(), making temporary, parsable fortran from x90s.

If present it looks like this:

call invoke( name = "compute_dry_mass", ...

Returns the path of the parsable file.

This function is not slow so we’re not creating prebuilds for this work.

Return type:

Path