MetOffice / MetOffice/fab

Some potential PSyclone issues

Open
#570 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
9
Forks
9
Avg merge
12d 12h
Merged PRs (30d)
2

Description

The PSyclone step does the following code at the beginning:
```
file_lists = [list(file_walk(root, ignore_folders=[config.prebuild_folder])) for root in kernel_roots]
all_kernel_files: set[Path] = set(sum(file_lists, []))
kernel_files: list[Path] = suffix_filter(all_kernel_files, ['.f90'])
```
This searches in the folder, and does not take the artefact store into account. When using transmutation and creating new files (e.g. `xx_mod.f90` and `xx_transmuted.f90`), both files are found by the `file_walk`, resulting in duplicated kernels. While the artefact store will have replaced the `xx_mod.f90` file with the `xx_mod_transmuted.f90`.

Should this collection be done across files in the artefact store (`FORTRAN_COMPILER_FILES`) (and then checking for files under kernel_roots?

For now, in LFRic transmute I will overwrite the original files (which is I think what happens de-facto with the makefile: the files are renamed to `xx.xu90`, then transmuted to the (original) `xx.f90`.

This is not an urgent issue, because of this (and the next issue), I have to overwrite the files in the transmute step anyway.

Contributor guide

Open the contributing guide

Research direction

Start at the PSyclone step where file_walk collects files under kernel_roots, then inspect the FORTRAN_COMPILER_FILES artefact-store entries and how kernel_roots are checked. The change is complete when transmuted and original files do not produce duplicated kernels, including the LFRic transmute case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.