Skip to content
Draft
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
186f761
Add changes from #534 to extend (and fix mphys)
MetBenjaminWent Jul 9, 2026
ea6db84
As we now have a local override for kernels, we need to move the over…
MetBenjaminWent Jul 9, 2026
caaf7e5
In the new version of psyclone, theres a big move away from the optio…
MetBenjaminWent Jul 9, 2026
7cce77c
Better align global and local - global remains over the outmost loop …
MetBenjaminWent Jul 9, 2026
b1e7570
Add 2x new kernels, fix existing script re options list, maintaining …
MetBenjaminWent Jul 9, 2026
94e1cc6
Add aerosol_ukca_kernel_mod, format the rest so that the file doesn't…
MetBenjaminWent Jul 9, 2026
a5a9252
Update both socretes kernels to use the explicit parameters, over opt…
MetBenjaminWent Jul 10, 2026
ef5ffd9
lift bm_tau_kernel_mod into local script and remove
MetBenjaminWent Jul 10, 2026
0cf3f92
Remove jules_extra_kernel_mod, lift into local
MetBenjaminWent Jul 10, 2026
26bc24a
Roll pc2_initiation_kernel_mod into local script
MetBenjaminWent Jul 10, 2026
3b47583
Pull sw_rad_tile_kernel_mod into local
MetBenjaminWent Jul 10, 2026
fd382cb
Expand local.py with some additional safety regarding nesting OMP sec…
MetBenjaminWent Jul 10, 2026
2ac84ce
lift jules_imp_kernel_mod to local, format lw and sw kernels slightly
MetBenjaminWent Jul 10, 2026
c53e657
Pull in changes from #582
MetBenjaminWent Jul 10, 2026
aa785a8
Formatting updates and pipe in ignore_dependencies_for in conv_gr_ker…
MetBenjaminWent Jul 10, 2026
e03e468
Add lw_rad_tile_kernel_mod local script
MetBenjaminWent Jul 13, 2026
1d392cd
Add bm_kernel_mod to local
MetBenjaminWent Jul 13, 2026
8935afc
add conv_comorph_kernel_mod to local
MetBenjaminWent Jul 13, 2026
39fe9d7
Add the smith_kernel_mod to the local script
MetBenjaminWent Jul 13, 2026
149166b
Add spectral_gwd_kernel_mod to local
MetBenjaminWent Jul 13, 2026
853c186
Update comment
MetBenjaminWent Jul 13, 2026
5b6735f
Add photol_kernel_mod to use local
MetBenjaminWent Jul 13, 2026
5f1fbf7
Update comment
MetBenjaminWent Jul 13, 2026
3474627
update options comment
MetBenjaminWent Jul 13, 2026
5baef3c
Further comment update
MetBenjaminWent Jul 13, 2026
b7e64fe
Add tracer_mix_kernel_mod to use local script
MetBenjaminWent Jul 13, 2026
81bf273
Add new kernels, delete duplicates, and fix ordering
MetBenjaminWent Jul 13, 2026
ddc1017
Merge branch 'main' into add_omp_more_kernels
MetBenjaminWent Jul 13, 2026
5cf2506
Formatting
MetBenjaminWent Jul 13, 2026
2d5c9e2
Merge branch 'add_omp_more_kernels' of github.com:MetBenjaminWent/lfr…
MetBenjaminWent Jul 13, 2026
ddbdac8
Correct file extension, and turn off 2x scripts as issues CCE build t…
MetBenjaminWent Jul 13, 2026
c54607b
Add comment with issue of fix and avoid future attempts to Transmute …
MetBenjaminWent Jul 13, 2026
a993ce8
Formatting fix, in line with #582
MetBenjaminWent Jul 14, 2026
56c37cc
Align Transmute file lists
MetBenjaminWent Jul 14, 2026
40af575
Add CO feedback to scripts
MetBenjaminWent Jul 14, 2026
3c90db5
Align with example from PSyclone repo
MetBenjaminWent Jul 14, 2026
e4a2056
Remove old sim links which no longer point
MetBenjaminWent Jul 14, 2026
5fd3c0b
Add a new link to the top of the kernel directory for ease
MetBenjaminWent Jul 14, 2026
61c09a5
Remote returns for CO
MetBenjaminWent Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions applications/lfric_atm/build/psyclone_transmute_file_list.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

export PSYCLONE_PHYSICS_FILES = \
bl_lsp \
bm_kernel_mod \
bm_tau_kernel_mod \
bl_exp_kernel_mod \
bl_imp_kernel_mod \
bl_imp2_kernel_mod \
btq_int \
conv_gr_kernel_mod \
ex_flux_tq \
Expand All @@ -30,21 +34,30 @@ export PSYCLONE_PHYSICS_FILES = \
kmkh \
kmkhz_9c_wtrac \
lw_kernel_mod \
lw_rad_tile_kernel_mod \
lsp_prognostic_tnuc_kernel_mod \
mphys_kernel_mod \
mphys_turb_gen_kernel_mod \
pc2_bl_forced_cu \
pc2_bm_initiate \
pc2_initiation_ctl \
pc2_initiation_kernel_mod \
pc2_conv_coupling_kernel_mod \
photol_kernel_mod \
smith_kernel_mod \
spectral_gwd_kernel_mod \
sw_kernel_mod \
sw_rad_tile_kernel_mod \
tracer_mix_kernel_mod \
ukca_aero_ctl \
ukca_abdulrazzak_ghan \
ukca_chemistry_ctl_full_mod \
ukca_main1-ukca_main1 \
sw_rad_tile_kernel_mod \
jules_imp_kernel_mod \
jules_exp_kernel_mod \
jules_extra_kernel_mod
ukca_main1-ukca_main1

# Causing build slow downs CCE conv_comorph_kernel_mod \
aerosol_ukca_kernel_mod \
# The Psyclone Issue to fix this is #3418


##### TRANSMUTE_INCLUDE_METHOD specify_include #####

Expand Down
46 changes: 24 additions & 22 deletions applications/lfric_atm/optimisation/meto-ex1a/transmute/global.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
##############################################################################
# Copyright (c) 2025, Met Office, on behalf of HMSO and Queen's Printer
# For further details please refer to the file LICENCE.original which you
# should have received as part of this distribution.
##############################################################################
# -----------------------------------------------------------------------------
# (C) 2026 Crown copyright Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
# -----------------------------------------------------------------------------
'''
A global script to add OpenMP to loops present in the file provided.
This script imports a SCRIPT_OPTIONS_DICT which can be used to override
small aspects of this script per file it is applied to.
Overrides currently include:
* Options list for transformations
* safe pure calls for loops over calls which can be parallelised
* ignore_dependencies_for
* node_type_check
'''

import logging
from psyclone.transformations import (
TransformationError)
from psyclone.psyir.nodes import Loop
from transmute_psytrans.transmute_functions import (
OMP_PARALLEL_LOOP_DO_TRANS_STATIC,
set_pure_subroutines,
OMP_PARALLEL_LOOP_DO_TRANS_STATIC
)
from script_options import (
SCRIPT_OPTIONS_DICT
Expand All @@ -30,34 +29,37 @@ def trans(psyir):
PSyclone function call, run through psyir object,
each schedule (or subroutine) and apply paralleldo transformations
to each loop.
:param psyir: the PSyIR of the provided file.
:type psyir: :py:class:`psyclone.psyir.nodes.FileContainer`
:returns:
'''

# options list for transformation.
options = {}
fortran_file_name = str(psyir.root.name)

# Designate calls in regions as safe to parallelise over.
safe_pure_calls = []
node_type_check = True
ignore_dependencies_for = []

fortran_file_name = str(psyir.root.name)
# Check if file is in the script_options_dict
# Copy out anything that's needed
# options list and a pure calls override
if fortran_file_name in SCRIPT_OPTIONS_DICT:
file_overrides = SCRIPT_OPTIONS_DICT[fortran_file_name]
if "options" in file_overrides.keys():
options = file_overrides["options"]
if "safe_pure_calls" in file_overrides.keys():
safe_pure_calls = file_overrides["safe_pure_calls"]

# Set the pure calls if needed
if safe_pure_calls:
set_pure_subroutines(psyir, safe_pure_calls)
if "ignore_dependencies_for" in file_overrides.keys():
ignore_dependencies_for = file_overrides[
"ignore_dependencies_for"]
if "node_type_check" in file_overrides.keys():
node_type_check = file_overrides[
"node_type_check"]

# Work through each loop in the file and OMP PARALLEL DO
for loop in psyir.walk(Loop):
if not loop.ancestor(Loop):
try:
OMP_PARALLEL_LOOP_DO_TRANS_STATIC.apply(loop, options)
OMP_PARALLEL_LOOP_DO_TRANS_STATIC.apply(
loop,
ignore_dependencies_for=ignore_dependencies_for,
node_type_check=node_type_check)

except (TransformationError, IndexError) as err:
logging.warning(
Expand Down

This file was deleted.

Loading
Loading