runops 2.10.0__tar.gz → 2.11.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.10.0 → runops-2.11.0}/PKG-INFO +4 -4
- {runops-2.10.0 → runops-2.11.0}/README.md +1 -1
- {runops-2.10.0 → runops-2.11.0}/SPEC.md +35 -9
- {runops-2.10.0 → runops-2.11.0}/docs/guide.md +18 -6
- {runops-2.10.0 → runops-2.11.0}/docs/reference.md +26 -11
- {runops-2.10.0 → runops-2.11.0}/pyproject.toml +3 -3
- {runops-2.10.0 → runops-2.11.0}/src/runops/__init__.py +1 -1
- {runops-2.10.0 → runops-2.11.0}/src/runops/case.py +5 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/cli.py +29 -32
- {runops-2.10.0 → runops-2.11.0}/src/runops/config.py +20 -1
- {runops-2.10.0 → runops-2.11.0}/src/runops/errors.py +5 -1
- {runops-2.10.0 → runops-2.11.0}/src/runops/harness.py +7 -7
- {runops-2.10.0 → runops-2.11.0}/src/runops/jobgen.py +126 -35
- {runops-2.10.0 → runops-2.11.0}/src/runops/manifest.py +13 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/create.py +6 -1
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/setup.py +23 -9
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/submit.py +72 -29
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/sync.py +85 -32
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/tidy.py +14 -10
- runops-2.11.0/src/runops/pbs.py +100 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-check-status/SKILL.md +3 -3
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-reference/SKILL.md +9 -9
- runops-2.11.0/tests/test_pbs.py +187 -0
- {runops-2.10.0 → runops-2.11.0}/uv.lock +1 -1
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/check/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/improve-harness/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/agents/openai.yaml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/examples/refactor-request.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/references/anti-patterns.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/references/api-compatibility.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/references/packaging-modernization.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/references/refactor-playbook.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/references/verification.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/scripts/api_surface_snapshot.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/scripts/import_smoke.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/scripts/inspect_python_package.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/python-package-refactor/scripts/refactor_quality_gate.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/release/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/simulator-adapter/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/spec-reviewer/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.agents/skills/sync-docs/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/agents/spec-reviewer.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/rules/architecture.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/rules/dev-workflow.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/rules/gotchas.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/settings.json +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/check/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/improve-harness/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/python-package-refactor/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/release/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/simulator-adapter/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/spec-reviewer/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.claude/skills/sync-docs/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.codex/README.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/.codex/agents/spec-reviewer.toml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.codex/config.toml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.codex/rules/runops.rules +0 -0
- {runops-2.10.0 → runops-2.11.0}/.dockerignore +0 -0
- {runops-2.10.0 → runops-2.11.0}/.gitattributes +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/assets/conversation-dark.svg +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/assets/conversation-light.svg +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/assets/hero-dark.svg +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/assets/hero-light.svg +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/assets/make_readme_art.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/workflows/ci.yml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.github/workflows/publish.yml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.gitignore +0 -0
- {runops-2.10.0 → runops-2.11.0}/.pre-commit-config.yaml +0 -0
- {runops-2.10.0 → runops-2.11.0}/.vscode/settings.json +0 -0
- {runops-2.10.0 → runops-2.11.0}/AGENTS.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/CLAUDE.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/LICENSE +0 -0
- {runops-2.10.0 → runops-2.11.0}/docs/adapter.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/adapters/__init__.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/adapters/base.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/adapters/generic.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/adapters/registry.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/launchers.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/legacy_adapters/__init__.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/legacy_adapters/beach.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/legacy_adapters/emses.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/__init__.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/analysis.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/common.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/listing.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/notes.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/progress.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/ops/skills.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/project.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/runtime.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/README.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/out/fig1_maps.png +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/out/fig2_dependence.png +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/out/values.csv +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/report.html +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/scripts/build_html.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/example-report/scripts/make_figures.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-analyze/report-guide.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-create-run/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-maintain/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/skills/runops-tidy/SKILL.md +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/slurm.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/src/runops/util.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/__init__.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/conftest.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/golden/mpi_standard.sh +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/golden/openmp_rsc.sh +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_adapters.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_analysis_layout.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_archive_series.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_build.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_dev_harness.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_jobgen.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_legacy_adapters.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_lifecycle.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_manifest_config.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_mv_naming.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_progress.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_project_scope.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_run_job.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_safety.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_scratch_tidy.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_setup_misc.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_skills.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_sweep.py +0 -0
- {runops-2.10.0 → runops-2.11.0}/tests/test_sync_evidence.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: runops
|
|
3
|
-
Version: 2.
|
|
4
|
-
Summary: Run ledger and
|
|
3
|
+
Version: 2.11.0
|
|
4
|
+
Summary: Run ledger and 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
|
|
7
7
|
Project-URL: Issues, https://github.com/Nkzono99/runops/issues
|
|
8
8
|
License-Expression: Apache-2.0
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Keywords: ai-agent,hpc,simulation,slurm,workflow
|
|
10
|
+
Keywords: ai-agent,hpc,pbs,simulation,slurm,workflow
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Environment :: Console
|
|
13
13
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -41,7 +41,7 @@ Description-Content-Type: text/markdown
|
|
|
41
41
|
<a href="https://github.com/Nkzono99/runops/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-5b6670" alt="License"></a>
|
|
42
42
|
</p>
|
|
43
43
|
|
|
44
|
-
runops は
|
|
44
|
+
runops は Slurm や PBS Professional を使う HPC のシミュレーションを run directory 単位で記録し、AI エージェントが
|
|
45
45
|
case の準備から投入、確認、整理までを進めるためのツールです。人が打つコマンドは
|
|
46
46
|
`runo init` だけです。
|
|
47
47
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<a href="https://github.com/Nkzono99/runops/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-5b6670" alt="License"></a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
-
runops は
|
|
13
|
+
runops は Slurm や PBS Professional を使う HPC のシミュレーションを run directory 単位で記録し、AI エージェントが
|
|
14
14
|
case の準備から投入、確認、整理までを進めるためのツールです。人が打つコマンドは
|
|
15
15
|
`runo init` だけです。
|
|
16
16
|
|
|
@@ -187,6 +187,10 @@ stdout = "stdout.%J.log"
|
|
|
187
187
|
stderr = "stderr.%J.log"
|
|
188
188
|
extra_sbatch = []
|
|
189
189
|
setup_commands = []
|
|
190
|
+
# scheduler = "slurm" # "slurm" | "pbs"
|
|
191
|
+
# purge_modules = false
|
|
192
|
+
# pbs_group = ""
|
|
193
|
+
# extra_pbs = []
|
|
190
194
|
|
|
191
195
|
[site.env]
|
|
192
196
|
OMP_PROC_BIND = "spread"
|
|
@@ -228,6 +232,11 @@ label_max_length = 48 # run 名の自動ラベルの最大文字数
|
|
|
228
232
|
branch 違いを並べる用途)。case の `simulator` はこの name を指す。
|
|
229
233
|
- `[site]`、`[launchers.*]`、`[simulators.*].modules` の merge 順は v1 と同じ:
|
|
230
234
|
site modules → launcher modules → simulator modules。
|
|
235
|
+
- `scheduler` の既定は `slurm`。`runo init --site grand` は PBS Professional の設定
|
|
236
|
+
(`scheduler = "pbs"`、`resource_style = "standard"`、`purge_modules = true`、既定 launcher
|
|
237
|
+
は `mpiexec`)を作る。GRAND のログインノードでは自動検出する。
|
|
238
|
+
- `purge_modules = true` なら、module を読み込む直前に `module purge` を実行する。
|
|
239
|
+
`pbs_group` は PBS の既定 group。`extra_pbs` の各行は `#PBS` directive として追加する。
|
|
231
240
|
- 未知の key は **warning を出して無視** する(fail しない)。
|
|
232
241
|
- `[defaults]` の日数と文字数は正の数でなければ設定エラー(exit code 2)。project ごとの運用方針
|
|
233
242
|
(整理の目安、表示期間、命名の長さ)はここに置き、コードに埋め込まない。
|
|
@@ -286,6 +295,12 @@ ntasks = 800
|
|
|
286
295
|
`nodes`、`ntasks`、`processes`、`threads`、`cores`、`extra_sbatch`、`pre_commands`。
|
|
287
296
|
`resource_style = "rsc"` のとき `processes/threads/cores` を `--rsc` に、
|
|
288
297
|
`standard` のとき `nodes/ntasks` を `#SBATCH` に写す。
|
|
298
|
+
- PBS では `partition` は queue、`group` は site の `pbs_group` を上書きする。
|
|
299
|
+
`nodes` と `sockets`(既定は各 1)、node あたりの `mpiprocs` と rank あたりの
|
|
300
|
+
`ompthreads` を `select` に写す。`ntasks`(または `processes`)は総 rank 数で、
|
|
301
|
+
`nodes * mpiprocs` と一致する。`cpus_per_task`(または `threads`)も
|
|
302
|
+
`ompthreads` の指定に使える。`gpus` を指定した場合は node あたりの `ngpus` を割り当てる。
|
|
303
|
+
`memory` は node あたり、`extra_pbs` は追加 directive、`qos` は Slurm 専用。
|
|
289
304
|
- `cases/<name>/` 直下の base 入力ファイル(adapter の `case_template()` が返す
|
|
290
305
|
ファイル)と `input/` 配下は、run 作成時に run の `input/` にコピーされ、その後
|
|
291
306
|
adapter の `render_inputs()` が `[params]` を適用して上書きする。それ以外の(`.` で始まらない)
|
|
@@ -317,13 +332,16 @@ ntasks = 800
|
|
|
317
332
|
input/ # 凍結済み入力。作成後は変更しない
|
|
318
333
|
submit/
|
|
319
334
|
job.sh
|
|
320
|
-
sbatch.log
|
|
335
|
+
sbatch.log / qsub.log # 投入時の stdout/stderr(追記)
|
|
321
336
|
exit.<job_id> # job.sh が終了時に書く exit code、開始・終了時刻、stage(TOML)
|
|
322
|
-
work/ # simulator
|
|
337
|
+
work/ # simulator の出力と scheduler のログ
|
|
323
338
|
analysis/ # run に依存する解析(§9.1)
|
|
324
339
|
```
|
|
325
340
|
|
|
326
341
|
v1 の `status/` directory は廃止する。状態は manifest のみが持つ。
|
|
342
|
+
PBS の `qsub` は run の `work/` から実行し、job script は run の root に移動する。
|
|
343
|
+
PBS の既定ログ名は `work/stdout.<job_id>.log` と `work/stderr.<job_id>.log`。
|
|
344
|
+
`site.stdout` / `site.stderr` を設定した stream には PBS の `-o` / `-e` を使う。
|
|
327
345
|
|
|
328
346
|
### 6.2 manifest.toml
|
|
329
347
|
|
|
@@ -371,7 +389,7 @@ git_dirty = false
|
|
|
371
389
|
name = "srun"
|
|
372
390
|
|
|
373
391
|
[job]
|
|
374
|
-
scheduler = "slurm"
|
|
392
|
+
scheduler = "slurm" # "slurm" | "pbs"
|
|
375
393
|
job_id = "12345" # 最新 attempt の job id
|
|
376
394
|
partition = "gr20001a"
|
|
377
395
|
nodes = 1
|
|
@@ -421,6 +439,8 @@ text = "初期 sheath が形成されるまで 2e4 step かかった"
|
|
|
421
439
|
|
|
422
440
|
規則:
|
|
423
441
|
|
|
442
|
+
- `[job].scheduler` は `slurm` または `pbs`。PBS は `last_pbs_state` と attempt の
|
|
443
|
+
`pbs_state` に PBS の状態を保持する。各 attempt に投入先 scheduler を記録する。
|
|
424
444
|
- `manifest.toml` は runops だけが書く。ユーザーと agent は直接編集しない
|
|
425
445
|
(`notes.md` は自由に編集してよい)。
|
|
426
446
|
- v1 の `[intent]`、`[curation]`、`[storage].tier/form/retention_class`、
|
|
@@ -455,6 +475,9 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
455
475
|
scheduler への問い合わせ回数は run 数に依存しない。
|
|
456
476
|
runops が対応づけていない Slurm 状態の job は状態を変えずに `last_slurm_state` だけ残し、
|
|
457
477
|
他の run の更新は続ける。
|
|
478
|
+
- PBS は対象 job を `qstat -xf` でまとめて問い合わせる。終了コードと取消状態を
|
|
479
|
+
判定し、終了コード 0 の job は adapter の成否判定を適用する。履歴に無い job は
|
|
480
|
+
exit record または出力から判定する。`cancel` には `qdel` を使う。
|
|
458
481
|
- job.sh は program 終了時に `submit/exit.<job_id>`(`exit_code`、`started_at`、`finished_at`、
|
|
459
482
|
`hostname`、`stage = "run"`)を書く。program より前の準備(`module load`、`export`、`cd`、venv、
|
|
460
483
|
`setup_commands`、`pre_commands`、adapter の `job_prelude`)は `set -e` で実行し、失敗したら
|
|
@@ -467,7 +490,7 @@ created ──submit──▶ submitted ──(slurm)──▶ running ──▶
|
|
|
467
490
|
- `new --from RUN` は case の base 入力ファイルが source の作成時(`[origin].case_input_hash`)から
|
|
468
491
|
変わっていれば warning を出す(拒否しない)。
|
|
469
492
|
- `submit`、`cancel`、`retry`、`sync` は `.runops/run.lock` の中で manifest を読み直してから
|
|
470
|
-
状態を確認・更新する。同じ run を 2 回指定しても、複数の process
|
|
493
|
+
状態を確認・更新する。同じ run を 2 回指定しても、複数の process から同時に投入しても投入コマンドは 1 回。
|
|
471
494
|
- `new` / `sweep --apply` は `identity.input_hash` が既存 run と一致するとき warning を出す
|
|
472
495
|
(同じ executable なら「結果は同一のはず」、違えば「executable が違う」)。作成は拒否しない。
|
|
473
496
|
- `purged` state は廃止。`work/` の削除は `[storage].work_purged_at` で表す。
|
|
@@ -541,8 +564,8 @@ Organize(`pin`、`archive`、`mv`、`restore`、`delete`、`tidy`)、Project
|
|
|
541
564
|
|
|
542
565
|
| command | 効果 |
|
|
543
566
|
|---|---|
|
|
544
|
-
| `runo init [SIM...] [--site kudpc\|standard] [--no-install] [--no-git] [-y]` | `runops.toml`、`cases/`、`runs/`、`LOG.md`、`AGENTS.md`、`.venv` を作る。git repository の外なら `git init`(branch `main`)して、作ったものを最初の commit(`runo init`)にする(`--no-git` で行わない)。SIM ごとに adapter package を `.venv` に install し、skill を展開する(§8)。端末から引数なしで実行すると site と simulator を尋ねる。`--site` が無ければ host 名から推定する(KUDPC のログインノードなら `kudpc`) |
|
|
545
|
-
| `runo doctor [--json]` | `runops.toml` の妥当性、adapter の import 可否、`.venv` に無い package(§4)、executable
|
|
567
|
+
| `runo init [SIM...] [--site kudpc\|grand\|standard] [--no-install] [--no-git] [-y]` | `runops.toml`、`cases/`、`runs/`、`LOG.md`、`AGENTS.md`、`.venv` を作る。git repository の外なら `git init`(branch `main`)して、作ったものを最初の commit(`runo init`)にする(`--no-git` で行わない)。SIM ごとに adapter package を `.venv` に install し、skill を展開する(§8)。端末から引数なしで実行すると site と simulator を尋ねる。`--site` が無ければ host 名から推定する(KUDPC のログインノードなら `kudpc`) |
|
|
568
|
+
| `runo doctor [--json]` | `runops.toml` の妥当性、adapter の import 可否、`.venv` に無い package(§4)、executable の存在、scheduler コマンドの有無、skill の鮮度を検査 |
|
|
546
569
|
| `runo update [--skills-only] [-y]` | adapter package を upgrade し、skill を再展開する |
|
|
547
570
|
| `runo build SIM [--force]` | `local_source` simulator を `.runops/build/` に build する(§4.1) |
|
|
548
571
|
| `runo context [--json]` | agent 向け現在地。project 名、simulator、active run 数と全 active run(`--brief` と同じ summary、`active`)、直近 run 5 件、scratch 期限切れ数、`LOG.md` 末尾 20 行、現用 group の解析 topic 名(§9.1)。配置した runops skill が install 済みの runops より古ければ `runo update --skills-only` を促す warning |
|
|
@@ -551,11 +574,11 @@ Organize(`pin`、`archive`、`mv`、`restore`、`delete`、`tidy`)、Project
|
|
|
551
574
|
| `runo new CASE [--why TEXT] [--label L] [--set k=v]... [--job k=v]... [--tag T]... [--scratch] [--dest DIR] [--submit] [--created-by WHO] [--json]` | 単発 run を作る |
|
|
552
575
|
| `runo new --from RUN [--why] [--set k=v]... [--job k=v]... [--job-from-case] [--continue] [--submit]` | 既存 run の params と `[job]` から派生 run を作る(§5)。置き場所の既定は元 run と同じ directory(元 run が archive / scratch なら `runs/<case>/`)。`--continue` は adapter が `extend_inputs()` を実装する場合のみ有効(§8.1) |
|
|
553
576
|
| `runo sweep CASE --set k=v1,v2,... [--set ...] [--names KEY=n1,n2,...]... [--job k=v]... [--label L] [--dest DIR] [--why TEXT] [--apply] [--submit] [--limit N] [--json]` | 直積の候補を表示する。`--apply` で生成。`--submit` は `--apply` と同時のみ有効 |
|
|
554
|
-
| `runo submit RUN... [--partition P] [--qos Q] [--afterok JOBID \| --dependency SPEC] [--json] [-y]` | job.sh を生成して sbatch
|
|
577
|
+
| `runo submit RUN... [--partition P] [--qos Q] [--group G] [--afterok JOBID \| --dependency SPEC] [--json] [-y]` | job.sh を生成して `sbatch` または `qsub`。`created` 以外は拒否。1 run の失敗で残りを止めず、失敗があれば最後に `submitted N; not submitted M (still created): <ids>`(受理不明と、created でないため拒否した run は別に並べる)を stderr に出して exit code 1。`--json` は run ごとの `id`、`job_id`、`result`(`submitted` / `not_submitted` / `unknown`)、`status`(その後の状態)、`error` を返す。投入コマンドが 120 s で応答しないときは受理が分からないので `unknown` とし、再投入前に `squeue` または `qstat` で job 名を確かめるよう示し、投入ログに `UNKNOWN` を残す(run は created のまま)。`--group` は PBS の group 上書き。`--dependency` は Slurm(`afterany:123,afterok:456`、`?` 区切りは「いずれか」、`singleton`)または PBS(`afterok`、`afterany`、`afternotok`、`after` と PBS job id)の依存指定を受け付ける。`--afterok J` は `--dependency afterok:J` と同じで、両方の指定は exit code 2。渡した値は attempt の `dependency` に残す |
|
|
555
578
|
| `runo submit --all [DIR] [--json] [-y]` | DIR 配下の `created` run をすべて投入。件数と概算 core-hours を表示して確認。`new` / `sweep --apply` / `retry` の `--submit` も含め、失敗の扱いと要約は `submit RUN...` と同じ |
|
|
556
579
|
| `runo cancel RUN... [--why TEXT] [-y]` | scancel して sync。`--why` は `cancelled: ...` の note として残す |
|
|
557
580
|
| `runo retry RUN [--submit] [-y]` | `failed`/`cancelled` を `created` に戻す。直近の cancel に `--why` があれば理由を示して確認を取る |
|
|
558
|
-
| `runo status [RUN...] [--brief] [--json]` | manifest
|
|
581
|
+
| `runo status [RUN...] [--brief] [--json]` | manifest の状態を表示。`--brief` は §7.1 |
|
|
559
582
|
| `runo sync [RUN...] [--json]` | squeue/sacct で状態を更新。引数なしは `submitted`/`running` 全件 |
|
|
560
583
|
| `runo log RUN [--err] [-n N] [-f]` | 最新 job の stdout/stderr を表示。`-f` は tail -f |
|
|
561
584
|
| `runo list [PATH] [--all] [--since 30d] [--case C] [--sweep L] [--status S]... [--tag T]... [--scratch] [--archived] [--brief] [--json]` | run 一覧(§7.4) |
|
|
@@ -934,6 +957,7 @@ src/runops/
|
|
|
934
957
|
launchers.py # srun / mpirun / mpiexec / none
|
|
935
958
|
jobgen.py
|
|
936
959
|
slurm.py # sbatch / scancel / squeue / sacct(runner 注入)
|
|
960
|
+
pbs.py # qsub / qdel / qstat(runner 注入)
|
|
937
961
|
harness.py # AGENTS.md / CLAUDE.md 生成
|
|
938
962
|
skills/ # runops 自身の 4 skill(package data)
|
|
939
963
|
```
|
|
@@ -968,7 +992,7 @@ src/runops/
|
|
|
968
992
|
| ユーザーが編集する TOML | `runops.toml`、`case.toml` の 2 種 |
|
|
969
993
|
| runops が書く TOML | `manifest.toml`、`.runops/skills.lock`、`.runops/index.toml` の 3 種 |
|
|
970
994
|
| 依存 | `typer`、`rich`、`tomli-w`、`tomlkit`、`jinja2`、`packaging`(`mcp` を外す) |
|
|
971
|
-
| テスト実行時間 | 60 秒以内(
|
|
995
|
+
| テスト実行時間 | 60 秒以内(scheduler は全て mock) |
|
|
972
996
|
|
|
973
997
|
### 13.2 受け入れ基準
|
|
974
998
|
|
|
@@ -976,6 +1000,7 @@ src/runops/
|
|
|
976
1000
|
|
|
977
1001
|
1. `runo init generic -y` した project で `case new` → `new --why x` → `submit`(mock sbatch)→
|
|
978
1002
|
`sync`(mock squeue が COMPLETED)→ `list` が 1 件表示し `status = completed` になる。
|
|
1003
|
+
PBS でも `qsub`・`qstat -xf`・`qdel` を mock し、依存指定、状態同期、adapter の失敗判定を確認する。
|
|
979
1004
|
2. `new --scratch` した run は `list` 既定で表示されず、`expires_at` を過ぎると
|
|
980
1005
|
`tidy` が `expired-scratch` として挙げ、`tidy --apply` で消える。`pinned = true` なら消えない。
|
|
981
1006
|
3. run directory を `runs/` 配下の別の場所に `mv` しても `runo status RUN_ID` が見つける。
|
|
@@ -1040,6 +1065,7 @@ v2 の文書は次の 4 ファイルだけにする。
|
|
|
1040
1065
|
| `.venv` の entry point 探索 | `site.addsitedir` で `.pth` も処理し、探索前に `importlib.invalidate_caches()` | editable install と、mtime が秒単位の Lustre 上での再インストール直後に対応 |
|
|
1041
1066
|
| migrate の可逆性 | 削除せず `.runops/v1-backup/<stamp>/` と `manifest.v1.toml` に退避 | 実 project の v1 資料を失わない |
|
|
1042
1067
|
| 依頼と操作範囲、観察方針 | AGENTS.md block と `runops-check-status` に記載 | runhand の work policy から取り込み |
|
|
1068
|
+
| GRAND / PBS Professional | `[site].scheduler` で選択し、既存の投入・同期・取消 command を使う | 0.11 の GRAND 実機検証を v2 の run 台帳と package adapter で再現するため |
|
|
1043
1069
|
| scheduler 問い合わせの一括化 | `sync` / `tidy` は `squeue --jobs=` と `sacct --jobs=` を各 1 回 | run ごとの問い合わせは active run 数に比例して scheduler を叩く。agent は sync を繰り返すので回数を run 数から切り離す |
|
|
1044
1070
|
| job 側の完了証拠 | job.sh が `submit/exit.<job_id>` を書き、`sync` は sacct より先にこれを見る | sacct の保持期間や会計の欠落で completed run が `failed` に倒れていた(row の products、Sumatra の status tag に相当) |
|
|
1045
1071
|
| submit 時の executable hash | attempt ごとに `exe_hash` を記録し、作成時と違えば warning | `runo update` 後の retry が作成時の hash のまま別 binary で走っていた |
|
|
@@ -31,6 +31,18 @@ runo init
|
|
|
31
31
|
> MPIEMSES3D で平板シースを計算したい。cookbook の例を元に case を作って。
|
|
32
32
|
> gr20001a に 800 並列、120 時間で。
|
|
33
33
|
|
|
34
|
+
## GRAND で投入する
|
|
35
|
+
|
|
36
|
+
`runo init --site grand` で PBS Professional 用の project を作れます。GRAND の
|
|
37
|
+
ログインノードでは `--site` を省略しても検出します。MPI の solver は既定の
|
|
38
|
+
`mpiexec` を使い、直列の solver は `[launchers.serial]` に `kind = "none"` を
|
|
39
|
+
設定して case の `launcher = "serial"` で選べます。
|
|
40
|
+
|
|
41
|
+
`[job].partition` に queue、`[job].group` または `[site].pbs_group` に課金 group を
|
|
42
|
+
設定します。コンパイラと MPI の module は solver に合わせ、`runo doctor` で
|
|
43
|
+
adapter、実行ファイル、PBS コマンドを確認します。`runo submit`、`runo sync`、
|
|
44
|
+
`runo cancel` はそれぞれ `qsub`、`qstat -xf`、`qdel` を使います。
|
|
45
|
+
|
|
34
46
|
## 2. case と run の分け方
|
|
35
47
|
|
|
36
48
|
runops が扱う名詞は case、run、sweep の 3 つです。
|
|
@@ -134,13 +146,13 @@ walltime は、同じ case・同じ資源で終わった run の実時間を元
|
|
|
134
146
|
|
|
135
147
|
| コマンド | 内容 |
|
|
136
148
|
|---|---|
|
|
137
|
-
| `runo sync` | 投入済み・実行中の run の状態を
|
|
149
|
+
| `runo sync` | 投入済み・実行中の run の状態を scheduler から更新する |
|
|
138
150
|
| `runo list` | 実行中、作成済み、直近 30 日、pin した run を表示する |
|
|
139
|
-
| `runo status RUN` | 1 つの run
|
|
151
|
+
| `runo status RUN` | 1 つの run の状態(台帳から表示) |
|
|
140
152
|
| `runo log RUN --err` | 最新 job の stderr の末尾 |
|
|
141
153
|
|
|
142
|
-
`runo sync`
|
|
143
|
-
|
|
154
|
+
`runo sync` は対象をまとめて問い合わせます。Slurm は `squeue` と `sacct` を最大 1 回ずつ、
|
|
155
|
+
PBS は `qstat -xf` を 1 回呼びます。
|
|
144
156
|
|
|
145
157
|
adapter が進捗に対応していれば(BEACH の batch、MPIEMSES3D の step)、`sync` のたびに時刻付きの
|
|
146
158
|
観測を残し、`runo list` / `status` に `62% 0.198 s/batch eta 3.1h` のように進み具合、直近 10 分の
|
|
@@ -159,9 +171,9 @@ adapter が進捗に対応していれば(BEACH の batch、MPIEMSES3D の ste
|
|
|
159
171
|
run の状態は `created → submitted → running → completed | failed | cancelled` と進みます。
|
|
160
172
|
`sync` は次の順で終わった run の状態を決めます。
|
|
161
173
|
|
|
162
|
-
1.
|
|
174
|
+
1. scheduler が状態を返す job はその状態に従う。正常終了でも、adapter が出力を見て
|
|
163
175
|
失敗と判断すれば `failed` にする。
|
|
164
|
-
2.
|
|
176
|
+
2. scheduler の記録から消えた job は、job.sh が終了時に書く `submit/exit.<job_id>` を見る。
|
|
165
177
|
exit code が 0 なら adapter の判定、0 以外なら `failed`。`module load` や `pre_commands` などの
|
|
166
178
|
準備が失敗した job は program を起動せずに終わり、`failed` になる。
|
|
167
179
|
3. その記録も無ければ adapter の判定に従い、判定できなければ `failed`。
|
|
@@ -67,6 +67,13 @@ module は site、launcher、simulator、case の順に結合されます。`gen
|
|
|
67
67
|
`command`(`{executable}` を置換)と `success_marker`(`work/` 内の完了 marker)も使えます。
|
|
68
68
|
未知の key は warning を出して無視します。
|
|
69
69
|
|
|
70
|
+
GRAND の設定は `runo init --site grand` で生成できます。`[site].scheduler` は
|
|
71
|
+
`slurm`(既定)または `pbs`。GRAND は `pbs`、`resource_style = "standard"`、既定 launcher
|
|
72
|
+
`mpiexec`、`purge_modules = true` です。読み込む module は simulator ごとに指定できます。
|
|
73
|
+
`[site].pbs_group` は既定の PBS group、`extra_pbs` は追加 directive です。
|
|
74
|
+
PBS の既定ログは `work/stdout.<job_id>.log` と `work/stderr.<job_id>.log` です。
|
|
75
|
+
`stdout` または `stderr` を設定すると、その値を PBS の `-o` または `-e` に渡します。
|
|
76
|
+
|
|
70
77
|
## case.toml
|
|
71
78
|
|
|
72
79
|
`cases/<name>/case.toml` と、同じ directory の base 入力ファイルで case になります。
|
|
@@ -101,6 +108,13 @@ ntasks = 800
|
|
|
101
108
|
dotted key は `a.b`、配列要素は `species.0.wp` または `species[0].wp` です。
|
|
102
109
|
値の違いは case を増やさず、`runo new --set` や `runo sweep` で run として表します。
|
|
103
110
|
|
|
111
|
+
PBS では `partition` が queue、`group` が `group_list` です。`nodes`、`sockets`、
|
|
112
|
+
`mpiprocs`(node あたり)、`ompthreads`(rank あたり)を `#PBS -l select` に使います。
|
|
113
|
+
`ntasks` または `processes` は総 rank 数で、指定時は `nodes * mpiprocs` と一致させます。
|
|
114
|
+
`cpus_per_task` または `threads` でも rank あたりの thread 数を指定できます。
|
|
115
|
+
`gpus` は node あたりの GPU 数で、`sockets` と併用できません。`memory` は node あたりです。
|
|
116
|
+
PBS の追加 directive は `extra_pbs` に入れます。`--group` は投入時に group を上書きできます。
|
|
117
|
+
|
|
104
118
|
## manifest.toml
|
|
105
119
|
|
|
106
120
|
runops だけが書きます。手で編集しないでください。主な field は次の通りです。
|
|
@@ -111,7 +125,7 @@ runops だけが書きます。手で編集しないでください。主な fie
|
|
|
111
125
|
| `[path]` | `run_dir`(project 相対)、`archived_from`、`archived_at` |
|
|
112
126
|
| `[origin]` | `case`、`sweep`、`parent_run`、`created_by`、`case_input_hash` |
|
|
113
127
|
| `[simulator]` | `name`、`adapter`、`adapter_source`、`adapter_version`、`executable`、`resolver_mode`、`package_version`、`exe_hash`、`git_commit`、`git_dirty`、`build_dir` |
|
|
114
|
-
| `[job]` | case の `[job]` に加え `job_id`、`attempt`、`submitted_at`、`finished_at`、`last_slurm_state`、`exit_code
|
|
128
|
+
| `[job]` | case の `[job]` に加え `scheduler`、`job_id`、`attempt`、`submitted_at`、`finished_at`、`last_slurm_state` または `last_pbs_state`、`exit_code`、待機中の理由 `pending_reason`、`[[job.attempts]]`(attempt ごとの `scheduler`、`slurm_state` または `pbs_state`、`job_id`、`started_at`、`exit_code`、`exe_hash`、`elapsed`、`cancel --why` の `cancel_reason`、投入時の依存指定 `dependency`、`runo sync` が付ける `progress`(§進捗)) |
|
|
115
129
|
| `[params]` | case の params に `--set` を適用した最終値 |
|
|
116
130
|
| `[variation]` | `changed_keys`、`job_changed_keys`(case の `[job]` と違う key) |
|
|
117
131
|
| `[identity]` | `input_hash` |
|
|
@@ -125,8 +139,8 @@ runops だけが書きます。手で編集しないでください。主な fie
|
|
|
125
139
|
決まります。`module load`、`cd`、`setup_commands`、`pre_commands` などの準備が失敗すると、job.sh は
|
|
126
140
|
program を起動せずに終わり、`stage = "setup"` と exit code を記録します。
|
|
127
141
|
`sync` と `tidy` は対象 run の job id をまとめて 1 回の `squeue` と `sacct` で
|
|
128
|
-
問い合わせます。
|
|
129
|
-
|
|
142
|
+
問い合わせます。PBS job は `qstat -xf` でまとめて問い合わせます。既知の状態に対応しない job
|
|
143
|
+
は状態を維持し、`last_slurm_state` または `last_pbs_state` に scheduler の応答を記録します。
|
|
130
144
|
|
|
131
145
|
`submit` は executable を hash し直して attempt に記録し、作成時と違えば警告します。
|
|
132
146
|
`new` と `sweep --apply` は同じ入力(`input_hash`)の run が既にあれば警告します。
|
|
@@ -137,17 +151,18 @@ program を起動せずに終わり、`stage = "setup"` と exit code を記録
|
|
|
137
151
|
|
|
138
152
|
一括投入で一部の run が受理されなかったときは、`submitted 2; not submitted 1 (still created): R…` の
|
|
139
153
|
要約が出ます。created のままの run だけを `runo submit` し直せば足ります(受理済みの run は created でないので
|
|
140
|
-
|
|
141
|
-
|
|
154
|
+
拒否されます)。投入コマンドが 120 秒応答しなかった run は `unknown`(受理不明)です。
|
|
155
|
+
再投入の前に `squeue` または `qstat` で job 名(既定は run id)を確かめます。
|
|
142
156
|
|
|
143
157
|
`submit`、`cancel`、`retry`、`sync` は lock の中で manifest を読み直してから更新します。
|
|
144
|
-
同じ run を 2
|
|
158
|
+
同じ run を 2 回指定しても、複数のエージェントが同時に投入しても投入コマンドは 1 回です。
|
|
145
159
|
run id は削除後も再利用しません。`--dest` に既存 run の中は指定できません。
|
|
146
160
|
|
|
147
161
|
## command
|
|
148
162
|
|
|
149
163
|
`list --json` と `status --json` は、walltime の根拠として `walltime`、最新 attempt の `elapsed`、
|
|
150
|
-
`walltime_used`(elapsed / walltime
|
|
164
|
+
`walltime_used`(elapsed / walltime)、scheduler の状態も返します。Slurm では `slurm_state`、
|
|
165
|
+
PBS では `pbs_state` に状態が入ります。adapter が `progress()` を持てば
|
|
151
166
|
`progress`(`done`、`total`、`unit`、`fraction`、`rate_recent_per_hour`、`rate_attempt_per_hour`、
|
|
152
167
|
`eta_hours`、`last_change_at`、`stalled_hours`、再開した run では今回の区間の割合 `attempt_fraction`)も返し、
|
|
153
168
|
表の `progress` 列に `62% 0.198 s/batch eta 3.1h` と出します。再開した run は `74% (38% of this job)` のように
|
|
@@ -171,9 +186,9 @@ run id は削除後も再利用しません。`--dest` に既存 run の中は
|
|
|
171
186
|
| `runo new CASE [--why] [--label] [--set k=v]... [--job k=v]... [--tag] [--scratch] [--dest DIR] [--submit] [--json]` | run を 1 つ作る。`--job` はこの run の `[job]` の値 |
|
|
172
187
|
| `runo new --from RUN [--set k=v]... [--job k=v]... [--job-from-case] [--continue]` | 既存 run の params と `[job]` から派生(`--job-from-case` で `[job]` は case から)。置き場所の既定は元 run と同じ directory。`--continue` は adapter の restart 対応が必要 |
|
|
173
188
|
| `runo sweep CASE --set k=v1,v2 ... [--names k=n1,n2...] [--job k=v]... [--label] [--dest DIR] [--limit N] [--apply] [--submit] [--json]` | 直積の候補表示。`--apply` で作成。`--names` は各値の短い label、`--dest` は sweep directory の親 |
|
|
174
|
-
| `runo submit RUN... [-p P] [--qos Q] [--afterok JOB \| --dependency SPEC] [--json]` / `runo submit --all [DIR] [-y]` | job.sh を生成して sbatch
|
|
189
|
+
| `runo submit RUN... [-p P] [--qos Q] [--group G] [--afterok JOB \| --dependency SPEC] [--json]` / `runo submit --all [DIR] [-y]` | job.sh を生成して `sbatch` または `qsub`。PBS の `--dependency` は `afterok:123.sjms` のような完全な job id を受け付ける。`--dependency` は `afterany:123,afterok:456` のような Slurm の依存指定(種類名と job id だけ。`?` 区切りは「いずれか」、`singleton` も可)。`--afterok J` は `--dependency afterok:J` の略で、両方は指定できない。依存は attempt の `dependency` に残る。1 run が失敗しても残りを投入し、最後に未投入の run を要約して exit code 1(`new` / `sweep` / `retry` の `--submit` も同じ)。`--json` は run ごとの `id`、`job_id`、`result`(`submitted` / `not_submitted` / `unknown`)、`status`、`error` |
|
|
175
190
|
| `runo cancel RUN... [--why TEXT] [-y]` / `runo retry RUN [--submit] [-y]` | scancel(`--why` は note に残る)/ failed・cancelled を created に戻す(理由付きで cancel された run は確認を取る) |
|
|
176
|
-
| `runo status [RUN...] [--brief]` / `runo sync [RUN...]` / `runo log RUN [--err] [-n N] [-f]` | 状態表示 /
|
|
191
|
+
| `runo status [RUN...] [--brief]` / `runo sync [RUN...]` / `runo log RUN [--err] [-n N] [-f]` | 状態表示 / scheduler から更新 / log 表示 |
|
|
177
192
|
| `runo list [PATH] [--all] [--since 30d] [--case] [--sweep] [--status] [--tag] [--scratch] [--archived] [--brief] [--json]` | run 一覧。`--brief` は `params`、`why`、note を省く(表では note / why 列) |
|
|
178
193
|
| `runo note RUN [TEXT]` / `runo pin RUN [--off] [--reason]` | ノート追記・表示 / pin |
|
|
179
194
|
| `runo mv RUN... [--dest DIR] [--label L] [--why TEXT]` | `runs/` 配下で改名・移動。id、入力、sweep、ノートは保つ。submitted / running と archived は不可。全対象を検査してから移し、1 件でも不可なら何も動かさない |
|
|
@@ -185,7 +200,7 @@ project の保守(設定、package、build):
|
|
|
185
200
|
|
|
186
201
|
| command | 動作 |
|
|
187
202
|
|---|---|
|
|
188
|
-
| `runo init [SIM...] [--site kudpc\|standard] [--no-install] [--no-git] [-y]` | project を作る。git repository の外なら `git init` して最初の commit を作る(`--no-git` で行わない)。`SIM` は `emses` や `name=package-spec`。端末から引数なしで実行すると site と simulator を尋ねる。`--site` の既定はホスト名から推定(KUDPC
|
|
203
|
+
| `runo init [SIM...] [--site kudpc\|grand\|standard] [--no-install] [--no-git] [-y]` | project を作る。git repository の外なら `git init` して最初の commit を作る(`--no-git` で行わない)。`SIM` は `emses` や `name=package-spec`。端末から引数なしで実行すると site と simulator を尋ねる。`--site` の既定はホスト名から推定(KUDPC は `kudpc`、GRAND は `grand`) |
|
|
189
204
|
| `runo doctor [--json]` | 設定、adapter の解決経路、`.venv` に無い package、executable、sbatch、skill の鮮度とリンク切れを点検 |
|
|
190
205
|
| `runo update [--skills-only] [-y]` | simulator package を更新し skill と AGENTS.md の管理 block を再生成。`package` を指定した simulator でも、adapter の `pip_packages()` にある他の package(emses の emout など)が `.venv` に無ければ入れる |
|
|
191
206
|
| `runo build SIM [--force]` | `local_source` の simulator を build |
|
|
@@ -204,7 +219,7 @@ archived と scratch は表示しません。ただし submitted / running の s
|
|
|
204
219
|
| `expired-scratch` | 期限切れの scratch run(archived は除く) | delete |
|
|
205
220
|
| `stale-failed` | `tidy_failed_days`(既定 30)日より古い failed / cancelled で、why も note も無い | delete |
|
|
206
221
|
| `old-completed` | `tidy_archive_days`(既定 90)日より古い completed | archive |
|
|
207
|
-
| `orphan-job` |
|
|
222
|
+
| `orphan-job` | scheduler の履歴に無い submitted / running | sync |
|
|
208
223
|
| `unused-build` | 非 archived run と pinned run(archived を含む)が参照せず、simulator の現在の build でもない `.runops/build/*`。理由に参照する archived run の数を示す | delete |
|
|
209
224
|
| `analysis-logs` | `tidy_failed_days` より古い解析 log。各 log directory・job 名の最新組は保持 | log のみ delete |
|
|
210
225
|
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "runops"
|
|
7
|
-
version = "2.
|
|
8
|
-
description = "Run ledger and
|
|
7
|
+
version = "2.11.0"
|
|
8
|
+
description = "Run ledger and job submission for HPC simulation projects"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
11
11
|
requires-python = ">=3.10"
|
|
12
|
-
keywords = ["hpc", "slurm", "simulation", "ai-agent", "workflow"]
|
|
12
|
+
keywords = ["hpc", "slurm", "pbs", "simulation", "ai-agent", "workflow"]
|
|
13
13
|
classifiers = [
|
|
14
14
|
"Development Status :: 4 - Beta",
|
|
15
15
|
"Environment :: Console",
|
|
@@ -16,7 +16,7 @@ from rich.markup import escape
|
|
|
16
16
|
from rich.table import Table
|
|
17
17
|
from typer.core import TyperGroup
|
|
18
18
|
|
|
19
|
-
from runops import __version__
|
|
19
|
+
from runops import __version__
|
|
20
20
|
from runops.errors import RunopsError, UsageError
|
|
21
21
|
from runops.manifest import Manifest, RunState
|
|
22
22
|
from runops.project import Project
|
|
@@ -48,7 +48,7 @@ app = typer.Typer(
|
|
|
48
48
|
cls=_PanelOrder,
|
|
49
49
|
add_completion=False,
|
|
50
50
|
no_args_is_help=True,
|
|
51
|
-
help="runops: run ledger and
|
|
51
|
+
help="runops: run ledger and job submission for simulation projects.",
|
|
52
52
|
pretty_exceptions_enable=False,
|
|
53
53
|
)
|
|
54
54
|
case_app = typer.Typer(no_args_is_help=True, help="Manage cases (input templates).")
|
|
@@ -71,17 +71,13 @@ def _root(
|
|
|
71
71
|
help="Print the version.",
|
|
72
72
|
),
|
|
73
73
|
) -> None:
|
|
74
|
-
"""runops: run ledger and
|
|
74
|
+
"""runops: run ledger and job submission for simulation projects."""
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
out = Console(highlight=False, soft_wrap=True)
|
|
78
78
|
err = Console(stderr=True, highlight=False, soft_wrap=True)
|
|
79
79
|
|
|
80
80
|
|
|
81
|
-
def _runner() -> slurm.CommandRunner:
|
|
82
|
-
return slurm.default_runner
|
|
83
|
-
|
|
84
|
-
|
|
85
81
|
def _actor() -> str:
|
|
86
82
|
if os.environ.get("RUNOPS_ACTOR"):
|
|
87
83
|
return os.environ["RUNOPS_ACTOR"]
|
|
@@ -172,7 +168,9 @@ def init(
|
|
|
172
168
|
None, help="Simulators: NAME or NAME=package-spec (e.g. emses, beach, generic)."
|
|
173
169
|
),
|
|
174
170
|
site: str = typer.Option(
|
|
175
|
-
"",
|
|
171
|
+
"",
|
|
172
|
+
"--site",
|
|
173
|
+
help="Site preset: kudpc | grand | standard (default: guessed from the host name).",
|
|
176
174
|
),
|
|
177
175
|
name: str = typer.Option("", "--name", help="Project name (default: directory name)."),
|
|
178
176
|
no_install: bool = typer.Option(
|
|
@@ -243,7 +241,7 @@ def _prompt_site(guessed: str, host: str) -> str:
|
|
|
243
241
|
|
|
244
242
|
@app.command(rich_help_panel=MAINTAIN)
|
|
245
243
|
def doctor(as_json: bool = typer.Option(False, "--json")) -> None:
|
|
246
|
-
"""Check configuration, adapters, executables,
|
|
244
|
+
"""Check configuration, adapters, executables, scheduler tools and skills."""
|
|
247
245
|
from runops.ops.setup import doctor as run_doctor
|
|
248
246
|
|
|
249
247
|
checks = run_doctor(_project())
|
|
@@ -420,11 +418,9 @@ def _submit_each(
|
|
|
420
418
|
out.print(f"submitted {r.id} as job {r.job_id}")
|
|
421
419
|
|
|
422
420
|
warnings: list[str] = []
|
|
423
|
-
results = submit_runs(
|
|
424
|
-
project, manifests, options, runner=_runner(), warnings=warnings, on_result=show
|
|
425
|
-
)
|
|
421
|
+
results = submit_runs(project, manifests, options, warnings=warnings, on_result=show)
|
|
426
422
|
_warn(warnings)
|
|
427
|
-
summary = _submit_summary(results)
|
|
423
|
+
summary = _submit_summary(results, project.config.site.scheduler)
|
|
428
424
|
if summary:
|
|
429
425
|
err.print(summary, markup=False)
|
|
430
426
|
return results
|
|
@@ -434,7 +430,7 @@ def _all_submitted(results: list[SubmitResult]) -> bool:
|
|
|
434
430
|
return all(r.result == "submitted" for r in results)
|
|
435
431
|
|
|
436
432
|
|
|
437
|
-
def _submit_summary(results: list[SubmitResult]) -> str:
|
|
433
|
+
def _submit_summary(results: list[SubmitResult], scheduler: str) -> str:
|
|
438
434
|
"""``submitted 2; not submitted 1 (still created): R...`` when a run did not go."""
|
|
439
435
|
left = [r for r in results if r.result == "not_submitted" and r.status == "created"]
|
|
440
436
|
unknown = [r for r in results if r.result == "unknown"]
|
|
@@ -446,8 +442,9 @@ def _submit_summary(results: list[SubmitResult]) -> str:
|
|
|
446
442
|
parts.append(f"not submitted {len(left)} (still created): {', '.join(r.id for r in left)}")
|
|
447
443
|
if unknown:
|
|
448
444
|
parts.append(
|
|
449
|
-
f"acceptance unknown {len(unknown)}
|
|
450
|
-
|
|
445
|
+
f"acceptance unknown {len(unknown)} "
|
|
446
|
+
f"(check {'qstat' if scheduler == 'pbs' else 'squeue'} "
|
|
447
|
+
"before resubmitting): " + ", ".join(r.id for r in unknown)
|
|
451
448
|
)
|
|
452
449
|
if refused:
|
|
453
450
|
parts.append(
|
|
@@ -636,22 +633,23 @@ def submit_cmd(
|
|
|
636
633
|
),
|
|
637
634
|
partition: str = typer.Option("", "--partition", "-p"),
|
|
638
635
|
qos: str = typer.Option("", "--qos"),
|
|
636
|
+
group: str = typer.Option("", "--group", help="Override the PBS group_list."),
|
|
639
637
|
afterok: str = typer.Option("", "--afterok", help="Start after this job id succeeds."),
|
|
640
638
|
dependency: str = typer.Option(
|
|
641
639
|
"",
|
|
642
640
|
"--dependency",
|
|
643
|
-
help="
|
|
641
|
+
help="Scheduler dependency, e.g. afterok:123 (recorded on the attempt).",
|
|
644
642
|
),
|
|
645
643
|
yes: bool = typer.Option(False, "-y", "--yes"),
|
|
646
644
|
as_json: bool = typer.Option(
|
|
647
645
|
False, "--json", help="Print id, job_id, result, status and error for each run."
|
|
648
646
|
),
|
|
649
647
|
) -> None:
|
|
650
|
-
"""Generate job.sh and
|
|
648
|
+
"""Generate job.sh and submit created runs (one failure does not stop the rest)."""
|
|
651
649
|
from runops.ops.submit import SubmitOptions, dependency_spec, estimate_core_hours
|
|
652
650
|
|
|
653
|
-
depends = dependency_spec(afterok, dependency)
|
|
654
651
|
project = _project()
|
|
652
|
+
depends = dependency_spec(afterok, dependency, scheduler=project.config.site.scheduler)
|
|
655
653
|
say = err if as_json else out # with --json, stdout holds only the JSON
|
|
656
654
|
if all_runs:
|
|
657
655
|
if runs and len(runs) > 1:
|
|
@@ -677,7 +675,7 @@ def submit_cmd(
|
|
|
677
675
|
if len(targets) > 1:
|
|
678
676
|
hours = estimate_core_hours(project, targets)
|
|
679
677
|
_confirm(f"Submit {len(targets)} runs (~{hours:.1f} core-hours)?", yes)
|
|
680
|
-
options = SubmitOptions(partition=partition, qos=qos, dependency=depends)
|
|
678
|
+
options = SubmitOptions(partition=partition, qos=qos, dependency=depends, group=group)
|
|
681
679
|
results = _submit_each(project, targets, options, quiet=as_json)
|
|
682
680
|
if as_json:
|
|
683
681
|
_print_json([r.__dict__ for r in results])
|
|
@@ -693,14 +691,14 @@ def cancel(
|
|
|
693
691
|
),
|
|
694
692
|
yes: bool = typer.Option(False, "-y", "--yes"),
|
|
695
693
|
) -> None:
|
|
696
|
-
"""
|
|
694
|
+
"""Cancel submitted/running runs."""
|
|
697
695
|
from runops.ops.submit import cancel_run
|
|
698
696
|
|
|
699
697
|
project = _project()
|
|
700
698
|
targets = _resolve(project, runs)
|
|
701
699
|
_confirm("Cancel " + ", ".join(f"{m.id} (job {m.job_id})" for m in targets) + "?", yes)
|
|
702
700
|
for m in targets:
|
|
703
|
-
cancel_run(project, m,
|
|
701
|
+
cancel_run(project, m, why=why, by=_actor())
|
|
704
702
|
out.print(f"cancelled {m.id}")
|
|
705
703
|
|
|
706
704
|
|
|
@@ -753,8 +751,9 @@ def _status_table(project: Project, manifests: list[Manifest], *, brief: bool =
|
|
|
753
751
|
"cancelled": "yellow",
|
|
754
752
|
}.get(s["status"], "")
|
|
755
753
|
status = f"[{color}]{s['status']}[/]" if color else s["status"]
|
|
756
|
-
|
|
757
|
-
|
|
754
|
+
scheduler_state = s.get("pbs_state") or s["slurm_state"]
|
|
755
|
+
if s["status"] == "failed" and scheduler_state not in ("", "FAILED", "UNKNOWN"):
|
|
756
|
+
status += f" ({scheduler_state})"
|
|
758
757
|
status += escape(_waiting(s))
|
|
759
758
|
elapsed = s["elapsed"]
|
|
760
759
|
if elapsed and s["walltime_used"] is not None:
|
|
@@ -789,7 +788,7 @@ def status(
|
|
|
789
788
|
),
|
|
790
789
|
as_json: bool = typer.Option(False, "--json"),
|
|
791
790
|
) -> None:
|
|
792
|
-
"""Show manifest state
|
|
791
|
+
"""Show manifest state. Without RUN: active runs."""
|
|
793
792
|
from runops.manifest import ACTIVE_STATES
|
|
794
793
|
|
|
795
794
|
project = _project()
|
|
@@ -821,12 +820,12 @@ def sync_cmd(
|
|
|
821
820
|
runs: Optional[list[str]] = typer.Argument(None),
|
|
822
821
|
as_json: bool = typer.Option(False, "--json"),
|
|
823
822
|
) -> None:
|
|
824
|
-
"""Update submitted/running runs from
|
|
823
|
+
"""Update submitted/running runs from the scheduler."""
|
|
825
824
|
from runops.ops.sync import sync_all
|
|
826
825
|
|
|
827
826
|
project = _project()
|
|
828
827
|
targets = _resolve(project, runs) if runs else None
|
|
829
|
-
results = sync_all(project, targets
|
|
828
|
+
results = sync_all(project, targets)
|
|
830
829
|
if as_json:
|
|
831
830
|
_print_json([r.__dict__ for r in results])
|
|
832
831
|
return
|
|
@@ -835,7 +834,7 @@ def sync_cmd(
|
|
|
835
834
|
for r in results:
|
|
836
835
|
change = f"{r.before} -> {r.after}" if r.before != r.after else r.after
|
|
837
836
|
extra = f" ({r.message})" if r.message else ""
|
|
838
|
-
out.print(f"{r.run_id} {change} {r.slurm_state}{extra}")
|
|
837
|
+
out.print(f"{r.run_id} {change} {r.pbs_state or r.slurm_state}{extra}")
|
|
839
838
|
|
|
840
839
|
|
|
841
840
|
@app.command(rich_help_panel=MONITOR)
|
|
@@ -1109,9 +1108,7 @@ def tidy(
|
|
|
1109
1108
|
if kind not in KINDS:
|
|
1110
1109
|
raise UsageError(f"unknown kind {kind!r}; known: {', '.join(KINDS)}")
|
|
1111
1110
|
override = parse_age(older_than) if older_than else None
|
|
1112
|
-
candidates = find_candidates(
|
|
1113
|
-
project, failed_after=override, archive_after=override, runner=_runner()
|
|
1114
|
-
)
|
|
1111
|
+
candidates = find_candidates(project, failed_after=override, archive_after=override)
|
|
1115
1112
|
if only:
|
|
1116
1113
|
candidates = [c for c in candidates if c.kind in only]
|
|
1117
1114
|
if as_json and not apply:
|
|
@@ -1128,7 +1125,7 @@ def tidy(
|
|
|
1128
1125
|
out.print("preview only; add --apply (optionally --only KIND) to perform")
|
|
1129
1126
|
return
|
|
1130
1127
|
_confirm(f"Apply {len(candidates)} actions?", yes)
|
|
1131
|
-
report = apply_candidates(project, candidates
|
|
1128
|
+
report = apply_candidates(project, candidates)
|
|
1132
1129
|
for item in report.applied:
|
|
1133
1130
|
out.print(f"done {item}")
|
|
1134
1131
|
for item in report.errors:
|