Skip to content

Read weights on pe0 - #675

Open
Steve Mullerworth (stevemullerworth) wants to merge 3 commits into
MetOffice:mainfrom
stevemullerworth:read_weights_on_pe0
Open

Read weights on pe0#675
Steve Mullerworth (stevemullerworth) wants to merge 3 commits into
MetOffice:mainfrom
stevemullerworth:read_weights_on_pe0

Conversation

@stevemullerworth

@stevemullerworth Steve Mullerworth (stevemullerworth) commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

Sci/Tech Reviewer: Mike Hobson (@mike-hobson)
Code Reviewer: Lottie Turner (@mo-lottieturner)

When run in parallel, all ranks of lfric2um and um2lfric read the regridding weights. However, regridding is only done on rank 0. The main purpose of this change is to read the weights only on rank 0. Doing so saves significant memory which is important when regridding at high resolution: the memory use of a C896-N1280 lfric2um run is reduced by 150GB when running on 108 ranks with 32 IO servers.

Unfortunately, to enable this to be done, some significant reordering of the application set-up needed to be done as MPI is not set up by the LFRic component till after the weights are read in. The reordering of the setup forms the bulk of the code changes in this branch.

The branch breaks the set-up into two. In the first part sets up MPI, but also the LFRic logger and XIOS. Setting up the LFRic logger early gives the benefit that a lot of log messages from the applications now go to the PET output whereas previously they ended up in stdout because they were sent before the logger had been initialised.

While lfric2um is the main target of this PR, parallel changes are made to um2lfric and the sciintelapi to maintain consistency between the applications.

closes #590
closes #642

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • I have tested this change locally, using the LFRic Apps rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (e.g. kgo changes)
  • I have added tests to cover new functionality as appropriate (e.g. system tests, unit tests, etc.)
  • Any new tests have been assigned an appropriate amount of compute resource and have been allocated to an appropriate testing group (i.e. the developer tests are for jobs which use a small amount of compute resource and complete in a matter of minutes)

trac.log

Test Suite Results - lfric_apps - read_weights_on_pe0/run1

Suite Information

Item Value
Suite Name read_weights_on_pe0/run1
Suite User steve.mullerworth
Workflow Start 2026-07-29T11:00:24
Groups Run developer
Dependency Reference Main Like
casim MetOffice/casim@2026.07.1 True
jules MetOffice/jules@2026.07.1 True
lfric_apps stevemullerworth/lfric_apps@read_weights_on_pe0 False
lfric_core MetOffice/lfric_core@2026.07.1 True
moci MetOffice/moci@2026.07.1 True
SimSys_Scripts MetOffice/SimSys_Scripts@2026.07.1 True
socrates MetOffice/socrates@2026.07.1 True
socrates-spectral MetOffice/socrates-spectral@2026.07.1 True
ukca MetOffice/ukca@2026.07.1 True

Task Information

✅ succeeded tasks - 1208

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

PSyclone Approval

  • If you have edited any PSyclone-related code (e.g. PSyKAl-lite, Kernel interface, optimisation scripts, LFRic data structure code) then please contact the TCD Team

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@github-actions github-actions Bot added the cla-modified The CLA has been modified as part of this PR - added by GA label Jul 29, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Hello Steve Mullerworth (@stevemullerworth)!

Your CLA signature was found on the base branch, but you appear to have modified the CONTRIBUTORS.md file in this PR.

Please do not edit the CONTRIBUTORS.md file. If you have already signed the CLA, revert changes to the file and your signature will be picked up.

@mike-hobson Mike Hobson (mike-hobson) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, This is exactly how I would have approached the issue. So. on to a code review with Lottie Turner (@mo-lottieturner).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-modified The CLA has been modified as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lfric2um and um2lfric (?) read weights files on all ranks but should only do so on rank 0 lfric2um needs to initialise logger earlier

3 participants