Pbs 标志

Pbs

组织
AI-ModCon
pbs

PBS/OpenPBS job scheduler for HPC batch job scheduling. Use when submitting batch or interactive jobs with qsub, monitoring with qstat, deleting with qdel, writing #PBS job scripts, specifying resources with the select/ncpus/ mem/ngpus syntax, setting walltime, working with job arrays (-t flag), setting dependencies with -W depend=, checking job accounting, or troubleshooting jobs on any PBS or OpenPBS cluster.

概览

发布者AI-ModCon
代码仓库genesis-skills
技能名称pbs
星标数
37
复刻数
16
附带文件
6
许可协议BSD-2-Clause
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 6 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 AI-ModCon 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Pbs AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/AI-ModCon/genesis-skills/tree/main/skills/hpc-skills/pbs
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AI-ModCon/genesis-skills.git /tmp/genesis-skills
mkdir -p .claude/skills
cp -r /tmp/genesis-skills/skills/hpc-skills/pbs .claude/skills/pbs
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Pbs,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Pbs。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Pbs 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

PBS / OpenPBS Job Scheduler

PBS (Portable Batch System) is widely used at DOE labs (ALCF, etc.) and many academic HPC centers. Jobs are described with #PBS directives and submitted via qsub.

Quick Command Reference

CommandPurpose
qsub script.shSubmit a batch job script
qsub -IStart an interactive job
qstatView job queue
qstat -f <id>Full job detail
qdel <id>Delete/cancel a job
qhold <id>Place a user hold on a job
qrls <id>Release a held job
qalter <id>Modify a pending job
pbsnodes -aList all nodes and their state
qstat -QList available queues

Job State Codes

CodeStateMeaning
QQueuedWaiting for resources
RRunningCurrently executing
HHeldHeld by user, operator, or system
EExitingJob is finishing/cleaning up
CCompletedFinished (may appear briefly)
FFinishedJob is done (in history)
SSuspendedTemporarily suspended
WWaitingWaiting for eligible start time (-a)

Writing Job Scripts

#PBS directives must appear before any non-comment executable line.

Minimal working script:

bash
#!/bin/bash
#PBS -N myjob
#PBS -A myproject
#PBS -l select=1:ncpus=32:mem=64gb
#PBS -l walltime=01:00:00
#PBS -o myjob.out
#PBS -e myjob.err
#PBS -q workq

cd $PBS_O_WORKDIR
module load gcc openmpi
mpiexec -n 32 ./my_application

Key #PBS Directives

DirectiveExampleNotes
-NmyjobJob name
-AmyprojectAccount/project (often mandatory)
-l select=...2:ncpus=128:mem=256gbResource selection (see below)
-l walltime=02:30:00Wall clock limit (HH:MM:SS)
-qworkqQueue/destination
-ojob.outStdout path
-ejob.errStderr path
-j oe—Merge stdout+stderr into one file
-m abe—Email on abort/begin/end
-Muser@host.eduEmail address
-V—Export all current env vars to job
-v VAR=valNPROCS=8Export specific variable
-r n—Job is not rerunnable
-a202501011400Eligible start time (CCYYMMDDhhmm)
-W depend=afterok:12345Job dependency
-t1-100Job array (see below)

Resource Select Syntax

-l select=<N>:<property>=<value>:... where N is the number of "chunks" (typically nodes).

bash
# 1 node, 16 CPUs, 32 GB RAM
#PBS -l select=1:ncpus=16:mem=32gb

# 4 nodes, 128 CPUs each, 2 GPUs each
#PBS -l select=4:ncpus=128:mem=256gb:ngpus=2

# MPI + OpenMP hybrid (mpiprocs = MPI ranks per chunk)
#PBS -l select=2:ncpus=64:mpiprocs=4:ompthreads=16:mem=128gb

# Request specific node features
#PBS -l select=1:ncpus=32:arch=broadwell

place directive controls layout:

bash
#PBS -l place=scatter          # one chunk per node (default)
#PBS -l place=pack             # pack chunks onto fewest nodes
#PBS -l place=excl             # exclusive node access
#PBS -l place=scatter:excl     # one per node, exclusive

Submitting Jobs

bash
# Batch submission
qsub script.sh

# Override directives at submission
qsub -l select=4 -l walltime=2:00:00 script.sh

# Interactive job (drops into shell on allocated node)
qsub -I -l select=1:ncpus=8 -l walltime=1:00:00 -q debug

