@yangdw2024/hpc-quantchem-workflow 0.0.0-stage → 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +114 -2
- package/SKILL.md +114 -0
- package/bin/cli.mjs +135 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.md +23 -0
- package/icon.svg +19 -0
- package/index.js +71 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +66 -4
- package/references/scheduler-cheatsheet.md +47 -0
- package/references/ssh-onboarding.md +91 -0
- package/scripts/calc_ct_marcus.py +158 -0
- package/scripts/deploy_to_hpc.sh +192 -0
- package/scripts/gen_g16_workflow.py +126 -0
- package/scripts/install.ps1 +48 -0
- package/scripts/install.sh +39 -0
- package/scripts/mwfn_suite.sh +412 -0
- package/scripts/parse_fch_props.py +161 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yangdw2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,115 @@
|
|
|
1
|
-
#
|
|
1
|
+
# hpc-quantchem-workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 零硬编码、跨平台(Windows / macOS / Linux)SSH 高性能计算(HPC)集群接入与量化 / 有机光电计算全流程 AI Agent 技能套件。
|
|
4
|
+
> Zero-hardcoding AI Agent skill & CLI workflow toolkit for SSH HPC clusters (SGE / Slurm / PBS), Gaussian 16, Multiwfn, and Marcus charge-transfer kinetics.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 一键快速安装 / Quick Install
|
|
8
|
+
|
|
9
|
+
| 使用场景 | 一行命令(复制即用) |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **DeepSeek Harness (DSH) 原生插件(推荐)** | `dsh plugin add @yangdw2024/hpc-quantchem-workflow`(或在插件市场搜索 `hpc-quantchem-workflow` 一键安装) |
|
|
12
|
+
| **全 AI Agent 一键安装(DSH / Claude Code / Codex / Cursor / Antigravity)** | `npx -y @yangdw2024/hpc-quantchem-workflow`(支持 `--all` / `status` / `uninstall`) |
|
|
13
|
+
| **skills.sh 生态** | `npx skills add yangdw2024/hpc-quantchem-workflow` |
|
|
14
|
+
| **Windows 无 Node.js 一键脚本** | `irm https://raw.githubusercontent.com/yangdw2024/hpc-quantchem-workflow/main/scripts/install.ps1 \| iex` |
|
|
15
|
+
| **macOS / Linux 无 Node.js 一键脚本** | `curl -fsSL https://raw.githubusercontent.com/yangdw2024/hpc-quantchem-workflow/main/scripts/install.sh \| bash` |
|
|
16
|
+
| **离线压缩包** | 前往 [GitHub Releases](https://github.com/yangdw2024/hpc-quantchem-workflow/releases/latest) 下载 `hpc-quantchem-workflow-v1.0.0.zip` 解压到对应 Agent 的 `skills/` 目录 |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 核心特性 / Features
|
|
21
|
+
|
|
22
|
+
- **零硬编码、即插即用**:不包含任何私有 IP、主机名、账号或路径;纯 Bash + Python 3 标准库实现,零第三方依赖。
|
|
23
|
+
- **跨调度器兼容**:`mwfn_suite.sh` 自动识别 **SGE (`qsub`) / Slurm (`sbatch`) / PBS (`qsub`) / local**,并支持 `--dry-run` 预览作业脚本。
|
|
24
|
+
- **登录节点保护与安全护栏**:
|
|
25
|
+
- 严禁在登录节点直接运行 `g16`、`orca`、`vasp`、`gmx` 或未限核的 `Multiwfn_noGUI`;
|
|
26
|
+
- 强制传入 `-nt` 覆盖 `Multiwfn` 默认 `settings.ini` 中的 `nthreads`;
|
|
27
|
+
- 删除、覆盖、取消/挂起作业及提交任务前均要求先列出完整命令向用户确认;
|
|
28
|
+
- 大文件 `.log`/`.out` 仅做有界读取(`head`/`tail`/`grep`)。
|
|
29
|
+
- **完整量化与有机光电工作流**:
|
|
30
|
+
1. **SSH 免密与只读探测**:`references/ssh-onboarding.md` + `references/scheduler-cheatsheet.md`
|
|
31
|
+
2. **`.fchk`/`.fch` 性质秒读汇总**:`scripts/parse_fch_props.py`(分子式、SCF 能量、HOMO/LUMO/能隙、偶极矩、三维尺寸与包围盒体积,支持 `--csv`)
|
|
32
|
+
3. **Multiwfn 队列化批处理(11 项)**:`scripts/mwfn_suite.sh`
|
|
33
|
+
- 基态分子性质:`esp`、`rdg`、`orbital`、`adch`、`hirshfeld`、`mulliken`、`mayer`、`mpp`
|
|
34
|
+
- 激发态分析:`hole_elec`(电子-空穴)、`nto`(自然跃迁轨道)、`tdm`(跃迁偶极矩)
|
|
35
|
+
4. **Gaussian 16 输入生成**:`scripts/gen_g16_workflow.py`(`optfreq`、`tddft` 自动加 `IOp(9/40=4)`、`s1opt`、4 点内重组能 `reorg`、二聚体电子耦合三单点 `coupling`)
|
|
36
|
+
5. **激发态与 Marcus 速率后处理**:`scripts/calc_ct_marcus.py`(TD-DFT 解析、4 点法内重组能 $\lambda_{\text{in}}$、半经典 Marcus 电荷转移/复合速率 $k_{\text{CT}}/k_{\text{CR}}$ 与寿命 $\tau$)
|
|
37
|
+
6. **一键部署 17 个独立快捷脚本到远端**:`scripts/deploy_to_hpc.sh`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 快速安装 / Installation
|
|
42
|
+
|
|
43
|
+
将该仓库克隆到你所用 AI Agent 的技能目录即可(支持 DeepSeek Harness / Codex / Claude Code 等遵循 Agent Skills 规范的客户端):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 示例:安装到全局 ~/.agents/skills/
|
|
47
|
+
git clone https://github.com/yangdw2024/hpc-quantchem-workflow.git ~/.agents/skills/hpc-quantchem-workflow
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Windows PowerShell 示例:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
git clone https://github.com/yangdw2024/hpc-quantchem-workflow.git "$env:USERPROFILE\.agents\skills\hpc-quantchem-workflow"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 目录结构 / Repository Layout
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
hpc-quantchem-workflow/
|
|
62
|
+
├── SKILL.md # AI Agent 技能指令入口
|
|
63
|
+
├── README.md # 项目说明文档
|
|
64
|
+
├── LICENSE # MIT 开源协议
|
|
65
|
+
├── .gitignore # 忽略计算大文件与 SSH 私钥
|
|
66
|
+
├── .gitattributes # 统一 LF 换行符(兼容 Linux HPC)
|
|
67
|
+
├── references/
|
|
68
|
+
│ ├── ssh-onboarding.md # 跨平台 SSH 免密配置与只读环境探测
|
|
69
|
+
│ └── scheduler-cheatsheet.md # SGE / Slurm / PBS 命令对照与避坑手册
|
|
70
|
+
└── scripts/
|
|
71
|
+
├── mwfn_suite.sh # Multiwfn 队列化批处理(11 项任务,自动探测调度器)
|
|
72
|
+
├── parse_fch_props.py # 纯 Python 秒读 .fchk/.fch 并批量导出 CSV
|
|
73
|
+
├── gen_g16_workflow.py # Gaussian 16 输入生成(Opt+Freq/TD-DFT/Reorg/Coupling)
|
|
74
|
+
├── calc_ct_marcus.py # TD-DFT / 4 点内重组能 / Marcus 速率后处理
|
|
75
|
+
└── deploy_to_hpc.sh # 一键部署到远端 HPC 并生成 17 个独立快捷命令
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 常用示例 / Quick Usage
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 1. 秒读单个或整目录 .fchk 的 HOMO/LUMO/能隙/偶极矩/尺寸
|
|
84
|
+
python3 scripts/parse_fch_props.py ./fchk_dir --recurse --csv summary.csv
|
|
85
|
+
|
|
86
|
+
# 2. 生成 Multiwfn SGE/Slurm 作业脚本(建议先 --dry-run 检查)
|
|
87
|
+
bash scripts/mwfn_suite.sh --task esp --wfn mol.fchk --nproc 8 --dry-run
|
|
88
|
+
bash scripts/mwfn_suite.sh --task hole_elec --wfn td.fchk --tdlog td.log --state 1 --nproc 8
|
|
89
|
+
|
|
90
|
+
# 3. 生成 Gaussian 16 输入(4 点重组能 / TD-DFT / 二聚体电子耦合)
|
|
91
|
+
python3 scripts/gen_g16_workflow.py --type tddft --xyz mol.xyz --func cam-b3lyp --basis "def2SVP"
|
|
92
|
+
python3 scripts/gen_g16_workflow.py --type reorg --xyz mol.xyz --carrier hole --func b3lyp --basis "6-311G(d,p)"
|
|
93
|
+
python3 scripts/gen_g16_workflow.py --type coupling --xyz dimer.xyz --split 42 --func b3lyp --basis "6-31G(d)"
|
|
94
|
+
|
|
95
|
+
# 4. 后处理:TD-DFT 解析 / 重组能 / Marcus 速率
|
|
96
|
+
python3 scripts/calc_ct_marcus.py tddft mol_tddft.log
|
|
97
|
+
python3 scripts/calc_ct_marcus.py reorg --e0-q0 1.log --eion-q0 2.log --eion-qion 3.log --e0-qion 4.log
|
|
98
|
+
python3 scripts/calc_ct_marcus.py marcus --V 15.2 --lam-in 0.25 --lam-out 0.30 --dG -0.45 --T 298.15
|
|
99
|
+
|
|
100
|
+
# 5. 一键部署到任意已打通 SSH 的 HPC 集群(包含 17 个 standalone 快捷脚本)
|
|
101
|
+
bash scripts/deploy_to_hpc.sh <ssh-host-alias> ~/scripts/qc_kit
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 适用边界说明
|
|
107
|
+
|
|
108
|
+
- **SSH 集群**:适用于允许本地通过 SSH 直连(含校内网/VPN/跳板机)的 SGE / Slurm / PBS 集群及本地 Linux 工作站。
|
|
109
|
+
- **纯 Web 门户集群**(禁止直连 22 端口 SSH 的超算网页终端):请配合 [hpc-web-copilot](https://github.com/yangdw2024/hpc-web-copilot) 使用。
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
[MIT](./LICENSE)
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hpc-quantchem-workflow
|
|
3
|
+
description: 通用跨平台 SSH 高性能计算(HPC)集群接入与量化/有机光电计算全流程工作流技能(零硬编码,适用于任意 Windows/macOS/Linux 电脑与任意 SGE/Slurm/PBS 集群)。覆盖:SSH 公钥免密配置与远程环境探测、安全作业调度与登录节点保护、Gaussian 16(Opt+Freq / TD-DFT+IOp(9/40=4) / S1优化 / 4点法内重组能 / 二聚体电子耦合三单点)输入生成与日志解析、半经典 Marcus 电荷转移/复合速率计算,以及 Multiwfn_noGUI 队列化批处理(ESP表面/RDG/HOMO-LUMO/ADCH/Hirshfeld/Mulliken/Mayer/MPP平面性/电子-空穴/NTO/跃迁偶极矩)。当用户需要让 Agent 连接任意 SSH 集群、部署跨环境量化表征与有机光电计算脚本、或执行上述计算与后处理时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 通用 HPC 集群 SSH 接入与量化/有机光电计算工作流
|
|
7
|
+
|
|
8
|
+
本技能为**完全可移植的通用套件**(不含任何硬编码 IP、账号或特定集群路径),可直接复制到任意电脑与任意 Linux HPC 集群使用。所有本地与远端脚本均打包在本技能的 `scripts/` 目录下,纯 Bash + Python 3 标准库实现,零第三方依赖。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. 铁律与安全红线(所有环境强制遵守)
|
|
13
|
+
|
|
14
|
+
1. **严禁在登录节点直接跑重计算**:登录节点仅用于文件管理、编辑/生成输入、查看队列与有界读日志。严禁在登录节点直接运行 `g16`/`orca`/`vasp`/`gmx` 或未限核的 `Multiwfn_noGUI`(很多集群的 `settings.ini` 默认 `nthreads=32`,极易打满登录节点导致死机)。
|
|
15
|
+
2. **所有高危/写操作必须先征得用户确认**:在执行删除(`rm`)、覆盖已有输入/结果文件、取消/挂起作业(`qdel`/`scancel`/`qhold`)、提交作业或批量提交前,必须先列出完整路径、作业 ID 或准确命令,经用户明确同意后再执行。
|
|
16
|
+
3. **只操作用户指定的工作目录**:绝不修改系统目录或他人账户文件。
|
|
17
|
+
4. **先探环境,再干活**:首次接入未知集群时,先用纯只读命令探测调度器类型(SGE / Slurm / PBS)、账号配额、计算软件路径与封装命令,绝不凭猜测提交。
|
|
18
|
+
5. **大日志只做有界读取**:检查 `.log` / `.out` 时使用 `tail`、`head`、`grep`,禁止整文件 `cat` 刷屏。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. 快速接入任意新集群(3 步走)
|
|
23
|
+
|
|
24
|
+
### 第 1 步:配置 SSH 免密连接
|
|
25
|
+
若本机尚未与目标服务器打通 SSH 免密,按 `references/ssh-onboarding.md` 执行:
|
|
26
|
+
1. 在本机生成独立密钥(`ssh-keygen -t ed25519`),并写入 `~/.ssh/config` 别名(例如 `<cluster-alias>`);
|
|
27
|
+
2. 将本机 `.pub` 公钥内容以 `>>` **追加**(绝不覆盖)到远端 `~/.ssh/authorized_keys`(由用户在已有终端粘贴一行命令完成);
|
|
28
|
+
3. 用纯只读非交互命令验证连通性(务必带 `-o BatchMode=yes` 防止卡死在密码提示,并用 `bash -lc` 加载远端登录环境):
|
|
29
|
+
```bash
|
|
30
|
+
ssh -o BatchMode=yes -o ConnectTimeout=10 <cluster-alias> 'bash -lc "whoami && hostname && pwd"'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 第 2 步:只读探测集群环境
|
|
34
|
+
执行只读探测以识别调度器、节点资源、软件路径与已有提交封装脚本(详细对照表见 `references/scheduler-cheatsheet.md`):
|
|
35
|
+
- **调度器**:检测 `sbatch`/`squeue`(Slurm)、`qsub`+`qhost`(SGE)、`qsub`+`pbsnodes`(PBS/Torque)。
|
|
36
|
+
- **核数配额与队列**:SGE 查 `qconf -srqs` / `qhost`;Slurm 查 `sinfo` / `sacctmgr`。
|
|
37
|
+
- **软件路径**:查 `which g16 formchk Multiwfn_noGUI Multiwfn python3` 及 `/opt`、`/opt/soft`、`module avail`。
|
|
38
|
+
- **检查 Multiwfn 线程陷阱**:读取 `settings.ini` 中的 `nthreads=`,确保所有批处理均显式传入 `-nt <核数>` 覆盖默认值。
|
|
39
|
+
|
|
40
|
+
### 第 3 步(可选):一键部署脚本到远端集群
|
|
41
|
+
如需直接在远端集群命令行使用整套脚本及 17 个独立快捷命令,使用本技能自带的部署脚本(先确认远端目标目录不会覆盖用户已有文件):
|
|
42
|
+
```bash
|
|
43
|
+
bash scripts/deploy_to_hpc.sh <cluster-alias> <remote_script_dir>
|
|
44
|
+
```
|
|
45
|
+
部署完成后会在 `<remote_script_dir>` 下生成:
|
|
46
|
+
- `workflows/`:核心通用脚本(`mwfn_suite.sh`、`parse_fch_props.py`、`gen_g16_workflow.py`、`calc_ct_marcus.py`)
|
|
47
|
+
- `standalone/`:17 个极简参数独立脚本(`run_esp.sh`、`run_rdg.sh`、`run_homo_lumo.sh`、`run_adch.sh`、`run_hirshfeld.sh`、`run_mayer.sh`、`run_mpp.sh`、`get_fch_props.sh`、`gen_tddft.sh`、`parse_tddft.sh`、`run_hole_elec.sh`、`run_nto.sh`、`run_tdm.sh`、`gen_reorg.sh`、`calc_reorg.sh`、`gen_coupling.sh`、`calc_marcus.sh`)
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. 核心工作流与脚本用法(本地与远端完全一致)
|
|
52
|
+
|
|
53
|
+
以下脚本均位于本技能 `scripts/` 目录(部署到集群后位于 `<remote_script_dir>/workflows/`):
|
|
54
|
+
|
|
55
|
+
### 3.1 纯 Python 秒读 `.fchk`/`.fch` 分子基础性质(`scripts/parse_fch_props.py`)
|
|
56
|
+
不依赖 Multiwfn,适合在登录节点或本机秒速批量汇总分子式、SCF 能量、**HOMO/LUMO/能隙 (eV)**、**偶极矩 (Debye)**、三维分子尺寸与外接范德华包围盒体积 (ų):
|
|
57
|
+
```bash
|
|
58
|
+
python3 scripts/parse_fch_props.py mol.fchk
|
|
59
|
+
python3 scripts/parse_fch_props.py ./fchk_dir --recurse --csv summary.csv
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3.2 Multiwfn 队列化表征套件(`scripts/mwfn_suite.sh`)
|
|
63
|
+
自动识别 SGE / Slurm / PBS 调度器(也可通过 `--scheduler sge|slurm|pbs|local` 指定),自动探测 `Multiwfn_noGUI`/`Multiwfn`(也可通过环境变量 `MULTIWFN_BIN` / `Multiwfnpath` 或 `--mwfn-bin` 指定),强制传入 `-nt` 覆盖 `settings.ini` 线程数、设置 `ulimit -s unlimited` 与 `KMP_STACKSIZE=200M`,自动兼容 Windows CRLF 指令文件,并支持 `--dry-run` 仅生成脚本不提交:
|
|
64
|
+
|
|
65
|
+
- **常规分子性质(基态 `.fchk`/`.wfn`/`.molden`)**:
|
|
66
|
+
- `--task esp`:分子表面定量分析(vdW 体积、表面积、正负面积、$\nu$、$\Pi$、MPI、极值点 + `surf.cub`/`mapfunc.cub`)
|
|
67
|
+
- `--task rdg`:RDG / NCI 弱相互作用(`func1.cub` + `func2.cub` + `output.txt`,支持 `--grid 1|2|3`)
|
|
68
|
+
- `--task orbital`:前线/指定轨道格点(默认 `--orbitals h,l`,支持 `h-1,h,l,l+1`)
|
|
69
|
+
- `--task adch` / `hirshfeld` / `mulliken`:原子电荷(`adch`/`hirshfeld` 内置选原子密度 `1`,防 NaN)
|
|
70
|
+
- `--task mayer`:Mayer 键级与原子价态
|
|
71
|
+
- `--task mpp`:分子平面性 MPP / SDP(支持 `--atoms a|h|范围`)
|
|
72
|
+
- **激发态分析(需同时提供 TD-DFT `.fchk` 与 `--tdlog <td.log>`)**:
|
|
73
|
+
- `--task hole_elec`:电子-空穴分析(Multiwfn `18->1`,`--state N`)
|
|
74
|
+
- `--task nto`:自然跃迁轨道 NTO 导出 `.fch`(Multiwfn `18->6`,`--state N`)
|
|
75
|
+
- `--task tdm`:跃迁偶极矩矩阵(Multiwfn `18->5`)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 示例(建议先加 --dry-run 检查生成的 .sge/.slurm 脚本)
|
|
79
|
+
bash scripts/mwfn_suite.sh --task esp --wfn mol.fchk --nproc 8 --dry-run
|
|
80
|
+
bash scripts/mwfn_suite.sh --task hole_elec --wfn td.fchk --tdlog td.log --state 1 --nproc 8
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3.3 Sobereva 规范 Gaussian 16 输入生成(`scripts/gen_g16_workflow.py`)
|
|
84
|
+
从 `.xyz` 一键生成规范 `.gjf`(生成后请人工核对方法、电荷/多重度与资源,再按集群封装命令提交):
|
|
85
|
+
- `--type optfreq`:基态几何优化 + 频率(默认 `b3lyp/6-31G(d) em=gd3bj`)
|
|
86
|
+
- `--type tddft`:激发态单点(自动加 `td=(direct,nstates=N) iop(9/40=4)`,确保 Multiwfn 电子-空穴/NTO/TDM 精度)
|
|
87
|
+
- `--type s1opt`:$S_1$ 激发态几何优化(`td=(direct,nstates=6,root=1) opt`)
|
|
88
|
+
- `--type reorg`:**四点法内重组能** 4 个完整 `.gjf`(支持 `--carrier hole|electron`;Step 4 自动采用 `%oldchk` + `geom=check`)
|
|
89
|
+
- `--type coupling`:**二聚体电子耦合 $V$ 投影法** 3 个单点 `.gjf`(按 `--split N` 切分单体 A/B,自动加 `nosymm pop=full` 与二聚体 `iop(3/33=1)`)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python3 scripts/gen_g16_workflow.py --type tddft --xyz mol.xyz --func cam-b3lyp --basis "def2SVP" --solvent chloroform
|
|
93
|
+
python3 scripts/gen_g16_workflow.py --type reorg --xyz mol.xyz --carrier hole --func b3lyp --basis "6-311G(d,p)"
|
|
94
|
+
python3 scripts/gen_g16_workflow.py --type coupling --xyz dimer.xyz --split 42 --func b3lyp --basis "6-31G(d)"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 3.4 激发态、四点重组能与 Marcus 速率后处理(`scripts/calc_ct_marcus.py`)
|
|
98
|
+
```bash
|
|
99
|
+
# 解析 TD-DFT 激发能、波长、振子强度 f、跃迁电偶极矩 (Debye) 与主要轨道跃迁
|
|
100
|
+
python3 scripts/calc_ct_marcus.py tddft mol_tddft.log
|
|
101
|
+
|
|
102
|
+
# 从 4 个 .log 自动计算内重组能 λ1、λ2、λ_in (eV / meV)
|
|
103
|
+
python3 scripts/calc_ct_marcus.py reorg --e0-q0 1.log --eion-q0 2.log --eion-qion 3.log --e0-qion 4.log
|
|
104
|
+
|
|
105
|
+
# 半经典 Marcus 公式计算电荷转移速率 k_CT / 电荷复合速率 k_CR 与寿命 τ
|
|
106
|
+
python3 scripts/calc_ct_marcus.py marcus --V 15.2 --lam-in 0.25 --lam-out 0.30 --dG -0.45 --T 298.15
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 4. 配套参考文档
|
|
112
|
+
|
|
113
|
+
- `references/ssh-onboarding.md`:跨系统(Windows/macOS/Linux)SSH 密钥生成、`~/.ssh/config` 写法、安全追加 `authorized_keys`、撤销权限与故障排查。
|
|
114
|
+
- `references/scheduler-cheatsheet.md`:SGE / Slurm / PBS 常用命令对照表、登录节点保护清单、Multiwfn `settings.ini` 与 `formchk` 避坑指南。
|
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs'
|
|
3
|
+
import { homedir } from 'node:os'
|
|
4
|
+
import { dirname, join, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
const PKG_ROOT = resolve(__dirname, '..')
|
|
9
|
+
const SKILL_SRC = resolve(PKG_ROOT, '.')
|
|
10
|
+
const COPY_ITEMS = ["SKILL.md","references","scripts","LICENSE"]
|
|
11
|
+
const PKG_JSON = JSON.parse(readFileSync(join(PKG_ROOT, 'package.json'), 'utf8'))
|
|
12
|
+
const SKILL_NAME = 'hpc-quantchem-workflow'
|
|
13
|
+
const PKG_NAME = '@yangdw2024/hpc-quantchem-workflow'
|
|
14
|
+
const REPO_SLUG = 'yangdw2024/hpc-quantchem-workflow'
|
|
15
|
+
|
|
16
|
+
const HOME = homedir()
|
|
17
|
+
const TARGETS = [
|
|
18
|
+
{ id: 'dsh', label: 'DeepSeek Harness (DSH)', root: join(HOME, '.dsh'), dir: join(HOME, '.dsh', 'skills', SKILL_NAME) },
|
|
19
|
+
{ id: 'claude', label: 'Claude Code', root: join(HOME, '.claude'), dir: join(HOME, '.claude', 'skills', SKILL_NAME) },
|
|
20
|
+
{ id: 'codex', label: 'OpenAI Codex', root: join(HOME, '.codex'), dir: join(HOME, '.codex', 'skills', SKILL_NAME) },
|
|
21
|
+
{ id: 'cursor', label: 'Cursor', root: join(HOME, '.cursor'), dir: join(HOME, '.cursor', 'skills', SKILL_NAME) },
|
|
22
|
+
{ id: 'agents', label: 'Generic ~/.agents (Antigravity/OpenCode)', root: join(HOME, '.agents'), dir: join(HOME, '.agents', 'skills', SKILL_NAME) },
|
|
23
|
+
{ id: 'antigravity', label: 'Antigravity (~/.gemini)', root: join(HOME, '.gemini', 'antigravity'), dir: join(HOME, '.gemini', 'antigravity', 'skills', SKILL_NAME) },
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
function printHelp() {
|
|
27
|
+
console.log(`${PKG_JSON.name} v${PKG_JSON.version} — One-click skill installer for ${SKILL_NAME}
|
|
28
|
+
|
|
29
|
+
Usage:
|
|
30
|
+
npx -y ${PKG_NAME} [install] [--all] [--targets dsh,claude,codex,cursor,agents,antigravity] [--dir <path>] [--dry-run]
|
|
31
|
+
npx -y ${PKG_NAME} status
|
|
32
|
+
npx -y ${PKG_NAME} uninstall [--all] [--targets ...] [--dir <path>]
|
|
33
|
+
npx -y ${PKG_NAME} path
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--all Install/uninstall across all supported AI agent directories
|
|
37
|
+
--targets <list> Comma-separated agent ids (dsh,claude,codex,cursor,agents,antigravity)
|
|
38
|
+
--dir <path> Custom destination skill directory
|
|
39
|
+
--dry-run Preview actions without writing files
|
|
40
|
+
-h, --help Show this help message
|
|
41
|
+
|
|
42
|
+
DSH native plugin alternative:
|
|
43
|
+
dsh plugin add ${PKG_NAME}
|
|
44
|
+
|
|
45
|
+
Repository: https://github.com/${REPO_SLUG}
|
|
46
|
+
`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function selectTargets(args) {
|
|
50
|
+
if (args.dir) {
|
|
51
|
+
return [{ id: 'custom', label: 'Custom directory', root: dirname(resolve(args.dir)), dir: resolve(args.dir) }]
|
|
52
|
+
}
|
|
53
|
+
if (args.targets) {
|
|
54
|
+
const wanted = new Set(args.targets.split(',').map(s => s.trim().toLowerCase()).filter(Boolean))
|
|
55
|
+
const picked = TARGETS.filter(t => wanted.has(t.id))
|
|
56
|
+
if (picked.length === 0) {
|
|
57
|
+
console.error('No valid target matched:', args.targets)
|
|
58
|
+
process.exit(1)
|
|
59
|
+
}
|
|
60
|
+
return picked
|
|
61
|
+
}
|
|
62
|
+
if (args.all) return TARGETS
|
|
63
|
+
const detected = TARGETS.filter(t => existsSync(t.root))
|
|
64
|
+
return detected.length > 0 ? detected : [TARGETS[0], TARGETS[4]]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function installTo(dest, dryRun) {
|
|
68
|
+
if (dryRun) {
|
|
69
|
+
console.log(`[dry-run] Would install ${SKILL_NAME} -> ${dest}`)
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
rmSync(dest, { recursive: true, force: true })
|
|
73
|
+
mkdirSync(dest, { recursive: true })
|
|
74
|
+
for (const item of COPY_ITEMS) {
|
|
75
|
+
const src = join(SKILL_SRC, item)
|
|
76
|
+
if (!existsSync(src)) continue
|
|
77
|
+
cpSync(src, join(dest, item), { recursive: true, force: true })
|
|
78
|
+
}
|
|
79
|
+
console.log(`[ok] Installed ${SKILL_NAME} -> ${dest}`)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function uninstallFrom(dest, dryRun) {
|
|
83
|
+
if (!existsSync(dest)) {
|
|
84
|
+
console.log(`[skip] Not installed: ${dest}`)
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
if (dryRun) {
|
|
88
|
+
console.log(`[dry-run] Would remove ${dest}`)
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
rmSync(dest, { recursive: true, force: true })
|
|
92
|
+
console.log(`[ok] Removed ${dest}`)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const argv = process.argv.slice(2)
|
|
96
|
+
if (argv.includes('-h') || argv.includes('--help')) {
|
|
97
|
+
printHelp()
|
|
98
|
+
process.exit(0)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const cmd = ['install', 'status', 'uninstall', 'path'].includes(argv[0]) ? argv.shift() : 'install'
|
|
102
|
+
const opts = { all: false, dryRun: false, targets: '', dir: '' }
|
|
103
|
+
for (let i = 0; i < argv.length; i++) {
|
|
104
|
+
const a = argv[i]
|
|
105
|
+
if (a === '--all') opts.all = true
|
|
106
|
+
else if (a === '--dry-run') opts.dryRun = true
|
|
107
|
+
else if (a === '--targets' && argv[i + 1]) opts.targets = argv[++i]
|
|
108
|
+
else if (a === '--dir' && argv[i + 1]) opts.dir = argv[++i]
|
|
109
|
+
else {
|
|
110
|
+
console.error('Unknown argument:', a)
|
|
111
|
+
printHelp()
|
|
112
|
+
process.exit(1)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (cmd === 'path') {
|
|
117
|
+
console.log(SKILL_SRC)
|
|
118
|
+
} else if (cmd === 'status') {
|
|
119
|
+
console.log(`${PKG_JSON.name} v${PKG_JSON.version} (skill: ${SKILL_NAME})`)
|
|
120
|
+
for (const t of TARGETS) {
|
|
121
|
+
const installed = existsSync(join(t.dir, 'SKILL.md'))
|
|
122
|
+
const detected = existsSync(t.root)
|
|
123
|
+
const state = installed ? 'INSTALLED' : detected ? 'detected (not installed)' : 'not detected'
|
|
124
|
+
console.log(` - ${t.id.padEnd(12)} ${state.padEnd(26)} ${t.dir}`)
|
|
125
|
+
}
|
|
126
|
+
} else if (cmd === 'uninstall') {
|
|
127
|
+
const list = selectTargets(opts)
|
|
128
|
+
for (const t of list) uninstallFrom(t.dir, opts.dryRun)
|
|
129
|
+
} else {
|
|
130
|
+
const list = selectTargets(opts)
|
|
131
|
+
console.log(`Installing ${SKILL_NAME} v${PKG_JSON.version}...`)
|
|
132
|
+
for (const t of list) installTo(t.dir, opts.dryRun)
|
|
133
|
+
console.log(`
|
|
134
|
+
Done! Restart or start a new session in your AI agent to use /${SKILL_NAME}.`)
|
|
135
|
+
}
|
package/cordis.patch.yml
ADDED
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# HPC QuantChem Workflow (`@yangdw2024/hpc-quantchem-workflow`)
|
|
2
|
+
|
|
3
|
+
Zero-hardcoding DeepSeek Harness skill bundle and CLI workflow toolkit for SSH HPC clusters (SGE, Slurm, PBS), Gaussian 16 quantum chemistry calculations, Multiwfn_noGUI queued batch post-processing, and semi-classical Marcus charge-transfer kinetics.
|
|
4
|
+
|
|
5
|
+
## What this bundle provides
|
|
6
|
+
|
|
7
|
+
- Registers the `hpc-quantchem-workflow` skill directly into DSH (`ctx.skills`) with its full bundled `scripts/` and `references/` directory.
|
|
8
|
+
- Pure Bash + Python 3 standard-library scripts with zero third-party dependencies:
|
|
9
|
+
- `scripts/parse_fch_props.py`: parse `.fch`/`.fchk` formula, SCF energy, HOMO/LUMO gap, dipole moment, and 3D bounding box.
|
|
10
|
+
- `scripts/mwfn_suite.sh`: SGE/Slurm/PBS/local queued batch Multiwfn_noGUI runner covering 11 ground-state and excited-state analyses (`esp`, `rdg`, `orbital`, `adch`, `hirshfeld`, `mulliken`, `mayer`, `mpp`, `hole_elec`, `nto`, `tdm`).
|
|
11
|
+
- `scripts/gen_g16_workflow.py`: Gaussian 16 input generator (`optfreq`, `tddft`, `s1opt`, 4-point reorganization energy `reorg`, dimer coupling `coupling`).
|
|
12
|
+
- `scripts/calc_ct_marcus.py`: TD-DFT parsing, 4-point reorganization energy, and Marcus charge-transfer/recombination rates.
|
|
13
|
+
- `scripts/deploy_to_hpc.sh`: one-command deployment of helper scripts to remote HPC clusters.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
After installing the plugin in DSH, start a new session and invoke `/hpc-quantchem-workflow` or ask the agent to connect to your SSH cluster or generate Gaussian/Multiwfn workflows.
|
|
18
|
+
|
|
19
|
+
For Claude Code, Codex, Cursor, or Antigravity, run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx -y @yangdw2024/hpc-quantchem-workflow
|
|
23
|
+
```
|
package/icon.svg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg2" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#111827"/>
|
|
5
|
+
<stop offset="100%" stop-color="#312e81"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="orb" x1="0" y1="0" x2="1" y2="1">
|
|
8
|
+
<stop offset="0%" stop-color="#22d3ee"/>
|
|
9
|
+
<stop offset="100%" stop-color="#a78bfa"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
<rect width="64" height="64" rx="14" fill="url(#bg2)"/>
|
|
13
|
+
<ellipse cx="32" cy="32" rx="20" ry="9" fill="none" stroke="url(#orb)" stroke-width="2.2" transform="rotate(-30 32 32)"/>
|
|
14
|
+
<ellipse cx="32" cy="32" rx="20" ry="9" fill="none" stroke="#38bdf8" stroke-width="2.2" opacity="0.85" transform="rotate(30 32 32)"/>
|
|
15
|
+
<ellipse cx="32" cy="32" rx="20" ry="9" fill="none" stroke="#c084fc" stroke-width="1.8" opacity="0.7" transform="rotate(90 32 32)"/>
|
|
16
|
+
<circle cx="32" cy="32" r="5" fill="#f8fafc"/>
|
|
17
|
+
<circle cx="49" cy="22" r="2.8" fill="#22d3ee"/>
|
|
18
|
+
<circle cx="15" cy="42" r="2.8" fill="#a78bfa"/>
|
|
19
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
|
|
4
|
+
const BUNDLED_SKILL_RANK = 600
|
|
5
|
+
const PROVIDER_NAME = 'hpc-quantchem-workflow'
|
|
6
|
+
const SKILL_DIR_URL = new URL('./', import.meta.url)
|
|
7
|
+
const SKILL_MD_URL = new URL('SKILL.md', SKILL_DIR_URL)
|
|
8
|
+
const RESOURCE_BASE = {
|
|
9
|
+
kind: 'directory',
|
|
10
|
+
path: fileURLToPath(SKILL_DIR_URL),
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function parseSkillMarkdown(raw) {
|
|
14
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n*/.exec(raw)
|
|
15
|
+
let description = 'Zero-hardcoding AI Agent skill & CLI toolkit for SSH HPC clusters (SGE/Slurm/PBS), Gaussian 16 workflows (Opt+Freq, TD-DFT, S1 opt, reorganization energy, dimer electronic coupling), Marcus charge-transfer kinetics, and Multiwfn_noGUI queued batch analysis.'
|
|
16
|
+
let body = raw
|
|
17
|
+
if (match) {
|
|
18
|
+
body = raw.slice(match[0].length)
|
|
19
|
+
const descMatch = /^description:\s*(?:"([\s\S]*?)"|'([\s\S]*?)'|([^\r\n]+))/m.exec(match[1])
|
|
20
|
+
const extracted = descMatch && (descMatch[1] || descMatch[2] || descMatch[3])
|
|
21
|
+
if (extracted && extracted.trim()) description = extracted.trim()
|
|
22
|
+
}
|
|
23
|
+
return { description, body }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const CANDIDATE = {
|
|
27
|
+
name: 'hpc-quantchem-workflow',
|
|
28
|
+
description: 'Zero-hardcoding AI Agent skill & CLI toolkit for SSH HPC clusters (SGE/Slurm/PBS), Gaussian 16 workflows (Opt+Freq, TD-DFT, S1 opt, reorganization energy, dimer electronic coupling), Marcus charge-transfer kinetics, and Multiwfn_noGUI queued batch analysis.',
|
|
29
|
+
invocation: {
|
|
30
|
+
modelInvocable: true,
|
|
31
|
+
userInvocable: true,
|
|
32
|
+
},
|
|
33
|
+
provider: PROVIDER_NAME,
|
|
34
|
+
source: 'bundled',
|
|
35
|
+
resourceBase: RESOURCE_BASE,
|
|
36
|
+
rank: BUNDLED_SKILL_RANK,
|
|
37
|
+
locator: SKILL_MD_URL,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const provider = {
|
|
41
|
+
name: PROVIDER_NAME,
|
|
42
|
+
async list() {
|
|
43
|
+
try {
|
|
44
|
+
const raw = await readFile(SKILL_MD_URL, 'utf8')
|
|
45
|
+
const { description } = parseSkillMarkdown(raw)
|
|
46
|
+
return [{ ...CANDIDATE, description }]
|
|
47
|
+
} catch {
|
|
48
|
+
return [CANDIDATE]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
async get() {
|
|
52
|
+
const raw = await readFile(SKILL_MD_URL, 'utf8')
|
|
53
|
+
const { description, body } = parseSkillMarkdown(raw)
|
|
54
|
+
return {
|
|
55
|
+
name: CANDIDATE.name,
|
|
56
|
+
description,
|
|
57
|
+
invocation: CANDIDATE.invocation,
|
|
58
|
+
provider: CANDIDATE.provider,
|
|
59
|
+
source: CANDIDATE.source,
|
|
60
|
+
resourceBase: RESOURCE_BASE,
|
|
61
|
+
content: body,
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const name = 'skill-hpc-quantchem-workflow'
|
|
67
|
+
export const inject = ['skills']
|
|
68
|
+
|
|
69
|
+
export function apply(ctx) {
|
|
70
|
+
ctx.skills.registerProvider(() => provider)
|
|
71
|
+
}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yangdw2024/hpc-quantchem-workflow",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-hardcoding DSH skill bundle & universal installer for SSH HPC clusters (SGE/Slurm/PBS), Gaussian 16, Multiwfn batch post-processing, and Marcus charge-transfer kinetics.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "yangdw2024",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./index.js",
|
|
9
|
+
"icon": "./icon.svg",
|
|
10
|
+
"bin": {
|
|
11
|
+
"hpc-quantchem-workflow": "./bin/cli.mjs"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./index.js",
|
|
15
|
+
"./locale/*.json": "./locale/*.json",
|
|
16
|
+
"./icon": "./icon.svg"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"cordis.patch.yml",
|
|
21
|
+
"bin/cli.mjs",
|
|
22
|
+
"locale/*.json",
|
|
23
|
+
"docs/DETAIL.md",
|
|
24
|
+
"icon.svg",
|
|
25
|
+
"SKILL.md",
|
|
26
|
+
"references",
|
|
27
|
+
"scripts",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"keywords": [
|
|
32
|
+
"dsh",
|
|
33
|
+
"dsh-plugin",
|
|
34
|
+
"deepseek-harness",
|
|
35
|
+
"cordis-plugin",
|
|
36
|
+
"agent-skill",
|
|
37
|
+
"hpc",
|
|
38
|
+
"ssh",
|
|
39
|
+
"sge",
|
|
40
|
+
"slurm",
|
|
41
|
+
"pbs",
|
|
42
|
+
"quantum-chemistry",
|
|
43
|
+
"gaussian",
|
|
44
|
+
"multiwfn",
|
|
45
|
+
"marcus",
|
|
46
|
+
"opv"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/yangdw2024/hpc-quantchem-workflow.git"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/yangdw2024/hpc-quantchem-workflow#readme",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/yangdw2024/hpc-quantchem-workflow/issues"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.18.0",
|
|
58
|
+
"dsh": ">=0.2.0-0 <0.3.0"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"dsh": {
|
|
64
|
+
"bundle": {
|
|
65
|
+
"patch": "./cordis.patch.yml"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# SGE / Slurm / PBS 调度器命令对照与安全避坑手册
|
|
2
|
+
|
|
3
|
+
## 1. 三大主流作业调度器命令对照
|
|
4
|
+
|
|
5
|
+
| 操作 | SGE (Grid Engine) | Slurm | PBS / Torque |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| 提交作业 | `qsub job.sge` | `sbatch job.slurm` | `qsub job.pbs` |
|
|
8
|
+
| 查看本人作业 | `qstat -u $USER`(或集群封装 `qa`) | `squeue -u $USER` | `qstat -u $USER` |
|
|
9
|
+
| 查看所有节点负载 | `qhost`(或 `pestat`) | `sinfo` / `scontrol show node` | `pbsnodes -a` |
|
|
10
|
+
| 删除/取消作业 | `qdel <JOBID>` | `scancel <JOBID>` | `qdel <JOBID>` |
|
|
11
|
+
| 挂起 / 释放作业 | `qhold <JOBID>` / `qrls <JOBID>` | `scontrol hold/release <JOBID>` | `qhold` / `qrls` |
|
|
12
|
+
| 查看账号核数配额 | `qconf -srqs` | `sacctmgr show assoc user=$USER` | `qmgr -c "p s"` |
|
|
13
|
+
| 作业内获取分配核数 | `$NSLOTS` | `$SLURM_CPUS_PER_TASK` | `$PBS_NP` |
|
|
14
|
+
| 作业内工作目录变量 | `$SGE_O_WORKDIR` | `$SLURM_SUBMIT_DIR` | `$PBS_O_WORKDIR` |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. 集群通用安全避坑清单
|
|
19
|
+
|
|
20
|
+
1. **登录节点严禁重计算**:
|
|
21
|
+
- 登录节点通常核数少、内存小且多人共用。
|
|
22
|
+
- 严禁在登录节点直接跑 `g16`、`orca`、`vasp`、`gmx`、`Multiwfn_noGUI` 或大规模 `formchk` 批处理。
|
|
23
|
+
- 如集群提供了封装提交命令(例如 `subg16`、`g16sub` 等集群封装命令),**优先遵守集群封装命令**提交量化计算。
|
|
24
|
+
|
|
25
|
+
2. **Multiwfn `settings.ini` 线程数陷阱**:
|
|
26
|
+
- Linux 版 `Multiwfn_noGUI` 安装目录下的 `settings.ini` 常预设 `nthreads= 16` 或 `32`。
|
|
27
|
+
- 无论在计算节点还是队列作业里,务必设置:
|
|
28
|
+
```bash
|
|
29
|
+
export Multiwfnpath=<Multiwfn所在目录>
|
|
30
|
+
export KMP_STACKSIZE=200M
|
|
31
|
+
ulimit -s unlimited
|
|
32
|
+
Multiwfn_noGUI input.fchk -nt <实际申请核数>
|
|
33
|
+
```
|
|
34
|
+
- 命令行 `-nt` 会覆盖 `settings.ini` 中的默认线程数,防止超线程抢核或把登录节点卡死。
|
|
35
|
+
|
|
36
|
+
3. **Gaussian `.chk` → `.fchk` 转换(`formchk`)**:
|
|
37
|
+
- `formchk` 往往不在默认 `PATH` 中,需先 `source $g16root/g16/bsd/g16.profile` 或用绝对路径调用。
|
|
38
|
+
- 批量转换大 `.chk` 文件时,建议走计算队列或确认计算节点负载宽松后在计算节点执行。
|
|
39
|
+
|
|
40
|
+
4. **Windows 与 Linux 换行符兼容**:
|
|
41
|
+
- Windows 编辑的 `.gjf`、`.sh`、Multiwfn 指令 `.txt` 可能带 `\r\n`(CRLF)。
|
|
42
|
+
- 脚本与指令文件在 Linux 上使用前建议经 `tr -d '\r'` 或 `dos2unix` 处理。
|
|
43
|
+
|
|
44
|
+
5. **Multiwfn 3.8 常见退出码判读**:
|
|
45
|
+
- `exit 0`:正常结束。
|
|
46
|
+
- `exit 59`(`list-directed I/O`):stdin 尾部多余输入导致的无害退出;只要 `.out` 日志关键指标与目标 `.cub`/`.fch` 产物完整即视为成功。
|
|
47
|
+
- `exit 24`(`EOF during read`):指令链不完整、stdin 提前结束,需检查菜单交互顺序。
|