alloc
Reserve Slurm resources and open a persistent compute-node shell in tmux, auto-selecting GPU or CPU and keeping the session alive after disconnect.
Instructions
抢占资源并直接执行(绝不只返回命令):tmux 内 salloc + srun bash, 分配后 attach 即入计算节点 shell,断线不丢资源。
抢占选择自动完成(无需先查询):resource 缺省 = GPU 优先、无空闲 GPU 回退 CPU; resource=gpu / cpu 只抢该类(无则失败并附当前余量摘要); partition 显式指定则直接使用。返回 granted/pending/failed 与 job_id/node。
Args: connection: cluster 连接 label purpose: 会话用途名(如 train-a100),用于 tmux 命名与检索 resource: gpu | cpu;缺省为自动(GPU 优先回退 CPU) gpus: GPU 卡数(默认 1;resource 含 gpu 时生效) cpus: CPU 核数(cpu 资源必给则默认 4;也可与 GPU 同时指定) partition: 显式分区(跳过自动选择) wait: 等待授予秒数(超时会话保留,session_info 随时查)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cpus | No | ||
| gpus | No | ||
| wait | No | ||
| purpose | No | alloc | |
| resource | No | ||
| partition | No | ||
| connection | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||