# Interactive with environment exported
qsub -I -V -l select=1:ncpus=16:mem=32gb -l walltime=2:00:00

Monitoring Jobs

bash
# All your jobs
qstat -u $USER

# All running jobs
qstat -r

# All queued/held jobs
qstat -i

# Full detail for one job
qstat -f 12345

# Finished job details (past ~7 days, if server configured)
qstat -xf 12345

# Estimated start times
qstat -T

# List queues and their limits
qstat -Q

# All node states
pbsnodes -a

Default output file locations (when -o/-e not specified):

  • Stdout: <jobname>.o<jobid> in $PBS_O_WORKDIR
  • Stderr: <jobname>.e<jobid> in $PBS_O_WORKDIR

Watch a running job's output:

bash
tail -f myjob.o12345

Cancelling, Holding, and Modifying Jobs

bash
qdel 12345                    # cancel job
qdel 12345[5]                 # cancel array element 5
qdel -W force 12345           # force delete (if qdel hangs)

qhold 12345                   # place user hold (state → H)
qrls 12345                    # release hold

qalter -l walltime=4:00:00 12345   # extend walltime (if pending)
qalter -l select=8 12345           # change node count (if pending)

Job Arrays

Submit many similar jobs from one qsub. Resources apply to each array element independently.

bash
# In the script:
#PBS -t 1-100            # indices 1..100
#PBS -t 1-50:2           # odd indices 1,3,5,...,49
#PBS -t 1-100%10         # max 10 running simultaneously

Or at submission: qsub -t 1-100 script.sh

Inside the script, use $PBS_ARRAY_INDEX:

bash
INPUT="data/input_${PBS_ARRAY_INDEX}.txt"
mpiexec ./process "$INPUT"

Array management:

bash
qstat -t 12345            # show all elements
qdel 12345[]              # delete entire array
qdel 12345[5]             # delete element 5

Job Dependencies

bash
# Submit job1, capture ID
JOB1=$(qsub stage1.sh)

# Submit job2 to run only if job1 succeeds
qsub -W depend=afterok:$JOB1 stage2.sh

# Common dependency types:
# afterok:<id>     — start if <id> exits with code 0
# afternotok:<id>  — start if <id> exits with non-zero code
# afterany:<id>    — start regardless of <id> outcome
# before:<id>      — <id> starts only after this job begins
# beforeok:<id>    — <id> starts only if this job succeeds

Common Environment Variables (Inside a Job)

VariableValue
$PBS_JOBIDFull job ID (e.g., 12345.server)
$PBS_JOBNAMEJob name
$PBS_O_WORKDIRDirectory where qsub was run
$PBS_O_HOSTHost where qsub was run
$PBS_NODEFILEFile listing allocated nodes (for MPI)
$PBS_NPTotal number of CPUs/tasks
$PBS_NUM_NODESNumber of nodes
$PBS_QUEUEQueue name
$PBS_ARRAY_INDEXArray task index (array jobs only)
$PBS_ARRAY_IDParent array job ID

Using $PBS_NODEFILE with MPI:

bash
mpiexec -hostfile $PBS_NODEFILE -n $PBS_NP ./my_app
# or simply:
mpiexec -n $PBS_NP ./my_app   # if MPI is PBS-aware

Module System

bash
module avail              # list available modules
module spider <pkg>       # search for a package
module load gcc/12 openmpi/4.1
module list               # show loaded modules
module purge              # unload everything

Always load modules inside the job script, not just in your login shell.

Additional Resources

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Pbs AI 技能有什么作用?

PBS/OpenPBS job scheduler for HPC batch job scheduling. Use when submitting batch or interactive jobs with qsub, monitoring with qstat, deleting with qdel, writing #PBS job scripts, specifying resources with the select/ncpus/ mem/ngpus syntax, setting walltime, working with job arrays (-t flag), setting dependencies with -W depend=, checking job accounting, or troubleshooting jobs on any PBS or OpenPBS cluster.

为什么在 TypingMind 中使用 Pbs?

因为您只需安装一次,就能搭配任何模型使用。Pbs 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Pbs?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/AI-ModCon/genesis-skills/tree/main/skills/hpc-skills/pbs。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Pbs?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Pbs 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Pbs 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Pbs AI 技能免费吗?

是的。AI-ModCon 已在 GitHub 上根据 BSD-2-Clause 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