Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

hpc-runtime-doctor

БесплатноЗапускает вложенные скриптыНе проверен

Diagnose HPC runtime and scheduler problems for materials simulations, including MPI/OpenMP/GPU layout, modules, CUDA/Kokkos hints, scratch paths, walltime…

HeshamFSот HeshamFS★ 95 звёзд на GitHub1 установка в других каталогах

Об этом скилле

HPC Runtime Doctor

Goal

Turn cluster symptoms into a resource-layout diagnosis, environment checklist, and safe retry plan.

Requirements

  • Python 3.10+
  • No external dependencies
  • Works on Linux, macOS, and Windows

Inputs to Gather

Input Description Example
Scheduler SLURM, PBS, LSF, local slurm
Nodes/tasks/threads Runtime layout 2 nodes, 128 tasks, 2 threads
GPUs Total (whole-job) GPUs via --gpus, or per node via --gpus-per-node --gpus 4 or --gpus-per-node 1
Symptoms Observed failure oom,killed,slow-gpu
MPI/OpenMP/GPU use Parallel modes mpi+openmp+gpu
Walltime Requested time 12:00:00
Scratch Whether scratch is used true

Decision Guidance

  • Check resource layout before changing physics settings.
  • Confirm module/compiler/MPI/CUDA consistency before debugging solver behavior.
  • Treat missing restart files and scratch cleanup as workflow failures, not physics failures.
  • For GPU jobs, confirm the executable was built with the requested accelerator backend.

Script Outputs

scripts/hpc_runtime_doctor.py emits:

  • resource_layout (includes tasks_per_node, total_cpus, total gpus, and gpus_per_node)
  • diagnoses
  • environment_checks
  • retry_plan
  • scheduler_notes
  • warnings (layout flags such as ranks-per-GPU oversubscription, OpenMP/thread mismatch, and uneven task placement)

In default (non-JSON) mode the script also prints the resource-layout summary, any warnings, environment checks, and retry plan, so the most actionable items are never hidden.

Workflow

--gpus is the total (whole-job) GPU count. Use --gpus-per-node (SLURM --gres=gpu:N semantics) when you know the per-node allocation; total GPUs are then gpus_per_node * nodes and it overrides --gpus.

python3 skills/hpc-deployment/hpc-runtime-doctor/scripts/hpc_runtime_doctor.py \
  --scheduler slurm \
  --nodes 2 \
  --tasks 128 \
  --cpus-per-task 2 \
  --gpus 4 \
  --symptoms oom,slow-gpu \
  --uses-mpi \
  --uses-openmp \
  --uses-gpu \
  --json

The example above shares 128 ranks across 4 GPUs (32 ranks/GPU), so the warnings list surfaces Many MPI ranks per GPU (32.0 ranks/GPU) may reduce GPU efficiency. The ranks-per-GPU check uses total ranks over total GPUs, so it fires correctly on multi-node jobs (the threshold is 16 ranks/GPU).

Error Handling

Invalid resource counts stop with exit code 2. Unknown symptoms are preserved as custom items for human review.

Limitations

This skill does not query a live scheduler. It diagnoses from the submitted layout and symptoms.

Verification checklist

  • Recorded the script's resource_layout block and confirmed tasks_per_node is an integer (no fractional value) and total_cpus equals tasks * cpus_per_task; if tasks_per_node is fractional, the uneven-placement warning was triaged before retrying.
  • For GPU jobs, recorded the resolved total gpus (and gpus_per_node when set) and computed ranks/GPU = tasks / gpus, confirming it is at or below the 16 ranks/GPU threshold or that the resulting Many MPI ranks per GPU warning was deliberately accepted.
  • Reviewed every entry in the warnings list (OpenMP-with-cpus_per_task=1, GPU-requested-but-zero-GPUs, tasks < nodes, uneven placement, scratch-for-heavy-I/O) and resolved or justified each one rather than ignoring it.
  • Completed the environment_checks items as real artifacts: captured the module list, executable path/version, MPI launcher-vs-library match, accelerator build flags (CUDA/Kokkos/OpenMP), and scheduler stdout/stderr.
  • Mapped each observed symptom to a diagnoses entry and verified no symptom landed in the custom category unaddressed (every custom item had stderr/stdout/module list/command line collected for human review).
  • Followed the retry_plan: reran the smallest reproducing case, changed exactly one resource variable, enabled restart/checkpoint, and saved the scheduler script plus environment snapshot alongside the results.

Common pitfalls & rationalizations

Tempting shortcut Why it's wrong / what to do
"It ran without crashing, so the layout is fine." Run completion is not correctness. Review the warnings list and resource_layout -- oversubscription, uneven placement, or an idle GPU can silently slow or corrupt results without a crash.
"Per-node ranks fit the GPUs, so there's no oversubscription." Oversubscription is total ranks over total GPUs, not per-node. The script computes tasks / gpus; a multi-node job can hide a high ranks/GPU value that only the unit-consistent check exposes.
"I passed --gpus, so per-node GPU count doesn't matter." --gpus is the whole-job total. If the cluster allocates per node, use --gpus-per-node (SLURM --gres=gpu:N); it overrides --gpus and total becomes `gpus_per_n
Полный SKILL.md на GitHub

Установить hpc-runtime-doctor в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Bash
Write
Grep
Glob

Вложенные файлы

CHANGELOG.mdevals/evals.jsonreferences/hpc_runtime_patterns.mdscripts/hpc_runtime_doctor.py

FAQ

Что делает скилл hpc-runtime-doctor?

Diagnose HPC runtime and scheduler problems for materials simulations, including MPI/OpenMP/GPU layout, modules, CUDA/Kokkos hints, scratch paths, walltime, job arrays, restart strategy, scheduler portability, and resource mismatch. Use when an ALREADY-SUBMITTED job failed, ran slowly, got killed, or behaved differently on a cluster than on a workstation. To author or vet a NEW submission script before running, use slurm-job-script-generator instead.

Как установить скилл hpc-runtime-doctor?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл hpc-runtime-doctor запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить hpc-runtime-doctor с