runhealth 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. runhealth-1.0.0/.github/workflows/docs.yml +41 -0
  2. runhealth-1.0.0/.github/workflows/release.yml +79 -0
  3. runhealth-1.0.0/.github/workflows/tests.yml +30 -0
  4. runhealth-1.0.0/.gitignore +23 -0
  5. runhealth-1.0.0/.markdownlint.yaml +3 -0
  6. runhealth-1.0.0/.pre-commit-config.yaml +14 -0
  7. runhealth-1.0.0/.python-version +1 -0
  8. runhealth-1.0.0/CHANGELOG.md +136 -0
  9. runhealth-1.0.0/LICENSE +28 -0
  10. runhealth-1.0.0/PKG-INFO +149 -0
  11. runhealth-1.0.0/README.md +118 -0
  12. runhealth-1.0.0/docs/Makefile +12 -0
  13. runhealth-1.0.0/docs/_static/custom.css +9 -0
  14. runhealth-1.0.0/docs/cli.md +63 -0
  15. runhealth-1.0.0/docs/conf.py +48 -0
  16. runhealth-1.0.0/docs/development.md +78 -0
  17. runhealth-1.0.0/docs/images/progress.svg +56 -0
  18. runhealth-1.0.0/docs/images/timeline.svg +74 -0
  19. runhealth-1.0.0/docs/images/timers.svg +65 -0
  20. runhealth-1.0.0/docs/images/warnings.svg +57 -0
  21. runhealth-1.0.0/docs/index.md +138 -0
  22. runhealth-1.0.0/docs/install.md +79 -0
  23. runhealth-1.0.0/docs/logging.md +62 -0
  24. runhealth-1.0.0/docs/profile-reference.md +494 -0
  25. runhealth-1.0.0/docs/profiles.md +72 -0
  26. runhealth-1.0.0/docs/report.md +316 -0
  27. runhealth-1.0.0/docs/sirocco.md +136 -0
  28. runhealth-1.0.0/docs/slurm.md +76 -0
  29. runhealth-1.0.0/docs/stability.md +32 -0
  30. runhealth-1.0.0/docs/troubleshooting.md +54 -0
  31. runhealth-1.0.0/docs/usage.md +363 -0
  32. runhealth-1.0.0/examples/demo.log +1268 -0
  33. runhealth-1.0.0/examples/demo_hang.log +117 -0
  34. runhealth-1.0.0/examples/make_demo.py +329 -0
  35. runhealth-1.0.0/examples/make_timeline.py +86 -0
  36. runhealth-1.0.0/examples/runhealth.sbatch +22 -0
  37. runhealth-1.0.0/pyproject.toml +62 -0
  38. runhealth-1.0.0/src/runhealth/__init__.py +3 -0
  39. runhealth-1.0.0/src/runhealth/__main__.py +3 -0
  40. runhealth-1.0.0/src/runhealth/accounting.py +144 -0
  41. runhealth-1.0.0/src/runhealth/cli.py +943 -0
  42. runhealth-1.0.0/src/runhealth/dashboard.py +911 -0
  43. runhealth-1.0.0/src/runhealth/diag.py +328 -0
  44. runhealth-1.0.0/src/runhealth/diff.py +85 -0
  45. runhealth-1.0.0/src/runhealth/extract.py +778 -0
  46. runhealth-1.0.0/src/runhealth/health.py +1962 -0
  47. runhealth-1.0.0/src/runhealth/highlight.py +86 -0
  48. runhealth-1.0.0/src/runhealth/logfile.py +241 -0
  49. runhealth-1.0.0/src/runhealth/plots.py +1299 -0
  50. runhealth-1.0.0/src/runhealth/profile.py +356 -0
  51. runhealth-1.0.0/src/runhealth/profiles/cray-mpich.yaml +67 -0
  52. runhealth-1.0.0/src/runhealth/profiles/icon.yaml +317 -0
  53. runhealth-1.0.0/src/runhealth/profiles/slurm.yaml +109 -0
  54. runhealth-1.0.0/src/runhealth/profiles/watchdog.yaml +60 -0
  55. runhealth-1.0.0/src/runhealth/progress.py +182 -0
  56. runhealth-1.0.0/src/runhealth/report.py +3209 -0
  57. runhealth-1.0.0/src/runhealth/search.py +69 -0
  58. runhealth-1.0.0/src/runhealth/simoutput.py +374 -0
  59. runhealth-1.0.0/src/runhealth/sirocco.py +333 -0
  60. runhealth-1.0.0/src/runhealth/style.py +259 -0
  61. runhealth-1.0.0/src/runhealth/summary.py +106 -0
  62. runhealth-1.0.0/src/runhealth/svg.py +543 -0
  63. runhealth-1.0.0/src/runhealth/tables.py +246 -0
  64. runhealth-1.0.0/tests/conftest.py +27 -0
  65. runhealth-1.0.0/tests/fixtures/empty.log +0 -0
  66. runhealth-1.0.0/tests/fixtures/icon_hang.log +45 -0
  67. runhealth-1.0.0/tests/fixtures/icon_no_timestamps.log +38 -0
  68. runhealth-1.0.0/tests/fixtures/icon_success.log +74 -0
  69. runhealth-1.0.0/tests/fixtures/icon_two_attempts.log +94 -0
  70. runhealth-1.0.0/tests/fixtures/not_a_log.log +5 -0
  71. runhealth-1.0.0/tests/fixtures/slurm_generic.log +11 -0
  72. runhealth-1.0.0/tests/fixtures/truncated.log +31 -0
  73. runhealth-1.0.0/tests/make_fixtures.py +339 -0
  74. runhealth-1.0.0/tests/test_accounting.py +142 -0
  75. runhealth-1.0.0/tests/test_cli.py +303 -0
  76. runhealth-1.0.0/tests/test_diag.py +139 -0
  77. runhealth-1.0.0/tests/test_diff.py +48 -0
  78. runhealth-1.0.0/tests/test_examples.py +54 -0
  79. runhealth-1.0.0/tests/test_extract.py +150 -0
  80. runhealth-1.0.0/tests/test_health.py +361 -0
  81. runhealth-1.0.0/tests/test_highlight.py +39 -0
  82. runhealth-1.0.0/tests/test_logfile.py +115 -0
  83. runhealth-1.0.0/tests/test_profile.py +130 -0
  84. runhealth-1.0.0/tests/test_progress.py +75 -0
  85. runhealth-1.0.0/tests/test_report.py +584 -0
  86. runhealth-1.0.0/tests/test_search.py +98 -0
  87. runhealth-1.0.0/tests/test_simoutput.py +436 -0
  88. runhealth-1.0.0/tests/test_sirocco.py +130 -0
  89. runhealth-1.0.0/tests/test_stability.py +187 -0
  90. runhealth-1.0.0/tests/test_style.py +55 -0
  91. runhealth-1.0.0/tests/test_summary.py +31 -0
  92. runhealth-1.0.0/tests/test_tables.py +100 -0
  93. runhealth-1.0.0/tests/test_watchdog.py +124 -0
  94. runhealth-1.0.0/uv.lock +1598 -0
@@ -0,0 +1,41 @@
1
+ name: docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: astral-sh/setup-uv@v5
24
+ with:
25
+ enable-cache: true
26
+ - name: Build the documentation
27
+ run: uv run --group docs sphinx-build -b html -W --keep-going docs docs/_build/html
28
+ - uses: actions/upload-pages-artifact@v3
29
+ with:
30
+ path: docs/_build/html
31
+
32
+ deploy:
33
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: github-pages
38
+ url: ${{ steps.deployment.outputs.page_url }}
39
+ steps:
40
+ - id: deployment
41
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,79 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths: [pyproject.toml]
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ tests:
13
+ uses: ./.github/workflows/tests.yml
14
+
15
+ tag-and-release:
16
+ needs: tests
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ released: ${{ steps.check.outputs.exists == 'false' }}
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - name: Read version from pyproject.toml
26
+ id: version
27
+ run: |
28
+ version=$(grep -m1 '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
29
+ echo "version=$version" >> "$GITHUB_OUTPUT"
30
+ echo "tag=v$version" >> "$GITHUB_OUTPUT"
31
+
32
+ - name: Check if tag already exists
33
+ id: check
34
+ run: |
35
+ if git rev-parse "${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
36
+ echo "exists=true" >> "$GITHUB_OUTPUT"
37
+ else
38
+ echo "exists=false" >> "$GITHUB_OUTPUT"
39
+ fi
40
+
41
+ - name: Take the release notes from CHANGELOG.md
42
+ if: steps.check.outputs.exists == 'false'
43
+ run: |
44
+ version="${{ steps.version.outputs.version }}"
45
+ heading=$(grep -m1 -F "## [$version] - " CHANGELOG.md || true)
46
+ if ! echo "$heading" | grep -Eq ' - [0-9]{4}-[0-9]{2}-[0-9]{2}$'; then
47
+ echo "::error file=CHANGELOG.md::No dated section '## [$version] - YYYY-MM-DD'"
48
+ exit 1
49
+ fi
50
+ awk -v h="$heading" '$0 == h {on=1; next} on && /^## \[/ {exit} on' CHANGELOG.md > notes.md
51
+
52
+ - name: Create tag and GitHub release
53
+ if: steps.check.outputs.exists == 'false'
54
+ env:
55
+ GH_TOKEN: ${{ github.token }}
56
+ run: |
57
+ git tag "${{ steps.version.outputs.tag }}"
58
+ git push origin "${{ steps.version.outputs.tag }}"
59
+ gh release create "${{ steps.version.outputs.tag }}" \
60
+ --title "${{ steps.version.outputs.tag }}" \
61
+ --notes-file notes.md
62
+
63
+ publish:
64
+ needs: tag-and-release
65
+ if: needs.tag-and-release.outputs.released == 'true'
66
+ runs-on: ubuntu-latest
67
+ environment:
68
+ name: pypi
69
+ url: https://pypi.org/project/runhealth/
70
+ permissions:
71
+ contents: read
72
+ id-token: write
73
+ steps:
74
+ - uses: actions/checkout@v4
75
+ - uses: astral-sh/setup-uv@v5
76
+ - name: Build the sdist and the wheel
77
+ run: uv build
78
+ - name: Publish to PyPI with trusted publishing
79
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,30 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+ workflow_call:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ pytest:
15
+ name: Python ${{ matrix.python }}${{ matrix.extra && format(' [{0}]', matrix.extra) || '' }}
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python: ["3.11", "3.12", "3.13"]
21
+ extra: ["", "output"]
22
+ env:
23
+ UV_PYTHON: ${{ matrix.python }}
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: astral-sh/setup-uv@v5
27
+ with:
28
+ enable-cache: true
29
+ - name: Run the tests
30
+ run: uv run --exact --no-default-groups --with pytest ${{ matrix.extra && format('--extra {0}', matrix.extra) || '' }} pytest -rs
@@ -0,0 +1,23 @@
1
+ # Ignore everything at the top level, then allow what belongs in the repository.
2
+ /*
3
+ !/.github/
4
+ !/.gitignore
5
+ !/.pre-commit-config.yaml
6
+ !/.python-version
7
+ !/.markdownlint.yaml
8
+ !/CHANGELOG.md
9
+ !/LICENSE
10
+ !/README.md
11
+ !/docs/
12
+ !/examples/
13
+ !/pyproject.toml
14
+ !/src/
15
+ !/tests/
16
+ !/uv.lock
17
+
18
+ __pycache__/
19
+ *.py[cod]
20
+ *.egg-info/
21
+
22
+ ##### Sphinx documentation #####
23
+ docs/_build/
@@ -0,0 +1,3 @@
1
+ # Keep a Changelog repeats "Added" or "Fixed" under every version.
2
+ MD024:
3
+ siblings_only: true
@@ -0,0 +1,14 @@
1
+ repos:
2
+ - repo: https://github.com/psf/black
3
+ rev: 24.3.0
4
+ hooks:
5
+ - id: black
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v4.6.0
8
+ hooks:
9
+ - id: check-added-large-files
10
+ - id: check-ast
11
+ - id: check-yaml
12
+ - id: end-of-file-fixer
13
+ - id: no-commit-to-branch
14
+ - id: trailing-whitespace
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,136 @@
1
+ # Changelog
2
+
3
+ All notable changes to `runhealth` are recorded in this file. The format
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the
5
+ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
6
+ from 1.0.0 on. The [stability promise](https://c2sm.github.io/runhealth/stability.html)
7
+ states which interfaces a minor or patch release keeps compatible.
8
+
9
+ ## [1.0.0] - 2026-11-30
10
+
11
+ The first stable release. The command line options, the profile format and
12
+ `summary.json` are now public interfaces that change only with a new major
13
+ version, or with a deprecation period.
14
+
15
+ ### Added
16
+
17
+ - The YAML profile format is versioned with an optional `schema_version` key
18
+ (currently 1) and validated on load: an unknown key, a value of the wrong
19
+ type or a regular expression that does not compile is reported with the file
20
+ name and the key, instead of being ignored, and `runhealth` exits with
21
+ code 2.
22
+ - A documented stability promise covering the command line, the profile format
23
+ and `summary.json`, but not the HTML layout or the figure styling.
24
+ - The package is published on [PyPI](https://pypi.org/project/runhealth/) and
25
+ can be installed with `uv tool install runhealth` or `pip install runhealth`.
26
+ - The test suite runs on Python 3.11 to 3.13, with and without the `output`
27
+ extra, on every pull request and before every release.
28
+ - The model output of a coupled run is checked per component. The `icon`
29
+ profile defines the atmosphere and an optional ocean component with
30
+ potential temperature, salinity and current speed. `--output-glob` and
31
+ `--grid` are repeatable, and `--output-glob` accepts `COMPONENT=PATTERN`.
32
+ - The report is laid out as a dashboard: a sidebar table of contents, stat
33
+ cards with a health summary, a grid of figures with SVG and PNG export, an
34
+ expanded view and log scale and smoothing toggles, and a customize panel
35
+ whose settings are kept per browser.
36
+ - This changelog; the release notes on GitHub are taken from it.
37
+
38
+ ### Changed
39
+
40
+ - `summary.json` nests the output diagnostics by component, and its
41
+ `schema_version` is 2. The check keys of the output diagnostics carry the
42
+ component name, such as `output_values_atm`.
43
+ - `--output-dir auto` resolves to the task directory of a Sirocco chunk and
44
+ searches one level of subdirectories for the output files.
45
+
46
+ ## [0.10.0] - 2026-10-29
47
+
48
+ ### Added
49
+
50
+ - `--fail-on` turns the worst run grade into the exit code.
51
+ - A machine-readable `summary.json` is written beside every report.
52
+ - `--job-id` restricts the analysis to the logs of selected SLURM jobs.
53
+ - Sirocco task logs are recognized; the runs of a workflow are grouped and its
54
+ restart chunks linked.
55
+ - `--output-dir` diagnoses the model output: extremes, non-finite values and
56
+ completeness.
57
+ - Documentation on running `runhealth` as a SLURM job after the model job and
58
+ as a Sirocco task.
59
+
60
+ ### Fixed
61
+
62
+ - Dropped flow-control messages of the network are graded as a warning, never
63
+ as a failure.
64
+
65
+ ## [0.9.0] - 2026-09-30
66
+
67
+ ### Added
68
+
69
+ - The time each coupled component waits for its partner is measured.
70
+
71
+ ## [0.8.0] to [0.8.1] - 2026-09-30
72
+
73
+ ### Added
74
+
75
+ - The table of contents remembers its folded headings, and one toggle folds or
76
+ unfolds all of them.
77
+
78
+ ## [0.7.0] to [0.7.4] - 2026-09-29 to 2026-09-30
79
+
80
+ ### Added
81
+
82
+ - Numerical stability checks on the values a model reports about itself, such
83
+ as wind maxima.
84
+ - Long progress series are binned instead of cut off.
85
+ - The table of contents lists the checks with their grades and icons, and its
86
+ top-level headings fold.
87
+ - A much slower I/O series is plotted on a secondary y axis.
88
+
89
+ ### Fixed
90
+
91
+ - I/O events written together are merged before the cadence is measured.
92
+
93
+ ## [0.5.0] to [0.6.0] - 2026-09-25
94
+
95
+ ### Added
96
+
97
+ - SLURM accounting, a diagnostics directory and a hang watchdog are read.
98
+ - Steady-state rate and SDPD; network timeouts are graded.
99
+ - Simulated model time on the progress axis.
100
+ - The executable and its build, compared with the previous run.
101
+ - The version number and links to the documentation in the report header.
102
+
103
+ ### Fixed
104
+
105
+ - Logs are parsed again when a profile changes.
106
+
107
+ ## [0.4.0] to [0.4.1] - 2026-09-21
108
+
109
+ ### Added
110
+
111
+ - Wall-time gaps between output files are monitored and plotted.
112
+ - The coupling cost of each component is reported.
113
+ - Full-text search over every run script, a run switcher, and a diff of a run
114
+ script against the previous run of the same kind.
115
+
116
+ ## [0.1.0] to [0.3.0] - 2026-09-04 to 2026-09-10
117
+
118
+ ### Added
119
+
120
+ - The first releases: profile-driven parsing of batch logs, an HTML report
121
+ with interactive SVG figures, reading logs from a remote host over `ssh` and
122
+ `rsync`, and the documentation site.
123
+
124
+ [1.0.0]: https://github.com/C2SM/runhealth/compare/v0.10.0...v1.0.0
125
+ [0.10.0]: https://github.com/C2SM/runhealth/compare/v0.9.0...v0.10.0
126
+ [0.9.0]: https://github.com/C2SM/runhealth/compare/v0.8.1...v0.9.0
127
+ [0.8.0]: https://github.com/C2SM/runhealth/compare/v0.7.4...v0.8.0
128
+ [0.8.1]: https://github.com/C2SM/runhealth/compare/v0.8.0...v0.8.1
129
+ [0.7.0]: https://github.com/C2SM/runhealth/compare/v0.6.0...v0.7.0
130
+ [0.7.4]: https://github.com/C2SM/runhealth/compare/v0.7.3...v0.7.4
131
+ [0.6.0]: https://github.com/C2SM/runhealth/compare/v0.5.2...v0.6.0
132
+ [0.5.0]: https://github.com/C2SM/runhealth/compare/v0.4.1...v0.5.0
133
+ [0.4.0]: https://github.com/C2SM/runhealth/compare/v0.3.0...v0.4.0
134
+ [0.4.1]: https://github.com/C2SM/runhealth/compare/v0.4.0...v0.4.1
135
+ [0.3.0]: https://github.com/C2SM/runhealth/compare/v0.2.0...v0.3.0
136
+ [0.1.0]: https://github.com/C2SM/runhealth/releases/tag/v0.1.0
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Michael Jähn, C2SM, ETH Zurich
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software
17
+ without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,149 @@
1
+ Metadata-Version: 2.5
2
+ Name: runhealth
3
+ Version: 1.0.0
4
+ Summary: System-health reports for HPC batch job logs
5
+ Project-URL: Documentation, https://c2sm.github.io/runhealth/
6
+ Project-URL: Source, https://github.com/C2SM/runhealth
7
+ Project-URL: Issues, https://github.com/C2SM/runhealth/issues
8
+ Author: Michael Jähn
9
+ License-Expression: BSD-3-Clause
10
+ License-File: LICENSE
11
+ Keywords: batch jobs,climate model,hpc,icon,logs,monitoring,slurm
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
22
+ Classifier: Topic :: System :: Monitoring
23
+ Requires-Python: >=3.11
24
+ Requires-Dist: pyyaml>=6.0
25
+ Provides-Extra: output
26
+ Requires-Dist: netcdf4>=1.6; extra == 'output'
27
+ Requires-Dist: xarray>=2024.1; extra == 'output'
28
+ Provides-Extra: pdf
29
+ Requires-Dist: weasyprint>=61; extra == 'pdf'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # runhealth
33
+
34
+ [![PyPI](https://img.shields.io/pypi/v/runhealth)](https://pypi.org/project/runhealth/)
35
+ [![Python](https://img.shields.io/pypi/pyversions/runhealth)](https://pypi.org/project/runhealth/)
36
+ [![Tests](https://github.com/C2SM/runhealth/actions/workflows/tests.yml/badge.svg)](https://github.com/C2SM/runhealth/actions/workflows/tests.yml)
37
+ [![Docs](https://github.com/C2SM/runhealth/actions/workflows/docs.yml/badge.svg)](https://c2sm.github.io/runhealth/)
38
+ [![License](https://img.shields.io/badge/license-BSD--3--Clause-blue)](https://github.com/C2SM/runhealth/blob/main/LICENSE)
39
+
40
+ **Analyze a directory of HPC batch job logs and obtain a report on the
41
+ outcome and the performance of each run.**
42
+
43
+ A batch log already records whether the job completed, whether and where it
44
+ hung, how fast it ran and whether it slowed down, how evenly the work was
45
+ distributed across ranks, and whether the underlying machine was healthy.
46
+ `runhealth` extracts that information and presents it as a report.
47
+
48
+ ```bash
49
+ runhealth /path/to/logs -o report/ --open
50
+ ```
51
+
52
+ It can be run on a local machine against logs that reside on a cluster. The
53
+ report is then written locally as well and can be opened in a browser without
54
+ an SSH tunnel:
55
+
56
+ ```bash
57
+ runhealth santis:/scratch/e1000/run -o report/ --open
58
+ ```
59
+
60
+ Any `host:/path` argument is accepted, provided that `ssh host` already works;
61
+ `runhealth` first copies the matching logs with `rsync`.
62
+
63
+ <p align="center">
64
+ <img src="https://raw.githubusercontent.com/C2SM/runhealth/main/docs/images/timeline.svg" alt="A run timeline: labeled phases from job setup, model init and coupling setup through the time loop to the timer report and cleanup, with a red silence bar above the coupling setup and evenly spaced output writes below the time loop" width="820">
65
+ </p>
66
+
67
+ <p align="center"><em>A run in one figure: where the wall clock went, phase by
68
+ phase, where the log went quiet, and when output was written. The run is
69
+ synthetic, with its setup phases stretched so that each one is visible.</em></p>
70
+
71
+ `runhealth` is **model-agnostic**. The core interprets batch logs in general:
72
+ timestamps, SLURM records, silence and error signatures. Everything specific to
73
+ a code is defined in a **YAML profile**, so support for an additional model
74
+ requires a few regular expressions rather than Python code. Profiles for ICON
75
+ and Cray MPICH are included.
76
+
77
+ ## Install
78
+
79
+ ```bash
80
+ uv tool install runhealth # or: pip install runhealth
81
+ ```
82
+
83
+ Add the `output` extra, `runhealth[output]`, to diagnose NetCDF model output
84
+ and the `pdf` extra to write PDF reports. See
85
+ [Install](https://c2sm.github.io/runhealth/install.html) for details.
86
+
87
+ ## Quick start
88
+
89
+ Two sample logs are included in the repository, so no cluster is required:
90
+
91
+ ```bash
92
+ git clone https://github.com/C2SM/runhealth.git
93
+ cd runhealth
94
+ uv sync
95
+ uv run runhealth examples/ --glob '*.log' -o /tmp/demo --open
96
+ ```
97
+
98
+ ```text
99
+ runhealth: scanning examples/
100
+ runhealth: 2 log(s) to read, 0.2 MB in total
101
+ runhealth: parsed 2 log(s) in 0.2s
102
+ runhealth: analyzed 2 run(s) in 0.1s
103
+ runhealth: drawing the overview
104
+ runhealth: writing the search index
105
+ runhealth: rendered 2 page(s) in 0.1s
106
+ WARN SUCCESS 26m 18s demo.log - 8 of 199 intervals took more than 3x the median
107
+ FAIL FAILED 1h 44m 10s demo_hang.log - CANCELLED AT 2026-03-17T22:48:18 DUE TO TIME LIMIT
108
+ runhealth: wrote /tmp/demo/index.html
109
+ ```
110
+
111
+ If the shell cannot pass a local file to a browser, for example in a plain SSH
112
+ session or in WSL with Windows interoperability disabled, use `--serve` instead
113
+ of `--open` and open <http://127.0.0.1:8000/>.
114
+
115
+ ## Documentation
116
+
117
+ The full documentation is published at **<https://c2sm.github.io/runhealth/>**:
118
+
119
+ - [Install](https://c2sm.github.io/runhealth/install.html)
120
+ - [Usage](https://c2sm.github.io/runhealth/usage.html): recipes, following a
121
+ running job, output formats, sharing a report, performance
122
+ - [Running as a SLURM job](https://c2sm.github.io/runhealth/slurm.html): check
123
+ every model job automatically once it has ended
124
+ - [Running in a Sirocco workflow](https://c2sm.github.io/runhealth/sirocco.html):
125
+ check every ICON task of a workflow, stop it after a failed run, and read
126
+ the report by workflow and restart chunk
127
+ - [Reading the report](https://c2sm.github.io/runhealth/report.html): what each
128
+ check means, how to read the figures
129
+ - [Profiles](https://c2sm.github.io/runhealth/profiles.html) and the
130
+ [profile reference](https://c2sm.github.io/runhealth/profile-reference.html):
131
+ adding support for a new code
132
+ - [Improving log quality](https://c2sm.github.io/runhealth/logging.html): two
133
+ inexpensive changes to a job script that make its output considerably more
134
+ informative
135
+ - [Troubleshooting](https://c2sm.github.io/runhealth/troubleshooting.html)
136
+ - [Command line reference](https://c2sm.github.io/runhealth/cli.html)
137
+ - [Development](https://c2sm.github.io/runhealth/development.html)
138
+
139
+ The sources are Markdown files under
140
+ [`docs/`](https://github.com/C2SM/runhealth/tree/main/docs) and can be built
141
+ locally with
142
+
143
+ ```bash
144
+ uv run --group docs sphinx-build -b html docs docs/_build/html
145
+ ```
146
+
147
+ ## License
148
+
149
+ BSD 3-Clause. See [LICENSE](https://github.com/C2SM/runhealth/blob/main/LICENSE).
@@ -0,0 +1,118 @@
1
+ # runhealth
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/runhealth)](https://pypi.org/project/runhealth/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/runhealth)](https://pypi.org/project/runhealth/)
5
+ [![Tests](https://github.com/C2SM/runhealth/actions/workflows/tests.yml/badge.svg)](https://github.com/C2SM/runhealth/actions/workflows/tests.yml)
6
+ [![Docs](https://github.com/C2SM/runhealth/actions/workflows/docs.yml/badge.svg)](https://c2sm.github.io/runhealth/)
7
+ [![License](https://img.shields.io/badge/license-BSD--3--Clause-blue)](https://github.com/C2SM/runhealth/blob/main/LICENSE)
8
+
9
+ **Analyze a directory of HPC batch job logs and obtain a report on the
10
+ outcome and the performance of each run.**
11
+
12
+ A batch log already records whether the job completed, whether and where it
13
+ hung, how fast it ran and whether it slowed down, how evenly the work was
14
+ distributed across ranks, and whether the underlying machine was healthy.
15
+ `runhealth` extracts that information and presents it as a report.
16
+
17
+ ```bash
18
+ runhealth /path/to/logs -o report/ --open
19
+ ```
20
+
21
+ It can be run on a local machine against logs that reside on a cluster. The
22
+ report is then written locally as well and can be opened in a browser without
23
+ an SSH tunnel:
24
+
25
+ ```bash
26
+ runhealth santis:/scratch/e1000/run -o report/ --open
27
+ ```
28
+
29
+ Any `host:/path` argument is accepted, provided that `ssh host` already works;
30
+ `runhealth` first copies the matching logs with `rsync`.
31
+
32
+ <p align="center">
33
+ <img src="https://raw.githubusercontent.com/C2SM/runhealth/main/docs/images/timeline.svg" alt="A run timeline: labeled phases from job setup, model init and coupling setup through the time loop to the timer report and cleanup, with a red silence bar above the coupling setup and evenly spaced output writes below the time loop" width="820">
34
+ </p>
35
+
36
+ <p align="center"><em>A run in one figure: where the wall clock went, phase by
37
+ phase, where the log went quiet, and when output was written. The run is
38
+ synthetic, with its setup phases stretched so that each one is visible.</em></p>
39
+
40
+ `runhealth` is **model-agnostic**. The core interprets batch logs in general:
41
+ timestamps, SLURM records, silence and error signatures. Everything specific to
42
+ a code is defined in a **YAML profile**, so support for an additional model
43
+ requires a few regular expressions rather than Python code. Profiles for ICON
44
+ and Cray MPICH are included.
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ uv tool install runhealth # or: pip install runhealth
50
+ ```
51
+
52
+ Add the `output` extra, `runhealth[output]`, to diagnose NetCDF model output
53
+ and the `pdf` extra to write PDF reports. See
54
+ [Install](https://c2sm.github.io/runhealth/install.html) for details.
55
+
56
+ ## Quick start
57
+
58
+ Two sample logs are included in the repository, so no cluster is required:
59
+
60
+ ```bash
61
+ git clone https://github.com/C2SM/runhealth.git
62
+ cd runhealth
63
+ uv sync
64
+ uv run runhealth examples/ --glob '*.log' -o /tmp/demo --open
65
+ ```
66
+
67
+ ```text
68
+ runhealth: scanning examples/
69
+ runhealth: 2 log(s) to read, 0.2 MB in total
70
+ runhealth: parsed 2 log(s) in 0.2s
71
+ runhealth: analyzed 2 run(s) in 0.1s
72
+ runhealth: drawing the overview
73
+ runhealth: writing the search index
74
+ runhealth: rendered 2 page(s) in 0.1s
75
+ WARN SUCCESS 26m 18s demo.log - 8 of 199 intervals took more than 3x the median
76
+ FAIL FAILED 1h 44m 10s demo_hang.log - CANCELLED AT 2026-03-17T22:48:18 DUE TO TIME LIMIT
77
+ runhealth: wrote /tmp/demo/index.html
78
+ ```
79
+
80
+ If the shell cannot pass a local file to a browser, for example in a plain SSH
81
+ session or in WSL with Windows interoperability disabled, use `--serve` instead
82
+ of `--open` and open <http://127.0.0.1:8000/>.
83
+
84
+ ## Documentation
85
+
86
+ The full documentation is published at **<https://c2sm.github.io/runhealth/>**:
87
+
88
+ - [Install](https://c2sm.github.io/runhealth/install.html)
89
+ - [Usage](https://c2sm.github.io/runhealth/usage.html): recipes, following a
90
+ running job, output formats, sharing a report, performance
91
+ - [Running as a SLURM job](https://c2sm.github.io/runhealth/slurm.html): check
92
+ every model job automatically once it has ended
93
+ - [Running in a Sirocco workflow](https://c2sm.github.io/runhealth/sirocco.html):
94
+ check every ICON task of a workflow, stop it after a failed run, and read
95
+ the report by workflow and restart chunk
96
+ - [Reading the report](https://c2sm.github.io/runhealth/report.html): what each
97
+ check means, how to read the figures
98
+ - [Profiles](https://c2sm.github.io/runhealth/profiles.html) and the
99
+ [profile reference](https://c2sm.github.io/runhealth/profile-reference.html):
100
+ adding support for a new code
101
+ - [Improving log quality](https://c2sm.github.io/runhealth/logging.html): two
102
+ inexpensive changes to a job script that make its output considerably more
103
+ informative
104
+ - [Troubleshooting](https://c2sm.github.io/runhealth/troubleshooting.html)
105
+ - [Command line reference](https://c2sm.github.io/runhealth/cli.html)
106
+ - [Development](https://c2sm.github.io/runhealth/development.html)
107
+
108
+ The sources are Markdown files under
109
+ [`docs/`](https://github.com/C2SM/runhealth/tree/main/docs) and can be built
110
+ locally with
111
+
112
+ ```bash
113
+ uv run --group docs sphinx-build -b html docs docs/_build/html
114
+ ```
115
+
116
+ ## License
117
+
118
+ BSD 3-Clause. See [LICENSE](https://github.com/C2SM/runhealth/blob/main/LICENSE).
@@ -0,0 +1,12 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ SPHINXBUILD ?= sphinx-build
3
+ SOURCEDIR = .
4
+ BUILDDIR = _build
5
+
6
+ help:
7
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)"
8
+
9
+ .PHONY: help Makefile
10
+
11
+ %: Makefile
12
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(O)
@@ -0,0 +1,9 @@
1
+ /* Keep the wide reference tables readable instead of letting them overflow. */
2
+ article table.docutils {
3
+ display: table;
4
+ width: 100%;
5
+ }
6
+ article table.docutils td,
7
+ article table.docutils th {
8
+ white-space: normal;
9
+ }