From d83e2db5248b3e39d17a54dc0a5c67ed7e7287c7 Mon Sep 17 00:00:00 2001 From: mo-marqh <87382490+mo-marqh@users.noreply.github.com> Date: Tue, 9 Jun 2026 17:37:38 +0000 Subject: [PATCH 1/5] fix xios_logging bug --- rose-stem/templates/runtime/generate_runtime_application.cylc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rose-stem/templates/runtime/generate_runtime_application.cylc b/rose-stem/templates/runtime/generate_runtime_application.cylc index 087aa6917..d77e6c383 100644 --- a/rose-stem/templates/runtime/generate_runtime_application.cylc +++ b/rose-stem/templates/runtime/generate_runtime_application.cylc @@ -138,7 +138,7 @@ xios_nodes = {{task_values["xios_nodes"]}} 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."}} PAT_EXE_EXTEN = {{PAT_EXE_EXTEN}} CORES_PER_NODE_OVERRIDE = {{task_values["task_ranks_per_node"]}} RANKS_DEPTH_PAD = {{task_values["task_ranks_depth_pad"]}} From 8cd84433e21ed3e11e7a5733c42bdf99d7a33d05 Mon Sep 17 00:00:00 2001 From: mo-marqh <87382490+mo-marqh@users.noreply.github.com> Date: Thu, 11 Jun 2026 10:26:12 +0000 Subject: [PATCH 2/5] ensure that a selection of larger jobs correctly write out xios log files and collate them on success into log_dir --- rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc | 10 ++++++++++ .../runtime/generate_runtime_application.cylc | 2 ++ 2 files changed, 12 insertions(+) diff --git a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc index 3f1e63be5..fb16327ae 100644 --- a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc +++ b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc @@ -215,6 +215,8 @@ "xios_nodes": 1, "mpi_parts_xios" : 64, "log_level": "info", + "xios_info_level": 1, + "xios_print_file": true, "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", "memory_plot_ex": true, }) %} @@ -230,6 +232,8 @@ "xios_nodes": 1, "mpi_parts_xios" : 64, "log_level": "info", + "xios_info_level": 1, + "xios_print_file": true, "memory_plot_ex": true, }) %} @@ -244,6 +248,8 @@ "xios_nodes": 1, "mpi_parts_xios" : 64, "log_level": "error", + "xios_info_level": 1, + "xios_print_file": true, "xios_info_level": 50, }) %} @@ -258,6 +264,8 @@ "wallclock": 10, "xios_nodes": 4, "mpi_parts_xios" : 16, + "xios_info_level": 1, + "xios_print_file": true, }) %} {% elif task_ns.conf_name == "nwp_gal9_coarse_aero-C48_MG" %} @@ -470,6 +478,8 @@ "log_level": "info", "log_to_rank_zero_only": ".true.", "memory_plot_ex": true, + "xios_info_level": 1, + "xios_print_file": true, "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", }) %} diff --git a/rose-stem/templates/runtime/generate_runtime_application.cylc b/rose-stem/templates/runtime/generate_runtime_application.cylc index d77e6c383..422f4506c 100644 --- a/rose-stem/templates/runtime/generate_runtime_application.cylc +++ b/rose-stem/templates/runtime/generate_runtime_application.cylc @@ -73,6 +73,8 @@ 'find . -regex ".*PET0+\..+\.Log" -exec cp {} $TASK_OUTPUT_DIR \;', 'ls -sh $TASK_OUTPUT_DIR/results > $ROSE_TASK_LOG_DIR/results_file_sizes.log', 'find . -name timer.txt -exec cp {} $ROSE_TASK_LOG_DIR \;', + 'find . -name "xios_client_*.out" -exec cat {} + > $ROSE_TASK_LOG_DIR/xios_client_collated.out ', + 'find . -name "xios_server_*.out" -exec cat {} + > $ROSE_TASK_LOG_DIR/xios_server_collated.out ', 'test -f '~task_values["app_name"]~ '-checksums.txt && cp $CYLC_TASK_WORK_DIR/'~ task_values["app_name"]~'-checksums.txt $TASK_OUTPUT_DIR/checksum.txt', From 30dea71c1754ad11535a6bd1f74efe7f706ad7ca Mon Sep 17 00:00:00 2001 From: mo-marqh <87382490+mo-marqh@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:24:53 +0000 Subject: [PATCH 3/5] update docs and defaults for consistent Boolean typing --- .../lfric_apps_rose_stem/adding_new_test.rst | 8 ++++---- rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc | 2 -- rose-stem/templates/default_task_definitions.cylc | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst b/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst index 2eba8d2d4..173cb10a7 100644 --- a/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst +++ b/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst @@ -200,9 +200,9 @@ The table below shows a list of possible entries for ``task_dict`` in the task d - 0 - Controls the level of information that XIOS logs. Used to set the ``info_level`` within xml files. When ``xios_info_level`` is greater than 1, logging is directed to ``xios__.out`` and ``xios__.err``, otherwise it is output to stdout and stderr (see ``xios_print_file`` for more details). * - xios_print_file - - Str - - "false" - - Controls whether XIOS creates ``xios__.out`` and ``xios__.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". + - Boolean + - False + - Controls whether XIOS creates ``xios__.out`` and ``xios__.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". * - example_dir - Str - "example" @@ -283,4 +283,4 @@ Exceptions * Perftools can be run over certain applications in lfric_apps, see the compiler section above, and :ref:`perftools_rose-stem` -.. _EXlink: https://www-hpc/ex-user-guide/advice/placement/?h=l1+cache#nodes-diagram \ No newline at end of file +.. _EXlink: https://www-hpc/ex-user-guide/advice/placement/?h=l1+cache#nodes-diagram diff --git a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc index fb16327ae..5dea2a95e 100644 --- a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc +++ b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc @@ -248,8 +248,6 @@ "xios_nodes": 1, "mpi_parts_xios" : 64, "log_level": "error", - "xios_info_level": 1, - "xios_print_file": true, "xios_info_level": 50, }) %} diff --git a/rose-stem/templates/default_task_definitions.cylc b/rose-stem/templates/default_task_definitions.cylc index b83094d3c..b02543d63 100644 --- a/rose-stem/templates/default_task_definitions.cylc +++ b/rose-stem/templates/default_task_definitions.cylc @@ -193,11 +193,11 @@ {% 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}) %} {% endif %} {% if "xios_info_level" in task_dict and task_dict["xios_info_level"] > 1 %} - {% do task_dict.update({"xios_print_file": "true"}) %} + {% do task_dict.update({"xios_print_file": True}) %} {% endif %} {# If application is lfric_coupled read in default values specific to coupled runs #} From 42d269695194d89525cb8d4aaeb12db89e792190 Mon Sep 17 00:00:00 2001 From: mo-marqh <87382490+mo-marqh@users.noreply.github.com> Date: Tue, 16 Jun 2026 09:07:29 +0000 Subject: [PATCH 4/5] reimplementation reverting to string task_dict item but adding cylc validation --- .../lfric_apps_rose_stem/adding_new_test.rst | 6 +++--- rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc | 8 ++++---- rose-stem/templates/default_task_definitions.cylc | 11 +++++++++-- .../runtime/generate_runtime_application.cylc | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst b/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst index 173cb10a7..87fa70b5f 100644 --- a/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst +++ b/documentation/source/developer_guide/lfric_apps_rose_stem/adding_new_test.rst @@ -200,9 +200,9 @@ The table below shows a list of possible entries for ``task_dict`` in the task d - 0 - Controls the level of information that XIOS logs. Used to set the ``info_level`` within xml files. When ``xios_info_level`` is greater than 1, logging is directed to ``xios__.out`` and ``xios__.err``, otherwise it is output to stdout and stderr (see ``xios_print_file`` for more details). * - xios_print_file - - Boolean - - False - - Controls whether XIOS creates ``xios__.out`` and ``xios__.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". + - Str + - ".false." + - Controls whether XIOS creates ``xios__.out`` and ``xios__.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.", overriding any task_dict setting. This string must be a Fortran logical. * - example_dir - Str - "example" diff --git a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc index 5dea2a95e..b28de5e47 100644 --- a/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc +++ b/rose-stem/site/common/lfric_atm/tasks_lfric_atm.cylc @@ -216,7 +216,7 @@ "mpi_parts_xios" : 64, "log_level": "info", "xios_info_level": 1, - "xios_print_file": true, + "xios_print_file": ".true.", "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", "memory_plot_ex": true, }) %} @@ -233,7 +233,7 @@ "mpi_parts_xios" : 64, "log_level": "info", "xios_info_level": 1, - "xios_print_file": true, + "xios_print_file": ".true.", "memory_plot_ex": true, }) %} @@ -263,7 +263,7 @@ "xios_nodes": 4, "mpi_parts_xios" : 16, "xios_info_level": 1, - "xios_print_file": true, + "xios_print_file": ".true.", }) %} {% elif task_ns.conf_name == "nwp_gal9_coarse_aero-C48_MG" %} @@ -477,7 +477,7 @@ "log_to_rank_zero_only": ".true.", "memory_plot_ex": true, "xios_info_level": 1, - "xios_print_file": true, + "xios_print_file": ".true.", "plot_str": "plot_map.py $NODAL_DATA_DIR/lfric_diagnostics.nc $PLOT_DIR", }) %} diff --git a/rose-stem/templates/default_task_definitions.cylc b/rose-stem/templates/default_task_definitions.cylc index b02543d63..2cf5a3783 100644 --- a/rose-stem/templates/default_task_definitions.cylc +++ b/rose-stem/templates/default_task_definitions.cylc @@ -193,13 +193,20 @@ {% 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."}) %} {% endif %} {% if "xios_info_level" in task_dict and task_dict["xios_info_level"] > 1 %} - {% do task_dict.update({"xios_print_file": True}) %} + {% do task_dict.update({"xios_print_file": ".true."}) %} {% endif %} +{# Validate whether the input to "xios_print_file" can be parsed by XIOS from XML #} +{% if task_dict.get("xios_print_file", "") not in [".true.", ".TRUE.", ".false.", ".FALSE."] %} + {% set error_msg_fragment = task_dict.get("xios_print_file", "") | string %} + {{ raise('"xios_print_file" must be a Fortran logical (".true." / ".false.") not: "' + error_msg_fragment + '"') }} +{% endif %} + + {# If application is lfric_coupled read in default values specific to coupled runs #} {% if task_ns.application == "lfric_coupled" %} {% include "templates/default_task_definitions_lfric_coupled.cylc" %} diff --git a/rose-stem/templates/runtime/generate_runtime_application.cylc b/rose-stem/templates/runtime/generate_runtime_application.cylc index 422f4506c..c3746dbad 100644 --- a/rose-stem/templates/runtime/generate_runtime_application.cylc +++ b/rose-stem/templates/runtime/generate_runtime_application.cylc @@ -74,7 +74,9 @@ 'ls -sh $TASK_OUTPUT_DIR/results > $ROSE_TASK_LOG_DIR/results_file_sizes.log', 'find . -name timer.txt -exec cp {} $ROSE_TASK_LOG_DIR \;', 'find . -name "xios_client_*.out" -exec cat {} + > $ROSE_TASK_LOG_DIR/xios_client_collated.out ', + 'if [ ! -s $ROSE_TASK_LOG_DIR/xios_client_collated.out ]; then rm -f $ROSE_TASK_LOG_DIR/xios_client_collated.out ; fi', 'find . -name "xios_server_*.out" -exec cat {} + > $ROSE_TASK_LOG_DIR/xios_server_collated.out ', + 'if [ ! -s $ROSE_TASK_LOG_DIR/xios_server_collated.out ]; then rm -f $ROSE_TASK_LOG_DIR/xios_server_collated.out ; fi', 'test -f '~task_values["app_name"]~ '-checksums.txt && cp $CYLC_TASK_WORK_DIR/'~ task_values["app_name"]~'-checksums.txt $TASK_OUTPUT_DIR/checksum.txt', @@ -140,7 +142,7 @@ xios_nodes = {{task_values["xios_nodes"]}} mpi_parts_xios = {{task_values["mpi_parts_xios"]}} XIOS_INFO_LEVEL = {{task_values['xios_info_level']}} - XIOS_PRINT_FILE = {{".TRUE." if task_values['xios_print_file'] else ".FALSE."}} + XIOS_PRINT_FILE = {{task_values['xios_print_file']}} PAT_EXE_EXTEN = {{PAT_EXE_EXTEN}} CORES_PER_NODE_OVERRIDE = {{task_values["task_ranks_per_node"]}} RANKS_DEPTH_PAD = {{task_values["task_ranks_depth_pad"]}} From a393a5f93388123dd827aaec51b39ee0805131fc Mon Sep 17 00:00:00 2001 From: mo-marqh <87382490+mo-marqh@users.noreply.github.com> Date: Tue, 16 Jun 2026 09:19:44 +0000 Subject: [PATCH 5/5] comment for log file management --- rose-stem/templates/runtime/generate_runtime_application.cylc | 1 + 1 file changed, 1 insertion(+) diff --git a/rose-stem/templates/runtime/generate_runtime_application.cylc b/rose-stem/templates/runtime/generate_runtime_application.cylc index c3746dbad..c101fed93 100644 --- a/rose-stem/templates/runtime/generate_runtime_application.cylc +++ b/rose-stem/templates/runtime/generate_runtime_application.cylc @@ -72,6 +72,7 @@ 'find . -regex ".*PET0+\..+\.Log" -exec cp {} $ROSE_TASK_LOG_DIR \;', 'find . -regex ".*PET0+\..+\.Log" -exec cp {} $TASK_OUTPUT_DIR \;', 'ls -sh $TASK_OUTPUT_DIR/results > $ROSE_TASK_LOG_DIR/results_file_sizes.log', + '# Ensure that timing log information is performantly collated and located into the persistent task_log_dir.', 'find . -name timer.txt -exec cp {} $ROSE_TASK_LOG_DIR \;', 'find . -name "xios_client_*.out" -exec cat {} + > $ROSE_TASK_LOG_DIR/xios_client_collated.out ', 'if [ ! -s $ROSE_TASK_LOG_DIR/xios_client_collated.out ]; then rm -f $ROSE_TASK_LOG_DIR/xios_client_collated.out ; fi',