runops 2.1.3__tar.gz → 2.2.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.
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/sync-docs/SKILL.md +3 -2
- {runops-2.1.3 → runops-2.2.0}/PKG-INFO +3 -1
- {runops-2.1.3 → runops-2.2.0}/README.md +2 -0
- {runops-2.1.3 → runops-2.2.0}/SPEC.md +53 -7
- runops-2.2.0/docs/guide.md +271 -0
- {runops-2.1.3 → runops-2.2.0}/docs/reference.md +23 -9
- {runops-2.1.3 → runops-2.2.0}/pyproject.toml +1 -1
- {runops-2.1.3 → runops-2.2.0}/src/runops/__init__.py +1 -1
- {runops-2.1.3 → runops-2.2.0}/src/runops/case.py +18 -2
- {runops-2.1.3 → runops-2.2.0}/src/runops/cli.py +59 -3
- {runops-2.1.3 → runops-2.2.0}/src/runops/harness.py +4 -2
- {runops-2.1.3 → runops-2.2.0}/src/runops/jobgen.py +27 -5
- {runops-2.1.3 → runops-2.2.0}/src/runops/manifest.py +20 -1
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/common.py +18 -1
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/create.py +45 -14
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/notes.py +2 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/skills.py +14 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/submit.py +43 -23
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/sync.py +42 -1
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/tidy.py +87 -4
- {runops-2.1.3 → runops-2.2.0}/src/runops/project.py +59 -8
- {runops-2.1.3 → runops-2.2.0}/src/runops/runtime.py +46 -12
- {runops-2.1.3 → runops-2.2.0}/src/runops/skills/runops-check-status/SKILL.md +2 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/skills/runops-create-run/SKILL.md +20 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/skills/runops-maintain/SKILL.md +1 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/skills/runops-reference/SKILL.md +4 -3
- {runops-2.1.3 → runops-2.2.0}/src/runops/slurm.py +19 -10
- {runops-2.1.3 → runops-2.2.0}/src/runops/util.py +19 -0
- {runops-2.1.3 → runops-2.2.0}/tests/conftest.py +3 -1
- {runops-2.1.3 → runops-2.2.0}/tests/golden/mpi_standard.sh +15 -1
- {runops-2.1.3 → runops-2.2.0}/tests/golden/openmp_rsc.sh +15 -1
- {runops-2.1.3 → runops-2.2.0}/tests/test_build.py +58 -1
- {runops-2.1.3 → runops-2.2.0}/tests/test_jobgen.py +51 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_lifecycle.py +11 -0
- runops-2.2.0/tests/test_mv_naming.py +122 -0
- runops-2.2.0/tests/test_safety.py +143 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_sync_evidence.py +31 -1
- {runops-2.1.3 → runops-2.2.0}/uv.lock +1 -1
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/check/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/improve-harness/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/agents/openai.yaml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/examples/refactor-request.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/references/anti-patterns.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/references/api-compatibility.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/references/packaging-modernization.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/references/refactor-playbook.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/references/verification.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/scripts/api_surface_snapshot.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/scripts/import_smoke.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/scripts/inspect_python_package.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/python-package-refactor/scripts/refactor_quality_gate.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/release/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/simulator-adapter/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.agents/skills/spec-reviewer/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/agents/spec-reviewer.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/rules/architecture.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/rules/dev-workflow.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/rules/gotchas.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/settings.json +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/check/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/improve-harness/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/python-package-refactor/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/release/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/simulator-adapter/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/spec-reviewer/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.claude/skills/sync-docs/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.codex/README.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/.codex/agents/spec-reviewer.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.codex/config.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.codex/rules/runops.rules +0 -0
- {runops-2.1.3 → runops-2.2.0}/.dockerignore +0 -0
- {runops-2.1.3 → runops-2.2.0}/.gitattributes +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/assets/conversation-dark.svg +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/assets/conversation-light.svg +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/assets/hero-dark.svg +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/assets/hero-light.svg +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/assets/make_readme_art.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/workflows/ci.yml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.github/workflows/publish.yml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.gitignore +0 -0
- {runops-2.1.3 → runops-2.2.0}/.harness/manifest.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.pre-commit-config.yaml +0 -0
- {runops-2.1.3 → runops-2.2.0}/.vscode/settings.json +0 -0
- {runops-2.1.3 → runops-2.2.0}/AGENTS.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/CLAUDE.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/LICENSE +0 -0
- {runops-2.1.3 → runops-2.2.0}/docs/adapter.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/adapters/__init__.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/adapters/base.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/adapters/generic.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/adapters/registry.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/config.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/errors.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/launchers.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/legacy_adapters/__init__.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/legacy_adapters/beach.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/legacy_adapters/emses.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/__init__.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/listing.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/migrate.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/ops/setup.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/src/runops/skills/runops-tidy/SKILL.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/__init__.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/.codex/rules/a.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/.runops/test-runs/T20260701-0001/receipt.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/.runops/work/beach-x-abc/bin/beach +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/AGENTS.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/CLAUDE.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/cases/beach/plane/beach.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/cases/beach/plane/case.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/cases/old/beach.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/cases/old/case.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/launchers.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/research/CURRENT.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runops.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/AGENTS.md +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/_archive/plane/R20260601-0001/manifest.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/plane/R20260701-0001--a/input/beach.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/plane/R20260701-0001--a/manifest.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/plane/R20260702-0001/manifest.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/scan/R20260701-0002/manifest.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/runs/scan/survey.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/simulators.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/fixtures/v1-project/site.toml +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_adapters.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_dev_harness.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_legacy_adapters.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_manifest_config.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_migrate.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_scratch_tidy.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_setup_misc.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_skills.py +0 -0
- {runops-2.1.3 → runops-2.2.0}/tests/test_sweep.py +0 -0
|
@@ -13,14 +13,15 @@ runops の挙動は複数の場所に書かれている。変更の種類から
|
|
|
13
13
|
| `runops.toml` / `case.toml` の field | `SPEC.md` §4, §5 | `docs/reference.md`、`config.py` / `case.py` の既知 key 集合 |
|
|
14
14
|
| manifest の field | `SPEC.md` §6.2 | `docs/reference.md` の manifest 表、`ops/migrate.py` の変換 |
|
|
15
15
|
| adapter 契約・skill 同梱 | `SPEC.md` §8 | `docs/adapter.md`、`adapters/base.py` の docstring、`legacy_adapters/` |
|
|
16
|
-
| エージェントの使い方・規則 | `src/runops/harness.py`(project の AGENTS.md block) | `src/runops/skills/*/SKILL.md`、README
|
|
16
|
+
| エージェントの使い方・規則 | `src/runops/harness.py`(project の AGENTS.md block) | `src/runops/skills/*/SKILL.md`、README の依頼例、`docs/guide.md` |
|
|
17
17
|
| 実装中の判断で SPEC 本文と違う結論になった | `SPEC.md` 本文を直し、§14 に理由を 1 行追加 | — |
|
|
18
18
|
|
|
19
19
|
## 規則
|
|
20
20
|
|
|
21
21
|
- README は利用者向けで、人が覚えるコマンドは `runo init` だけという前提で書く。それ以外は
|
|
22
22
|
エージェントへの依頼例として書く。
|
|
23
|
-
- `docs/` は `reference.md
|
|
23
|
+
- `docs/` は `guide.md`(使い方)、`reference.md`(一覧)、`adapter.md`(package 作者向け)の 3 本だけ。
|
|
24
|
+
ページを増やす前に既存ページの節で収める。command や挙動を変えたら `guide.md` の頼み方と裏のコマンドも確認する。
|
|
24
25
|
- project に展開する skill は各 60 行以内、AGENTS.md block は 120 行以内(テストあり)。
|
|
25
26
|
- 経緯は書かない(commit message と SPEC §14 に残す)。現在の挙動だけを書く。
|
|
26
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: runops
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Run ledger and Slurm job submission for HPC simulation projects
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nkzono99/runops
|
|
6
6
|
Project-URL: Documentation, https://github.com/Nkzono99/runops/blob/main/docs/reference.md
|
|
@@ -79,6 +79,7 @@ runo init
|
|
|
79
79
|
| v1 から移る | この project を runops v2 に移行して(`runo migrate-v1` を dry-run で確認してから) |
|
|
80
80
|
|
|
81
81
|
投入、削除、整理、移行の前には、エージェントが対象と資源量を示して確認を取ります。
|
|
82
|
+
場面ごとの流れは [使い方ガイド](https://github.com/Nkzono99/runops/blob/main/docs/guide.md) にあります。
|
|
82
83
|
|
|
83
84
|
## project の中身
|
|
84
85
|
|
|
@@ -116,6 +117,7 @@ run は ID が変わらないので、directory を移動してもエージェ
|
|
|
116
117
|
|
|
117
118
|
---
|
|
118
119
|
|
|
120
|
+
[使い方ガイド](https://github.com/Nkzono99/runops/blob/main/docs/guide.md) ·
|
|
119
121
|
[リファレンス](https://github.com/Nkzono99/runops/blob/main/docs/reference.md) ·
|
|
120
122
|
[adapter ガイド](https://github.com/Nkzono99/runops/blob/main/docs/adapter.md) ·
|
|
121
123
|
[SPEC](https://github.com/Nkzono99/runops/blob/main/SPEC.md) ·
|
|
@@ -48,6 +48,7 @@ runo init
|
|
|
48
48
|
| v1 から移る | この project を runops v2 に移行して(`runo migrate-v1` を dry-run で確認してから) |
|
|
49
49
|
|
|
50
50
|
投入、削除、整理、移行の前には、エージェントが対象と資源量を示して確認を取ります。
|
|
51
|
+
場面ごとの流れは [使い方ガイド](https://github.com/Nkzono99/runops/blob/main/docs/guide.md) にあります。
|
|
51
52
|
|
|
52
53
|
## project の中身
|
|
53
54
|
|
|
@@ -85,6 +86,7 @@ run は ID が変わらないので、directory を移動してもエージェ
|
|
|
85
86
|
|
|
86
87
|
---
|
|
87
88
|
|
|
89
|
+
[使い方ガイド](https://github.com/Nkzono99/runops/blob/main/docs/guide.md) ·
|
|
88
90
|
[リファレンス](https://github.com/Nkzono99/runops/blob/main/docs/reference.md) ·
|
|
89
91
|
[adapter ガイド](https://github.com/Nkzono99/runops/blob/main/docs/adapter.md) ·
|
|
90
92
|
[SPEC](https://github.com/Nkzono99/runops/blob/main/SPEC.md) ·
|
|
@@ -134,6 +134,8 @@ v1 で運用した 2 つの project(`project_dust_release`: BEACH、run 120、
|
|
|
134
134
|
skills.lock # 展開した skill の由来と version(§8.2)
|
|
135
135
|
index.toml # run id -> path cache(§7.2)
|
|
136
136
|
id.lock # run id 採番用 lock
|
|
137
|
+
run.lock # manifest の読み直し・更新用 lock(submit / cancel / retry / sync)
|
|
138
|
+
last_run_id # 最後に払い出した run id。削除後も同じ id を再利用しないため
|
|
137
139
|
v1-backup/<stamp>/ # migrate-v1 が退避した v1 の設定と harness(§11)
|
|
138
140
|
build/
|
|
139
141
|
<sim>-<commit>/ # local_source の build cache(§4.1)
|
|
@@ -146,6 +148,11 @@ v1 で運用した 2 つの project(`project_dust_release`: BEACH、run 120、
|
|
|
146
148
|
見つける(§7.2)。
|
|
147
149
|
- 既定の配置先は `runs/<case_name>/`。`--dest` で上書きできる。`_` で始まる
|
|
148
150
|
directory(`_scratch`、`_archive`)は runops が予約する。
|
|
151
|
+
- run directory の中(自身と子孫)には run を置けない。`--dest` が既存 run の中なら拒否し、
|
|
152
|
+
`delete` は中に別の run があれば拒否する(§7.2 の走査は manifest のある directory で止まる)。
|
|
153
|
+
- run id は `R<YYYYMMDD>-<NNNN>`。その日の既存 run と `.runops/last_run_id` の大きい方に 1 を足す。
|
|
154
|
+
run を削除しても番号は再利用しない(ログやノートに残った id が別の run を指さないように)。
|
|
155
|
+
`last_run_id` を失っても既存 run からの採番に戻るだけで、動作は壊れない。
|
|
149
156
|
- run は同じ親 directory の `.<name>.staging` で組み立ててから rename で公開する。
|
|
150
157
|
rename は `renameat2(RENAME_NOREPLACE)` を使い、filesystem が対応しない場合
|
|
151
158
|
(KUDPC の Lustre は EINVAL を返す)は project lock 下で存在確認してから `rename` する。
|
|
@@ -227,7 +234,10 @@ label_max_length = 48 # run 名の自動ラベルの最大文字数
|
|
|
227
234
|
|
|
228
235
|
- `local_source` の build は `runo new` / `runo submit` 時に executable が無ければ自動で行う。
|
|
229
236
|
`runo build SIM [--force]` で明示的にも行える(command 数に含める)。
|
|
230
|
-
-
|
|
237
|
+
- build dir 名は `<sim>-<short_commit>[-dirty]-<digest>`。digest は `build_command` と、dirty なら
|
|
238
|
+
build にコピーする全ファイル(追跡済みと未追跡、ignore 以外)の内容の hash。未追跡ファイルの
|
|
239
|
+
内容や `build_command` を変えると別の build になる。コピー後に source が変わっていたら build を中止する。
|
|
240
|
+
dirty なら manifest に `git_dirty = true` を記録する。
|
|
231
241
|
- build cache は `tidy` が `unused-build` として挙げる(どの非 archived run の manifest からも
|
|
232
242
|
参照されない build dir)。
|
|
233
243
|
|
|
@@ -292,7 +302,7 @@ ntasks = 800
|
|
|
292
302
|
submit/
|
|
293
303
|
job.sh
|
|
294
304
|
sbatch.log # 投入時の stdout/stderr(追記)
|
|
295
|
-
exit.<job_id> # job.sh が終了時に書く exit code
|
|
305
|
+
exit.<job_id> # job.sh が終了時に書く exit code、開始・終了時刻、stage(TOML)
|
|
296
306
|
work/ # simulator の出力。cwd はここ
|
|
297
307
|
analysis/
|
|
298
308
|
summary.json # runo summarize の出力
|
|
@@ -325,6 +335,7 @@ archived_at = ""
|
|
|
325
335
|
case = "flat_surface"
|
|
326
336
|
sweep = "" # sweep label。単発 run は空
|
|
327
337
|
parent_run = "" # --from RUN で派生した場合の source
|
|
338
|
+
case_input_hash = "sha256:..." # 作成時の case の base 入力ファイルの hash
|
|
328
339
|
created_by = "agent" # "human" | "agent" | 任意文字列
|
|
329
340
|
|
|
330
341
|
[simulator]
|
|
@@ -366,6 +377,7 @@ finished_at = ""
|
|
|
366
377
|
slurm_state = "COMPLETED"
|
|
367
378
|
exit_code = 0 # exit record から
|
|
368
379
|
exe_hash = "sha256:..." # submit 時点の executable の hash
|
|
380
|
+
elapsed = "15:42:10" # sacct の Elapsed、無ければ exit record の開始・終了から
|
|
369
381
|
|
|
370
382
|
[params]
|
|
371
383
|
"tmgrid.nx" = 4000
|
|
@@ -418,12 +430,21 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
418
430
|
- `sync` は対象 run の job id をまとめて 1 回の `squeue --jobs=...` で問い合わせ、そこに無い
|
|
419
431
|
job だけを 1 回の `sacct --jobs=...` で引く。`tidy` の `orphan-job` 判定も同じ。
|
|
420
432
|
scheduler への問い合わせ回数は run 数に依存しない。
|
|
433
|
+
runops が対応づけていない Slurm 状態の job は状態を変えずに `last_slurm_state` だけ残し、
|
|
434
|
+
他の run の更新は続ける。
|
|
421
435
|
- job.sh は program 終了時に `submit/exit.<job_id>`(`exit_code`、`started_at`、`finished_at`、
|
|
422
|
-
`hostname
|
|
436
|
+
`hostname`、`stage = "run"`)を書く。program より前の準備(`module load`、`export`、`cd`、venv、
|
|
437
|
+
`setup_commands`、`pre_commands`、adapter の `job_prelude`)は `set -e` で実行し、失敗したら
|
|
438
|
+
program を起動せずに終了して、その exit code と `stage = "setup"` を記録する。
|
|
439
|
+
`post_commands` の失敗は記録する exit code を変えない。squeue にも sacct にも無い job は、この file があれば
|
|
423
440
|
`exit_code = 0` のとき adapter の判定(既定 completed)、それ以外は `failed` にする。
|
|
424
441
|
file が無ければ adapter の判定に従い、`unknown` なら `failed`。
|
|
425
442
|
- `submit` は manifest に記録された executable を hash し直し、attempt に `exe_hash` を残す。
|
|
426
443
|
作成時の `[simulator].exe_hash` と違えば warning を出す(拒否しない)。
|
|
444
|
+
- `new --from RUN` は case の base 入力ファイルが source の作成時(`[origin].case_input_hash`)から
|
|
445
|
+
変わっていれば warning を出す(拒否しない)。
|
|
446
|
+
- `submit`、`cancel`、`retry`、`sync` は `.runops/run.lock` の中で manifest を読み直してから
|
|
447
|
+
状態を確認・更新する。同じ run を 2 回指定しても、複数の process から同時に投入しても sbatch は 1 回。
|
|
427
448
|
- `new` / `sweep --apply` は `identity.input_hash` が既存 run と一致するとき warning を出す
|
|
428
449
|
(同じ executable なら「結果は同一のはず」、違えば「executable が違う」)。作成は拒否しない。
|
|
429
450
|
- `purged` state は廃止。`work/` の削除は `[storage].work_purged_at` で表す。
|
|
@@ -443,6 +464,8 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
443
464
|
- 一覧系 command は `--json` を持ち、agent が機械可読に読める。`new` と `sweep --apply` の
|
|
444
465
|
`--json` は作成した run の同じ summary を返す。summary には `params`、`changed_keys`、
|
|
445
466
|
`parent_run`、`exe_hash`、`input_hash` を含め、run 同士の比較に別 command を要らなくする。
|
|
467
|
+
walltime の根拠として `walltime`、最新 attempt の `elapsed`、`walltime_used`(elapsed / walltime)、
|
|
468
|
+
`slurm_state`(`TIMEOUT` など)も含める。
|
|
446
469
|
- 破壊的 command(`cancel`、`delete`、`tidy --apply`、`archive`)は対象を表示して
|
|
447
470
|
確認を取る。`-y/--yes` で省略。
|
|
448
471
|
- exit code: 0 成功、1 対象 run の実行時エラー(例: sbatch 失敗)、2 使用方法・設定エラー。
|
|
@@ -463,12 +486,12 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
463
486
|
| `runo doctor [--json]` | `runops.toml` の妥当性、adapter の import 可否、executable の存在、`sbatch` の有無、skill の鮮度を検査 |
|
|
464
487
|
| `runo update [--skills-only] [-y]` | adapter package を upgrade し、skill を再展開する |
|
|
465
488
|
| `runo build SIM [--force]` | `local_source` simulator を `.runops/build/` に build する(§4.1) |
|
|
466
|
-
| `runo context [--json]` | agent 向け現在地。project 名、simulator、active run 数、直近 run 5 件、scratch 期限切れ数、`LOG.md` 末尾 20
|
|
489
|
+
| `runo context [--json]` | agent 向け現在地。project 名、simulator、active run 数、直近 run 5 件、scratch 期限切れ数、`LOG.md` 末尾 20 行。配置した runops skill が install 済みの runops より古ければ `runo update --skills-only` を促す warning |
|
|
467
490
|
| `runo case new NAME --simulator SIM [--from CASE]` | case をスキャフォールド。adapter の `case_template()` を展開 |
|
|
468
491
|
| `runo case list` | case 一覧 |
|
|
469
492
|
| `runo new CASE [--why TEXT] [--label L] [--set k=v]... [--tag T]... [--scratch] [--dest DIR] [--submit] [--created-by WHO] [--json]` | 単発 run を作る |
|
|
470
493
|
| `runo new --from RUN [--why] [--set k=v]... [--continue] [--submit]` | 既存 run の params から派生 run を作る。`--continue` は adapter が `extend_inputs()` を実装する場合のみ有効(§8.1) |
|
|
471
|
-
| `runo sweep CASE --set k=v1,v2,... [--set ...] [--label L] [--why TEXT] [--apply] [--submit] [--limit N] [--json]` | 直積の候補を表示する。`--apply` で生成。`--submit` は `--apply` と同時のみ有効 |
|
|
494
|
+
| `runo sweep CASE --set k=v1,v2,... [--set ...] [--names KEY=n1,n2,...]... [--label L] [--dest DIR] [--why TEXT] [--apply] [--submit] [--limit N] [--json]` | 直積の候補を表示する。`--apply` で生成。`--submit` は `--apply` と同時のみ有効 |
|
|
472
495
|
| `runo submit RUN... [--partition P] [--qos Q] [--afterok JOBID] [-y]` | job.sh を生成して sbatch。`created` 以外は拒否 |
|
|
473
496
|
| `runo submit --all [DIR] [-y]` | DIR 配下の `created` run をすべて投入。件数と概算 core-hours を表示して確認 |
|
|
474
497
|
| `runo cancel RUN... [-y]` | scancel して sync |
|
|
@@ -480,6 +503,7 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
480
503
|
| `runo note RUN [TEXT] [--by WHO]` | TEXT があれば `[[notes]]` に追記、なければ notes と `notes.md` を表示 |
|
|
481
504
|
| `runo pin RUN [--off] [--reason TEXT]` | `run.pinned` を切り替える。pinned は `list` に常に出て、`tidy` / `delete` の対象外 |
|
|
482
505
|
| `runo summarize RUN... [--force]` | adapter の `summarize()` を呼び `analysis/summary.json` を書く。既存があれば `--force` なしではスキップ |
|
|
506
|
+
| `runo mv RUN... [--dest DIR] [--label L] [--why TEXT]` | run を `runs/` 配下で改名・移動する。id、入力、履歴は変えない(§7.7) |
|
|
483
507
|
| `runo archive RUN... [-y]` / `runo archive --older-than 90d [-y]` | `runs/_archive/<元の相対 path>` に移動して `archived` にする |
|
|
484
508
|
| `runo restore RUN` | archive 前の場所に戻す。既に何かあれば拒否 |
|
|
485
509
|
| `runo delete RUN... [-y]` | directory を削除。`created`/`failed`/`cancelled`/scratch のみ。`pinned` は拒否 |
|
|
@@ -514,6 +538,7 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
514
538
|
- `--older-than AGE`(例 `14d`)はその回だけ、上の 2 つの日数をどちらもこの値で置き換える。
|
|
515
539
|
- `--purge-work RUN...` は指定 run の `work/` の中身を削除し `work_purged_at` を記録する。
|
|
516
540
|
adapter が `keep_patterns()` を返す場合、一致するファイルは残す。`completed` 以外は拒否。
|
|
541
|
+
adapter を読み込めない(残すファイルを判定できない)ときは何も消さずにエラーにする。
|
|
517
542
|
- `tidy` は receipt や tombstone を作らない。失敗したら error を出して止まる。
|
|
518
543
|
部分実行された結果は各 run の manifest にそのまま残る(再実行で続きから処理できる)。
|
|
519
544
|
|
|
@@ -528,6 +553,22 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
528
553
|
`sweep_label` 省略時は `sweep-<YYYYMMDD>-<NN>`。
|
|
529
554
|
- label は changed_keys から自動生成する(`wc0.147_phiz45`)。長さ上限は `defaults.label_max_length`(既定 48 文字)。
|
|
530
555
|
key の短縮 alias は case.toml の `[naming.aliases]` で指定できる(v1 と同じ)。
|
|
556
|
+
- `--names KEY=n1,n2,...` は掃引する KEY の各値に短い名前を付け、label ではその key の
|
|
557
|
+
alias + 値の代わりに名前を使う(構造化した配列を 1 軸にしたとき `wh0`、`wh1` のようにする)。
|
|
558
|
+
名前の数は値の数と同じで、重複は不可。入力や params には何も足さない。
|
|
559
|
+
- `--dest DIR` は sweep directory の親を変える(既定 `runs/<case>`)。系列で共通の条件を
|
|
560
|
+
`--label` に、各点の違いを label に置く命名を作れる。
|
|
561
|
+
|
|
562
|
+
### 7.7 `mv` の規則
|
|
563
|
+
|
|
564
|
+
- `runo mv RUN... --dest DIR` は run を DIR(`runs/` 配下、`_archive` と既存 run の外)へ移す。
|
|
565
|
+
`--label L` は directory 名の suffix と `run.label` を変える(1 run のときだけ。`''` で外す)。
|
|
566
|
+
- run id、`input/`、`input_hash`、`[origin]`(case、sweep、parent_run)、notes、投入履歴は変えない。
|
|
567
|
+
`[path].run_dir` と index を更新し、移動元と `--why` を `[[notes]]` に追記する。
|
|
568
|
+
- 対象は `created`、`completed`、`failed`、`cancelled`。`submitted` / `running` は拒否する
|
|
569
|
+
(Slurm が run directory の絶対 path を持つ)。`archived` は `restore` を使う。
|
|
570
|
+
- 既存 path は上書きしない(`move_noreplace`)。`created` の run は job.sh を作り直す。
|
|
571
|
+
- 手で `mv` しても run は id で見つかるが、`run.label` と `[path].run_dir` が古いまま残る。
|
|
531
572
|
|
|
532
573
|
---
|
|
533
574
|
|
|
@@ -837,7 +878,7 @@ src/runops/
|
|
|
837
878
|
| 項目 | 目標 |
|
|
838
879
|
|---|---|
|
|
839
880
|
| `src/runops/` の行数(skill の md を除く) | 8,000 行以下 |
|
|
840
|
-
| CLI command 数(`case new` / `case list` を含む。同じ command の option 違いは数えない) | 25 以下。§7.3 の表の distinct command は
|
|
881
|
+
| CLI command 数(`case new` / `case list` を含む。同じ command の option 違いは数えない) | 25 以下。§7.3 の表の distinct command は 24 |
|
|
841
882
|
| ユーザーが編集する TOML | `runops.toml`、`case.toml` の 2 種 |
|
|
842
883
|
| runops が書く TOML | `manifest.toml`、`.runops/skills.lock`、`.runops/index.toml` の 3 種 |
|
|
843
884
|
| 依存 | `typer`、`rich`、`tomli-w`、`tomlkit`、`jinja2`、`packaging`(`mcp` を外す) |
|
|
@@ -878,9 +919,10 @@ src/runops/
|
|
|
878
919
|
|
|
879
920
|
### 13.3 ドキュメント
|
|
880
921
|
|
|
881
|
-
v2
|
|
922
|
+
v2 の文書は次の 4 ファイルだけにする。
|
|
882
923
|
|
|
883
924
|
- `README.md`: 導入と 5 分の tutorial
|
|
925
|
+
- `docs/guide.md`: 場面ごとの使い方。エージェントへの頼み方と裏の `runo` コマンドを並べる
|
|
884
926
|
- `docs/reference.md`: §4〜§7 を利用者向けに書き直したもの
|
|
885
927
|
- `docs/adapter.md`: §8 を simulator package 作者向けに書き直したもの
|
|
886
928
|
|
|
@@ -898,6 +940,8 @@ v2 の `docs/` は次の 3 ファイルだけにする。
|
|
|
898
940
|
| adapter の追加 hook | `configure(sim_config)`、`job_prelude(run_dir)` | generic の `command` 取得と、EMSES の `rm -f *_0000.h5` など v1 の setup command を表す |
|
|
899
941
|
| launcher `kind = "none"` | MPI launcher を使わず program を直接実行 | OpenMP のみの BEACH run 用 |
|
|
900
942
|
| `runo pin` | command を 1 つ追加(計 23 + `--version`) | `pinned` を立てる手段が本文に無かった |
|
|
943
|
+
| `runo mv`、`sweep --names` / `--dest`(2026-10-20) | id を保つ改名・移動を command にする(計 24)。sweep の各点に短い名前を付け、親 directory を選べるようにする | 運用で、投入前に名前を短くするだけで 10 run を `new --from` で作り直し、id が 10 増えた(#110)。構造化配列を 1 軸にすると label に配列が展開された(#111)。未投入 run の入力編集は「入力は作成時に固定」を崩すので見送る |
|
|
944
|
+
| walltime の根拠(2026-10-20) | attempt ごとに `elapsed` を記録し、`list` / `status` に `elapsed`、`walltime`、`walltime_used`、`slurm_state` を出す。表では TIMEOUT などを `failed (TIMEOUT)` と示す。似た run の選択と余裕の倍率は skill の指針に置き、runops は推奨値を出さない | 「似た run」の自動判定は外れたときの害が大きい。根拠の数値を見せ、判断はエージェントと人に任せる(#109) |
|
|
901
945
|
| generic の `success_marker` | 既定は未設定(Slurm の状態に従う) | 既定 `COMPLETED` だと marker を書かない program が全て failed になる |
|
|
902
946
|
| skill 名 | package の skill 名をそのまま使う | MPIEMSES3D の skill は既に `mpiemses3d-` で名前空間がある |
|
|
903
947
|
| `new --from RUN` の入力 | case の base file に、source run の params と `--set` を適用 | generic の template と TOML override の両方で同じ結果になる |
|
|
@@ -912,3 +956,5 @@ v2 の `docs/` は次の 3 ファイルだけにする。
|
|
|
912
956
|
| 同一入力の warning | `input_hash`(と `exe_hash`)が一致する既存 run を作成時に知らせる | §1.3 で観察した variation の重複を、ゲート無しで抑える |
|
|
913
957
|
| 整理と命名のしきい値 | `[defaults]` に `tidy_failed_days`、`tidy_archive_days`、`label_max_length` を追加。completed の目安は「`--older-than` の 3 倍」をやめて独立の値に | project ごとに計算期間や命名が違い、エージェントに毎回 option を渡させると揃わない |
|
|
914
958
|
| `runo init` の対話と site の推定 | 端末から引数なしで実行したときだけ site と simulator を尋ねる。site の既定はホスト名(`camphor*`、`laurel*`、`cinnamon*`、`gardenia*` なら `kudpc`)。プリセット名は `kudpc` とし、`camphor` も同じ意味で受け付ける | 人が打つのは `runo init` だけなので、ここで KUDPC 向けの設定を取り違えないようにする。エージェントや CI からの実行(端末でない、`-y`、引数あり)は従来どおり尋ねない |
|
|
959
|
+
| 異常系と同時操作(2026-10-20) | `run.lock` 下で manifest を読み直す、準備の失敗で program を起動しない、adapter を読めなければ purge しない、build cache の key を内容と `build_command` から作る、run の入れ子を禁止、run id を再利用しない(`last_run_id`)、`new --from` で case の変更を警告 | 外部レビューで、二重投入で 1 回目の履歴が消える、準備失敗が completed になる、adapter の故障で保持ファイルが消える、未追跡ファイルの変更で古い binary を使う、削除した id が別の run を指す、を確認した |
|
|
960
|
+
| 使い方ガイド | `docs/guide.md` を追加し、文書を 4 ファイルにする(§13.3) | README の依頼例の表と command 一覧の間を埋める、場面ごとの流れ(case と run の分け方、smoke から本計算、状態の決まり方、整理)の置き場所が無かった |
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# runops 使い方ガイド
|
|
2
|
+
|
|
3
|
+
runops で計算を進める流れを、場面ごとに説明します。人が打つコマンドは `runo init` だけで、
|
|
4
|
+
ほかはエージェント(Codex や Claude Code)に頼みます。各節では頼み方の例と、その裏で
|
|
5
|
+
エージェントが実行する `runo` コマンドを並べます。コマンドと設定の一覧は
|
|
6
|
+
[リファレンス](reference.md) にあります。
|
|
7
|
+
|
|
8
|
+
## 1. 始める
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uv tool install runops
|
|
12
|
+
mkdir lunar-sheath && cd lunar-sheath
|
|
13
|
+
runo init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`runo init` は計算機の種類(site)と使う simulator を尋ねます。site はホスト名から推定するので、
|
|
17
|
+
京大スパコンのログインノードなら Enter で進めます。終わると次のものができています。
|
|
18
|
+
|
|
19
|
+
| できるもの | 役割 |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `runops.toml` | site、simulator、launcher、整理のしきい値などの設定 |
|
|
22
|
+
| `cases/`、`runs/` | 入力テンプレートと、実行した run の置き場所 |
|
|
23
|
+
| `LOG.md`、`notes/` | 判断の記録と、再利用する知見の置き場所([6 節](#6-記録を残す)) |
|
|
24
|
+
| `.venv/` | simulator の Python package(adapter と skill を含む) |
|
|
25
|
+
| `AGENTS.md`、`CLAUDE.md`、`.agents/skills/`、`.claude/skills/` | エージェント向けの規則と skill |
|
|
26
|
+
|
|
27
|
+
この directory で Codex か Claude Code を起動し、調べたいことを話しかけてください。
|
|
28
|
+
エージェントは `AGENTS.md` と skill を読んで `runo` を使います。最初の依頼の例です。
|
|
29
|
+
|
|
30
|
+
> MPIEMSES3D で平板シースを計算したい。cookbook の例を元に case を作って。
|
|
31
|
+
> gr20001a に 800 並列、120 時間で。
|
|
32
|
+
|
|
33
|
+
## 2. case と run の分け方
|
|
34
|
+
|
|
35
|
+
runops が扱う名詞は case、run、sweep の 3 つです。
|
|
36
|
+
|
|
37
|
+
| 名詞 | 中身 | 置き場所 |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| case | 再利用する入力テンプレート。`case.toml` と base 入力ファイル | `cases/<name>/` |
|
|
40
|
+
| run | 1 回の実行。入力を凍結し、状態を `manifest.toml` に持つ | `runs/<case>/<run_id>--<label>/` |
|
|
41
|
+
| sweep | 1 つの case から値を振って run をまとめて作る操作 | `runs/<case>/<sweep_label>/` |
|
|
42
|
+
|
|
43
|
+
**値を変えるだけなら case を増やさず、run で表します。** case を増やすのは、base 入力ファイルの
|
|
44
|
+
構造(境界の種類、粒子種の数など)が変わるときだけです。値ごとに case を作ると、
|
|
45
|
+
`flat_size_1x`、`flat_uv_off`、`flat_retry` のような case が増え、どれが何だったか追えなくなります。
|
|
46
|
+
|
|
47
|
+
| やりたいこと | 頼み方の例 | 裏のコマンド |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| 1 つの値を変えて試す | flat で wc を 0.147 にして 1 本作って | `runo new flat --set plasma.wc=0.147 --why "..."` |
|
|
50
|
+
| 前の run から少し変える | R20261015-0002 の nx だけ倍にして | `runo new --from R20261015-0002 --set tmgrid.nx=8000 --why "..."` |
|
|
51
|
+
| 値を振る | wc を 0, 0.147, 0.294 で振って | `runo sweep flat --set plasma.wc=0,0.147,0.294 --why "..."` |
|
|
52
|
+
| 構造が違う入力を作る | flat を元に、穴の空いた境界の case を作って | `runo case new hole --from flat` |
|
|
53
|
+
|
|
54
|
+
`--set` の key は base 入力の dotted key です(`plasma.wc`、配列なら `species.0.wp`)。
|
|
55
|
+
値は TOML のリテラルとして読まれます(`3`、`1.5e-6`、`true`、`[1, 2]`)。
|
|
56
|
+
|
|
57
|
+
どの run にも `--why`(その run で確かめたいこと)が付きます。エージェントには、依頼の中で
|
|
58
|
+
目的も伝えてください。後で `runo list` を見たとき、run を区別する手がかりになります。
|
|
59
|
+
|
|
60
|
+
作った run の `manifest.toml` と `input/` は変更しません。入力を直したいときは新しい run を作ります。
|
|
61
|
+
同じ入力の run が既にあると、作成時に警告が出ます。
|
|
62
|
+
`new --from` は元の run の params を引き継ぎますが、入力ファイルは今の case から作ります。
|
|
63
|
+
元の run を作った後に case の入力ファイルを直していると、作成時に警告が出ます。
|
|
64
|
+
|
|
65
|
+
### 名前の付け方
|
|
66
|
+
|
|
67
|
+
名前は、系列と主な条件を見分けるためのものです。全条件は manifest と `input/` にあります。
|
|
68
|
+
系列で共通の条件は親 directory に、各点の違いは run の label に置きます。
|
|
69
|
+
|
|
70
|
+
> 直径 5 m、10 eV、400 km/s、光電子ありで深さ比 wh を 0〜4 で振って。名前は短く。
|
|
71
|
+
|
|
72
|
+
エージェントは `runo sweep ... --label d5m_T10eV_v400kms_pe --dest runs --names ptcond.boundaries=wh0,wh1,wh2,wh3,wh4`
|
|
73
|
+
のように作り、`runs/d5m_T10eV_v400kms_pe/R…--wh2` になります。`--names` は、配列のような長い値を
|
|
74
|
+
掃引するときに各値へ短い名前を付けます(入力には何も足しません)。
|
|
75
|
+
|
|
76
|
+
作った後で名前や置き場所を変えたいときは「R…〜R… を runs/pe にまとめて」と頼めば
|
|
77
|
+
`runo mv RUN... --dest runs/pe --why "..."` になります。`--label` で label も変えられます。
|
|
78
|
+
run id、入力、sweep の帰属、ノートはそのままで、移動元はノートに残ります。
|
|
79
|
+
投入中(submitted / running)の run は動かせません。
|
|
80
|
+
|
|
81
|
+
## 3. 試してから本計算
|
|
82
|
+
|
|
83
|
+
いきなり本計算を投げず、短い scratch run で動作を確かめてから投入する流れです。
|
|
84
|
+
|
|
85
|
+
> 100 step だけ smoke で試して。通ったら wc を 3 通りに振った候補を見せて。
|
|
86
|
+
|
|
87
|
+
エージェントは次の順に進めます。
|
|
88
|
+
|
|
89
|
+
1. `runo new flat --scratch --set ... --why "smoke"` で scratch run を作って投入する。
|
|
90
|
+
scratch run は `runs/_scratch/` に置かれ、既定の `runo list` には出ません。
|
|
91
|
+
`scratch_ttl_days`(既定 7 日)を過ぎると `runo tidy` の削除候補になります。
|
|
92
|
+
2. `runo sync` と `runo log RUN --err` で、起動直後に落ちていないか確かめる。
|
|
93
|
+
3. `runo sweep flat --set plasma.wc=0,0.147,0.294 --why "..."` で候補を表示する。
|
|
94
|
+
この段階では何も作られません。表には候補ごとの値、label、合計の core-hours が出ます。
|
|
95
|
+
4. あなたが確認したら、`runo sweep ... --apply --submit` で run を作って投入する。
|
|
96
|
+
|
|
97
|
+
依頼の言葉が、エージェントに許す操作の範囲を決めます。
|
|
98
|
+
|
|
99
|
+
| 依頼の言葉 | エージェントがしてよいこと |
|
|
100
|
+
|---|---|
|
|
101
|
+
| 「作って」 | run の作成まで。投入はしない |
|
|
102
|
+
| 「流して」「投げて」 | 作成と投入 |
|
|
103
|
+
| 「試して」 | 短い scratch run の作成と投入。本計算は投げない |
|
|
104
|
+
|
|
105
|
+
投入、削除、整理、移行の前には、エージェントが対象の run、partition、資源量、core-hours を示して
|
|
106
|
+
確認を取ります。`runo` 自体も、複数 run の投入や削除の前に確認を求めます。
|
|
107
|
+
|
|
108
|
+
資源量(partition、walltime、並列数)は case の `[job]` に書きます。1 回だけ partition を
|
|
109
|
+
変えるなら「今回は gr20001b で投げて」と頼めば `runo submit RUN --partition gr20001b` になります。
|
|
110
|
+
|
|
111
|
+
walltime は、同じ case・同じ資源で終わった run の実時間を元に決めます。`runo list --json` と
|
|
112
|
+
`runo status` は、各 run の `elapsed`(最新の実行の実時間)、`walltime`、使った割合を示します。
|
|
113
|
+
エージェントは「R… が 15:42 で終わったので 1.3〜1.5 倍の 24 時間」のように根拠の run を挙げて提案し、
|
|
114
|
+
似た run が無ければ見積もれないと伝えます。walltime 切れの run は `failed (TIMEOUT)` と表示されます。
|
|
115
|
+
|
|
116
|
+
## 4. 様子を見る
|
|
117
|
+
|
|
118
|
+
> 先週投げた run の状況を見て。失敗していたら原因をノートに残して。
|
|
119
|
+
|
|
120
|
+
| コマンド | 内容 |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `runo sync` | 投入済み・実行中の run の状態を Slurm から更新する |
|
|
123
|
+
| `runo list` | 実行中、作成済み、直近 30 日、pin した run を表示する |
|
|
124
|
+
| `runo status RUN` | 1 つの run の状態(Slurm には問い合わせない) |
|
|
125
|
+
| `runo log RUN --err` | 最新 job の stderr の末尾 |
|
|
126
|
+
| `runo summarize RUN` | adapter による結果の要約を `analysis/summary.json` に書く |
|
|
127
|
+
|
|
128
|
+
`runo sync` は、active な run が何件あっても `squeue` と `sacct` を 1 回ずつしか呼びません。
|
|
129
|
+
エージェントには `squeue` を直接叩かせず、`runo sync` を使わせてください。
|
|
130
|
+
|
|
131
|
+
### 状態の決まり方
|
|
132
|
+
|
|
133
|
+
run の状態は `created → submitted → running → completed | failed | cancelled` と進みます。
|
|
134
|
+
`sync` は次の順で終わった run の状態を決めます。
|
|
135
|
+
|
|
136
|
+
1. Slurm が状態を返す job はその状態に従う。Slurm が `COMPLETED` でも、adapter が出力を見て
|
|
137
|
+
失敗と判断すれば `failed` にする。
|
|
138
|
+
2. Slurm の記録から消えた job は、job.sh が終了時に書く `submit/exit.<job_id>` を見る。
|
|
139
|
+
exit code が 0 なら adapter の判定、0 以外なら `failed`。`module load` や `pre_commands` などの
|
|
140
|
+
準備が失敗した job は program を起動せずに終わり、`failed` になる。
|
|
141
|
+
3. その記録も無ければ adapter の判定に従い、判定できなければ `failed`。
|
|
142
|
+
|
|
143
|
+
runops が知らない Slurm 状態の job は状態を変えず、`last_slurm_state` に状態名だけを残します。
|
|
144
|
+
|
|
145
|
+
### 長い job の見守り
|
|
146
|
+
|
|
147
|
+
本計算の投入は、Slurm が受け付けた時点で完了です。エージェントは job id を報告して止まります。
|
|
148
|
+
見守ってほしいときは、そう頼んでください。
|
|
149
|
+
|
|
150
|
+
> 投げたら、最初にちゃんと動き出したかだけ見て。
|
|
151
|
+
|
|
152
|
+
エージェントは起動直後に 1 回確認し、その後は予定の終了時刻のあたりで確認します。
|
|
153
|
+
`tail -f` や短い間隔での状態確認の繰り返しはしません。期限が来ても、エージェントが自分の判断で
|
|
154
|
+
キャンセルや再投入をすることはありません。
|
|
155
|
+
|
|
156
|
+
### 失敗したとき
|
|
157
|
+
|
|
158
|
+
| 状況 | 頼み方の例 | 裏のコマンド |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| 原因を調べる | R20261016-0003 が落ちた理由を調べて | `runo log RUN --err`、`runo summarize RUN`、`runo note RUN "..."` |
|
|
161
|
+
| 一時的な障害で、同じ入力で流し直す | 同じ入力でもう一度投げて | `runo retry RUN`、`runo submit RUN` |
|
|
162
|
+
| 入力を直して流し直す | dt を半分にして作り直して | `runo new --from RUN --set ... --why "..."` |
|
|
163
|
+
| 止める | R20261016-0004 を止めて | `runo cancel RUN` |
|
|
164
|
+
|
|
165
|
+
`retry` は `failed` / `cancelled` の run を `created` に戻し、試行回数を 1 つ増やします。
|
|
166
|
+
`work/` は消しません。
|
|
167
|
+
|
|
168
|
+
## 5. 続きを流す
|
|
169
|
+
|
|
170
|
+
> R20261015-0003 の続きを 2 倍の step で。
|
|
171
|
+
|
|
172
|
+
`runo new --from RUN --continue` で、終わった run の出力から再開する run を作ります。
|
|
173
|
+
再開の方法は simulator ごとに違い、adapter が対応している場合だけ使えます
|
|
174
|
+
(現在は MPIEMSES3D が対応し、`SNAPSHOT1` から再開します)。新しい run は元の run を `parent_run` として記録します。
|
|
175
|
+
|
|
176
|
+
前の job が終わるのを待って投入したいときは、「R20261016-0005 が成功したら投げて」と頼めば
|
|
177
|
+
`runo submit RUN --afterok <job_id>` になります。
|
|
178
|
+
|
|
179
|
+
## 6. 記録を残す
|
|
180
|
+
|
|
181
|
+
記録の置き場所は 3 つに決まっています。
|
|
182
|
+
|
|
183
|
+
| 何を | どこに | 頼み方の例 |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| 1 つの run についての観察 | `runo note RUN "..."`(manifest に日時付きで残る)か run の `notes.md` | この run は 3 万 step で電位が飽和した、とメモして |
|
|
186
|
+
| 複数の run をまたぐ結論と次の判断 | `LOG.md` に日付見出しで追記 | 今日の scan の結論を LOG にまとめて |
|
|
187
|
+
| 再利用する式、手法、落とし穴 | `notes/<topic>.md`(1 topic 1 file) | Debye 長の見積もり方を notes に残して |
|
|
188
|
+
|
|
189
|
+
エージェントはこれ以外の場所(`research/`、`analysis/*.md`、`runs/` の下など)にノートを作りません。
|
|
190
|
+
`notes/` に似た topic の file があれば、新しく作らずに追記します。
|
|
191
|
+
|
|
192
|
+
`runo context` は `LOG.md` の末尾と `notes/` の file 名を表示します。エージェントは作業の始めに
|
|
193
|
+
これを読むので、前回の続きから話を始められます。
|
|
194
|
+
|
|
195
|
+
## 7. 整理する
|
|
196
|
+
|
|
197
|
+
run は消さなくても `runo list` が古いものを隠しますが、directory とディスクは増えていきます。
|
|
198
|
+
|
|
199
|
+
> 古い run を整理して。消すものと archive するものを先に見せて。
|
|
200
|
+
|
|
201
|
+
`runo tidy` は候補を表示するだけで、何も変更しません。
|
|
202
|
+
|
|
203
|
+
| 種類 | 条件 | 処理 |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| `expired-scratch` | 期限切れの scratch run | 削除 |
|
|
206
|
+
| `stale-failed` | 30 日より古い failed / cancelled で、`why` もノートも無い | 削除 |
|
|
207
|
+
| `old-completed` | 90 日より古い completed | archive |
|
|
208
|
+
| `orphan-job` | 投入済みなのに Slurm が知らない | `sync` で状態を確定 |
|
|
209
|
+
| `unused-build` | どの run も使っていない build cache | 削除 |
|
|
210
|
+
|
|
211
|
+
候補を確認したら `runo tidy --apply` で実行します。archive は `runs/_archive/` への移動で、
|
|
212
|
+
run id で引き続き見つかり、`runo restore` で戻せます。
|
|
213
|
+
|
|
214
|
+
論文の図に使う run や基準にする run は pin しておくと、`list` に常に表示され、`tidy` や `delete`
|
|
215
|
+
の対象になりません。
|
|
216
|
+
|
|
217
|
+
> R20261015-0002 は図 3 の基準なので残しておいて。
|
|
218
|
+
|
|
219
|
+
終わった run の出力が大きいときは、「R20261015-0002 の work を片付けて」と頼めば
|
|
220
|
+
`runo tidy --purge-work RUN` で `work/` の中身を消します。adapter が指定するファイル
|
|
221
|
+
(要約やログなど)は残ります。adapter を読み込めないときは、何も消さずにエラーになります。
|
|
222
|
+
|
|
223
|
+
日数のしきい値は `runops.toml` の `[defaults]` にあります。「この project では failed は
|
|
224
|
+
14 日で消していい」と頼めば、エージェントが書き換えます。
|
|
225
|
+
|
|
226
|
+
## 8. simulator を足す、更新する
|
|
227
|
+
|
|
228
|
+
| やりたいこと | 頼み方の例 | 裏のコマンド |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| 状態を点検する | runops の環境を点検して | `runo doctor` |
|
|
231
|
+
| package の simulator を足す | BEACH も使えるようにして | `runops.toml` に追記、`runo update -y` |
|
|
232
|
+
| 手元で改造した版を足す | ~/BEACH-dev をビルドして、別の simulator として登録して | `resolver_mode = "local_source"`、`runo build NAME` |
|
|
233
|
+
| 自作プログラムを使う | ./run.sh を simulator として登録して | `adapter = "generic"`、`command = "./run.sh"` |
|
|
234
|
+
| 更新する | runops と simulator を最新にして | `uv tool upgrade runops`、`runo update -y` |
|
|
235
|
+
|
|
236
|
+
`runo update` は simulator package を更新し、package に同梱された skill を配置し直します。
|
|
237
|
+
runops を更新した後、project の skill が古いままだと `runo context` が警告を出すので、「skill を更新して」と頼んでください。
|
|
238
|
+
`AGENTS.md` は `<!-- runops:begin -->` から `<!-- runops:end -->` までだけを書き換えるので、
|
|
239
|
+
その外に書いた project 固有の規則は残ります。
|
|
240
|
+
|
|
241
|
+
`local_source` の simulator は、source の commit と `build_command`(dirty なら未追跡を含む
|
|
242
|
+
ファイルの内容も)ごとに `.runops/build/<sim>-<commit>-<hash>/` へ build し、run の manifest に commit と executable の hash を記録します。後から「この run は
|
|
243
|
+
どの版で計算したか」を確かめられます。
|
|
244
|
+
|
|
245
|
+
simulator 用の adapter を自分で書く方法は [adapter ガイド](adapter.md) にあります。
|
|
246
|
+
|
|
247
|
+
## 9. v1 の project から移る
|
|
248
|
+
|
|
249
|
+
> この project を runops v2 に移行して。
|
|
250
|
+
|
|
251
|
+
エージェントは先に `runo migrate-v1 --dry-run` で変換計画を見せます。確認すると変換を実行します。
|
|
252
|
+
|
|
253
|
+
- v1 の設定と harness は `.runops/v1-backup/<日時>/` に退避され、削除はされません。
|
|
254
|
+
- 各 run の v1 manifest は `manifest.v1.toml` として同じ directory に残ります。
|
|
255
|
+
- `research/`、`materials/`、`refs/` は動かしません。場所は `notes/README.md` に追記されます。
|
|
256
|
+
- run directory は移動しません。v1 の配置のまま `runo list --all` に表示されます。
|
|
257
|
+
|
|
258
|
+
実運用中の project を移行するときは、先にコピーで試すよう頼むと安全です。
|
|
259
|
+
|
|
260
|
+
## 10. よくあるつまずき
|
|
261
|
+
|
|
262
|
+
- **KUDPC のログインノード**: `runo` の操作自体はログインノードで実行できます。simulator の
|
|
263
|
+
build や重い解析は計算ノードで行います。エージェントには KUDPC 用の plugin の規則に従わせてください。
|
|
264
|
+
- **`runo` が project を見つけない**: `runo` は現在の directory から上に向かって `runops.toml` を
|
|
265
|
+
探します。project の外で実行すると exit code 2 で止まります。
|
|
266
|
+
- **run directory を動かした**: `runs/` の下なら自由に移動して構いません。run id で見つかります。
|
|
267
|
+
`runs/` の外に出した run は扱えません。
|
|
268
|
+
- **確認を求められて止まる**: 端末以外から `runo` を実行すると確認の入力ができないため、
|
|
269
|
+
`-y` が無い破壊的な操作はエラーになります。エージェントはあなたの確認を取ってから `-y` を付けます。
|
|
270
|
+
- **skill が古い**: runops や simulator を更新した後は `runo doctor` が skill の更新を提案します。
|
|
271
|
+
「skill を更新して」と頼めば `runo update --skills-only` を実行します。
|
|
@@ -58,7 +58,7 @@ label_max_length = 48 # run 名の自動ラベルの最大文字数
|
|
|
58
58
|
|---|---|
|
|
59
59
|
| `package` | `.venv/bin/<executable>`、無ければ PATH |
|
|
60
60
|
| `local_executable` | 絶対 path、project 相対 path、PATH の順 |
|
|
61
|
-
| `local_source` | `source_repo` の HEAD を `.runops/build/<sim>-<commit>/` にコピーし `build_command`
|
|
61
|
+
| `local_source` | `source_repo` の HEAD を `.runops/build/<sim>-<commit>-<hash>/` にコピーし `build_command` を実行。`<hash>` は `build_command` と、dirty なら未追跡を含む全ファイルの内容から作る(dirty なら `-dirty` も付く) |
|
|
62
62
|
|
|
63
63
|
module は site、launcher、simulator、case の順に結合されます。`generic` adapter では
|
|
64
64
|
`command`(`{executable}` を置換)と `success_marker`(`work/` 内の完了 marker)も使えます。
|
|
@@ -105,9 +105,9 @@ runops だけが書きます。手で編集しないでください。主な fie
|
|
|
105
105
|
|---|---|
|
|
106
106
|
| `[run]` | `id`、`label`、`status`、`created_at`、`why`、`scratch`、`expires_at`、`pinned`、`tags`、`status_before_archive` |
|
|
107
107
|
| `[path]` | `run_dir`(project 相対)、`archived_from`、`archived_at` |
|
|
108
|
-
| `[origin]` | `case`、`sweep`、`parent_run`、`created_by` |
|
|
108
|
+
| `[origin]` | `case`、`sweep`、`parent_run`、`created_by`、`case_input_hash` |
|
|
109
109
|
| `[simulator]` | `name`、`adapter`、`adapter_source`、`adapter_version`、`executable`、`resolver_mode`、`package_version`、`exe_hash`、`git_commit`、`git_dirty`、`build_dir` |
|
|
110
|
-
| `[job]` | case の `[job]` に加え `job_id`、`attempt`、`submitted_at`、`finished_at`、`last_slurm_state`、`exit_code`、`[[job.attempts]]`(attempt ごとの `job_id`、`started_at`、`exit_code`、`exe_hash`) |
|
|
110
|
+
| `[job]` | case の `[job]` に加え `job_id`、`attempt`、`submitted_at`、`finished_at`、`last_slurm_state`、`exit_code`、`[[job.attempts]]`(attempt ごとの `job_id`、`started_at`、`exit_code`、`exe_hash`、`elapsed`) |
|
|
111
111
|
| `[params]` | case の params に `--set` を適用した最終値 |
|
|
112
112
|
| `[variation]` | `changed_keys` |
|
|
113
113
|
| `[identity]` | `input_hash` |
|
|
@@ -116,17 +116,29 @@ runops だけが書きます。手で編集しないでください。主な fie
|
|
|
116
116
|
|
|
117
117
|
状態は `created → submitted → running → completed | failed | cancelled` と進み、
|
|
118
118
|
終了した run は `archived` にできます。`sync` は Slurm が COMPLETED でも adapter が
|
|
119
|
-
失敗と判定すれば `failed` にします。job.sh は終了時に `submit/exit.<job_id>`(exit code
|
|
120
|
-
|
|
121
|
-
決まります。`
|
|
122
|
-
|
|
119
|
+
失敗と判定すれば `failed` にします。job.sh は終了時に `submit/exit.<job_id>`(exit code、
|
|
120
|
+
開始・終了時刻、`stage`)を書くので、Slurm の会計から消えた job もこの file で completed / failed が
|
|
121
|
+
決まります。`module load`、`cd`、`setup_commands`、`pre_commands` などの準備が失敗すると、job.sh は
|
|
122
|
+
program を起動せずに終わり、`stage = "setup"` と exit code を記録します。
|
|
123
|
+
`sync` と `tidy` は対象 run の job id をまとめて 1 回の `squeue` と `sacct` で
|
|
124
|
+
問い合わせます。runops が知らない Slurm 状態の job は状態を変えず、
|
|
125
|
+
`last_slurm_state` にその状態だけを記録します。
|
|
123
126
|
|
|
124
127
|
`submit` は executable を hash し直して attempt に記録し、作成時と違えば警告します。
|
|
125
128
|
`new` と `sweep --apply` は同じ入力(`input_hash`)の run が既にあれば警告します。
|
|
126
|
-
|
|
129
|
+
`new --from RUN` は、元の run を作った後に case の入力ファイルが変わっていれば警告します
|
|
130
|
+
(入力は今の case から作るため)。どれも作成や投入は拒否しません。
|
|
131
|
+
|
|
132
|
+
`submit`、`cancel`、`retry`、`sync` は lock の中で manifest を読み直してから更新します。
|
|
133
|
+
同じ run を 2 回指定しても、複数のエージェントが同時に投入しても sbatch は 1 回です。
|
|
134
|
+
run id は削除後も再利用しません。`--dest` に既存 run の中は指定できません。
|
|
127
135
|
|
|
128
136
|
## command
|
|
129
137
|
|
|
138
|
+
`list --json` と `status --json` は、walltime の根拠として `walltime`、最新 attempt の `elapsed`、
|
|
139
|
+
`walltime_used`(elapsed / walltime)、`slurm_state` も返します。表では `TIMEOUT` などを
|
|
140
|
+
`failed (TIMEOUT)` と示します。
|
|
141
|
+
|
|
130
142
|
全 command は `--help` で option を確認できます。`RUN` には run id、run directory、
|
|
131
143
|
または directory 名の一意な部分文字列を渡せます。
|
|
132
144
|
|
|
@@ -140,13 +152,14 @@ runops だけが書きます。手で編集しないでください。主な fie
|
|
|
140
152
|
| `runo case new NAME [-s SIM] [--from CASE]` / `runo case list` | case の作成と一覧 |
|
|
141
153
|
| `runo new CASE [--why] [--label] [--set k=v]... [--tag] [--scratch] [--dest DIR] [--submit] [--json]` | run を 1 つ作る |
|
|
142
154
|
| `runo new --from RUN [--set k=v]... [--continue]` | 既存 run の params から派生。`--continue` は adapter の restart 対応が必要 |
|
|
143
|
-
| `runo sweep CASE --set k=v1,v2 ... [--label] [--limit N] [--apply] [--submit] [--json]` | 直積の候補表示。`--apply`
|
|
155
|
+
| `runo sweep CASE --set k=v1,v2 ... [--names k=n1,n2...] [--label] [--dest DIR] [--limit N] [--apply] [--submit] [--json]` | 直積の候補表示。`--apply` で作成。`--names` は各値の短い label、`--dest` は sweep directory の親 |
|
|
144
156
|
| `runo submit RUN... [-p P] [--qos Q] [--afterok JOB]` / `runo submit --all [DIR] [-y]` | job.sh を生成して sbatch |
|
|
145
157
|
| `runo cancel RUN... [-y]` / `runo retry RUN [--submit]` | scancel / failed・cancelled を created に戻す |
|
|
146
158
|
| `runo status [RUN...]` / `runo sync [RUN...]` / `runo log RUN [--err] [-n N] [-f]` | 状態表示 / Slurm から更新 / log 表示 |
|
|
147
159
|
| `runo list [PATH] [--all] [--since 30d] [--case] [--sweep] [--status] [--tag] [--scratch] [--archived] [--json]` | run 一覧 |
|
|
148
160
|
| `runo note RUN [TEXT]` / `runo pin RUN [--off] [--reason]` | ノート追記・表示 / pin |
|
|
149
161
|
| `runo summarize RUN... [--force]` | adapter の要約を `analysis/summary.json` に書く |
|
|
162
|
+
| `runo mv RUN... [--dest DIR] [--label L] [--why TEXT]` | `runs/` 配下で改名・移動。id、入力、sweep、ノートは保つ。submitted / running と archived は不可 |
|
|
150
163
|
| `runo archive RUN... ` / `runo archive --older-than 90d` / `runo restore RUN` | `runs/_archive/` へ移動 / 戻す |
|
|
151
164
|
| `runo delete RUN... [-y]` | created・failed・cancelled・scratch の run を削除 |
|
|
152
165
|
| `runo tidy [--apply] [--only KIND] [--older-than AGE] [--purge-work RUN...]` | 整理候補の表示と実行 |
|
|
@@ -167,5 +180,6 @@ scratch と archived は表示しません。
|
|
|
167
180
|
|
|
168
181
|
日数は `runops.toml` の `[defaults]` で変えられます。`--older-than 14d` のように指定すると、
|
|
169
182
|
その回だけ両方の日数をその値で置き換えます。pinned の run は `tidy` と `delete` の対象になりません。
|
|
183
|
+
`--purge-work` は adapter を読み込めないと何も消さずにエラーにします。
|
|
170
184
|
|
|
171
185
|
exit code は 0 が成功、1 が実行時エラー(sbatch 失敗など)、2 が使い方や設定のエラーです。
|