Skip to content

Add controls for XIOS buffers#606

Open
Oakley Brunt (oakleybrunt) wants to merge 14 commits into
MetOffice:mainfrom
oakleybrunt:XIOS-buffers
Open

Add controls for XIOS buffers#606
Oakley Brunt (oakleybrunt) wants to merge 14 commits into
MetOffice:mainfrom
oakleybrunt:XIOS-buffers

Conversation

@oakleybrunt

@oakleybrunt Oakley Brunt (oakleybrunt) commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Sci/Tech Reviewer: mo-marqh
Code Reviewer: allynt

PR for issue #600 (XIOS buffer size hard coded)

This PR adds two controls for XIOS buffers into the task-definition dictionary:

  1. xios_min_buffer_size
    • The buffer size allocated to each XIOS client and server, given in bytes
    • The value is used to set the min_buffer_size setting within XML files
    • The default value is 10485760 (10Mb)
      • This was only set by XML files within lfric_atm currently
    • Tests in lfric_atm and lfric2lfric that use iodef_ral.xml have been updated to use 2097152 (2Mb)
  2. xios_buffer_size_factor
    • A multiplier for xios_min_buffer_size
    • Allows scaling of XIOS buffers without directly changing xios_min_buffer_size
    • Default value is 1.0

Validation of RAL settings

lfric_atm RAL

The value of xios_min_buffer_size should be set to 2097152, this can be seen working here:

lfric_atm_ral3_mixmol-seuk Cylc job file

    CHECKPOINT_STEM_FILE="$CYLC_WORKFLOW_SHARE_DIR/data/restart_lfric_atm_ral3_mixmol-seuk_MG_ex1a_cce_fast-debug-32bit_tstep"
    CANNED_PRESCRIPT="cp -r $SOURCE_DIRECTORY/example/* $CYLC_TASK_WORK_DIR"
    XIOS_SERVER_MODE="False"
    XIOS_SERVER_RANKS="0"
    XIOS_MIN_BUFFER_SIZE="2097152"

lfric2lfric RAL

lfric2lfric_ral_seuk Cylc job file

    CHECKPOINT_STEM_FILE="$CYLC_WORKFLOW_SHARE_DIR/data/restart_lfric2lfric_oasis_clim_gal9_C12-ral_seuk_C16_lam_1cpu_ex1a_cce_fast-debug-64bit_tstep"
    CANNED_PRESCRIPT="cp -r $SOURCE_DIRECTORY/example/* $CYLC_TASK_WORK_DIR"
    XIOS_SERVER_MODE="False"
    XIOS_SERVER_RANKS="0"
    XIOS_MIN_BUFFER_SIZE="2097152"

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 - xios-buffers/run3

Suite Information

Item Value
Suite Name xios-buffers/run3
Suite User oakley.brunt
Workflow Start 2026-07-10T12:28:27
Groups Run all
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@1ea67b4 True
lfric_apps oakleybrunt/LFRicApps@XIOS-buffers False
lfric_core MetOffice/lfric_core@99d8d2b True
moci MetOffice/moci@2026.03.2 True
SimSys_Scripts MetOffice/SimSys_Scripts@3e2998b True
socrates MetOffice/socrates@2026.03.2 True
socrates-spectral MetOffice/socrates-spectral@2026.03.2 True
ukca MetOffice/ukca@1cdb9c2 True

Task Information

✅ succeeded tasks - 1594

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

@mo-marqh mo-marqh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a range of detail observations to explore about how to manage default values and configurations.

Additionally, how should the requirements that this change would introduce need to be documented and communicated to suite owners?
Is the documentation in the developer guide sufficient, or should there be configuration documentation for suite owners? release notes?

i think that the Environment Variables are now required by this change, is this all handled for suite owners by the cylc configurations?
Is action expected for suites to update their task_dicts? add Env Vars?

Comment thread documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst Outdated
Comment thread documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst Outdated
Comment thread documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst Outdated
Comment thread rose-stem/templates/default_task_definitions.cylc Outdated
Comment thread rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc Outdated
Comment thread rose-stem/app/adjoint_tests/file/iodef.xml
Comment thread rose-stem/app/lfric_atm/file/iodef_gal_nwp_hres.xml Outdated
Comment thread rose-stem/app/lfric_atm/file/iodef_gal_nwp_oper_hres.xml Outdated
Comment thread rose-stem/app/lfric_atm/file/iodef_ral.xml Outdated
Comment thread rose-stem/app/lfric_atm/file/iodef_ral.xml Outdated
@oakleybrunt

Copy link
Copy Markdown
Contributor Author

Additionally, how should the requirements that this change would introduce need to be documented and communicated to suite owners? Is the documentation in the developer guide sufficient, or should there be configuration documentation for suite owners? release notes?

i think that the Environment Variables are now required by this change, is this all handled for suite owners by the cylc configurations? Is action expected for suites to update their task_dicts? add Env Vars?

I think this is a broader question that has been ongoing for a while - how to keep suites updated with the changes to rose-stem.

In this case, including this change in the release notes is a good idea.

I think that most suites do not use the XML files from rose-stem and instead keep a copy within their suites.


{% endif %}

{# RAL configuration XIOS buffer defaults #}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think that perhaps this is on longer required, given the changes you've just made Oakley Brunt (@oakleybrunt) , and risks configuration confusion if left

@mo-marqh mo-marqh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there is a default being that will override task_dict settings, that i think needs removing

{# RAL default = 2Mb #}
{% do task_dict.update({
"xios_min_buffer_size": 2097152,
}) %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is still outstanding, and now superseded by the explicit task-dict settings, which is clearer, i think

@oakleybrunt

Copy link
Copy Markdown
Contributor Author

Oops, thanks Mark - that was left by mistake.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants