Skip to content

Xios log file config bug#549

Open
mo-marqh wants to merge 3 commits into
MetOffice:mainfrom
mo-marqh:xios_log_file_config_bug
Open

Xios log file config bug#549
mo-marqh wants to merge 3 commits into
MetOffice:mainfrom
mo-marqh:xios_log_file_config_bug

Conversation

@mo-marqh

@mo-marqh mo-marqh commented Jun 11, 2026

Copy link
Copy Markdown
Member

PR Summary

Sci/Tech Reviewer: Oakley Brunt (@oakleybrunt)
Code Reviewer:

A bug was introduced by #397 and testing did not cover the case where the bug is triggered.
this was missed at review (by me) and needs fixing

the XIOS logical parameter print_file needs to take a value which is a Fortran boolean, so:

  • true / .TRUE.

this PR includes the fix for the task dictionary translation into working syntax for the environment variable and enables this path for a set of large rank count jobs (C224 & C896) to ensure the code is included in testing

I also add log collation into the log_dir in the generate_runtime_application, needed for statistics analysis.

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_log_file_config_bug/run1

Suite Information

Item Value
Suite Name xios_log_file_config_bug/run1
Suite User mark.hedley
Workflow Start 2026-06-11T10:29:18
Groups Run developer', 'lfric_atm_nwp_gal9-C224_MG_ex1a_cce_production-32bit
Dependency Reference Main Like
casim MetOffice/casim@2026.03.2 True
jules MetOffice/jules@3647a42 True
lfric_apps mo-marqh/lfric_apps@xios_log_file_config_bug False
lfric_core MetOffice/lfric_core@4eab65b 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 - 1202

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

mpi_parts_xios = {{task_values["mpi_parts_xios"]}}
XIOS_INFO_LEVEL = {{task_values['xios_info_level']}}
XIOS_PRINT_FILE = {{task_values['xios_print_file']}}
XIOS_PRINT_FILE = {{".TRUE." if task_values['xios_print_file'] else ".FALSE."}}

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.

Since this is checking whether there is anything present for 'xios_print_file', I would also update the documentation to reflect this. Otherwise, it may lead to confusion when users try to set this to 'false' and it doesn't work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks Oakley Brunt (@oakleybrunt)
i agree, this would no longer be consistent

i've updated teh docs and defaults to use this as a Boolean and then this logic holds, i think

returned to you for re-consideration

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.

I think that this needs to be thought about more carefully. The truthy value of a dictionary key containing a string of length >0 is True.

I would suggest either updating the documentation to reflect the current logic (that any value for 'xios_print_file' will result in TRUE).

or

Updating the docs to instruct users to use a suitable format for their values (e.g. .true. and .false.) and undoing this change to generate runtime. Then the onus is on them to use correct syntax.

I would recommend the second option since the first is not consistent with the majority of task options. But, the choice is yours, both are fine with me.

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.

Hi Mark, while this has good intentions, I think it needs a slightly different approach.

{% if "xios_info_level" not in task_dict %}
{% do task_dict.update({"xios_info_level": 0}) %}
{% do task_dict.update({"xios_print_file": "false"}) %}
{% do task_dict.update({"xios_print_file": False}) %}

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.

I am now worried that this will not work for the same reason stated before. If there is text present in 'xios_print_file' then it will be set to .TRUE. and "False" will count as text.

Comment on lines +203 to +205
- Boolean
- False
- Controls whether XIOS creates ``xios_<client/server>_<rank>.out`` and ``xios_<client/server>_<rank>.err`` files. When set to "False", logging is directed to stdout and stderr. If ``xios_info_level`` is greater than 1, ``xios_print_file`` will be set to "True".

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.

These docs give the impression that you can set this task option to False but this is not true.

mpi_parts_xios = {{task_values["mpi_parts_xios"]}}
XIOS_INFO_LEVEL = {{task_values['xios_info_level']}}
XIOS_PRINT_FILE = {{task_values['xios_print_file']}}
XIOS_PRINT_FILE = {{".TRUE." if task_values['xios_print_file'] else ".FALSE."}}

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.

I think that this needs to be thought about more carefully. The truthy value of a dictionary key containing a string of length >0 is True.

I would suggest either updating the documentation to reflect the current logic (that any value for 'xios_print_file' will result in TRUE).

or

Updating the docs to instruct users to use a suitable format for their values (e.g. .true. and .false.) and undoing this change to generate runtime. Then the onus is on them to use correct syntax.

I would recommend the second option since the first is not consistent with the majority of task options. But, the choice is yours, both are fine with me.

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