LAMMPS ReaxFF 成键观测量
用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。
阅读本篇目录
下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 6 个已完成条件,按输入保留相互作用与操作参数。
选择条件#
解压并进入 lammps-reaxff-bond-observables-kokkos-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。
| 条件目录 | 主要样式 | 运行模式 |
|---|---|---|
p100-ACKS2-water |
pair_style reaxff/kk, fix acks2/reaxff/kk, fix nvt, compute property/atom, compute reduce, compute reaxff/atom/kk |
kokkos |
p100-ACKS2-water-cpu-reference |
pair_style reaxff, fix acks2/reaxff, fix nvt, compute property/atom, compute reduce, compute reaxff/atom |
gpu |
p100-ACKS2-water-field |
pair_style reaxff/kk, fix acks2/reaxff/kk, fix nvt, fix efield, fix wall/reflect, compute property/atom, compute reduce, compute reaxff/atom/kk |
kokkos |
p100-ACKS2-water-field-cpu-reference |
pair_style reaxff, fix acks2/reaxff, fix nvt, fix efield, fix wall/reflect, compute property/atom, compute reduce, compute reaxff/atom |
gpu |
v100-ACKS2-water |
pair_style reaxff/kk, fix acks2/reaxff/kk, fix nvt, compute property/atom, compute reduce, compute reaxff/atom/kk |
kokkos |
v100-ACKS2-water-field |
pair_style reaxff/kk, fix acks2/reaxff/kk, fix nvt, fix efield, fix wall/reflect, compute property/atom, compute reduce, compute reaxff/atom/kk |
kokkos |
输入与提交#
第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。
# ACKS2 Water, CITE: Achtyl et al., Nat. Comm., 6 6539 (2015)
boundary p p p
units real
atom_style charge
read_data data.water
variable x index 1
variable y index 1
variable z index 1
replicate $x $y $z
pair_style reaxff/kk NULL safezone 3.0 mincap 150
pair_coeff * * acks2_ff.water O H
neighbor 0.5 bin
neigh_modify every 1 delay 0 check yes
velocity all create 300.0 4928459 rot yes dist gaussian
fix 1 all acks2/reaxff/kk 1 0.0 10.0 1.0e-6 reaxff maxiter 1000
fix 2 all nvt temp 300 300 50.0
timestep 0.5
thermo 10
compute charges all property/atom q
compute Q all reduce sum c_charges
thermo_style custom step temp press density vol pe ke etotal c_Q f_1
read_dump reference.dump 20 x y z vx vy vz q box yes replace yes
compute B all reaxff/atom/kk bonds yes
run 0
write_dump all custom atoms.dump id type x y z q fx fy fz c_B[1] c_B[2] c_B[3] modify sort id format float %.16g
write_dump all local bonds.dump index c_B[1] c_B[2] c_B[3] modify format float %.16g
在附件根目录提交第一组或所选条件。
sbatch --array=0 run.slurm
# 按 CASES 的完整列表提交
sbatch run.slurm
脚本申请一个 MPI 任务、一个 CPU 核和一张 P100,根据 MODES 加载对应模块。实际调用保存在 cases.json,例如第一组的命令参数为:
lmp -k on g 1 -sf kk -pk kokkos newton on neigh half gpu/aware off -echo both -in in.lammps > native.out
查看输出#
结果写入 work-new/条件名。先查看日志中的实际热力学表与结束信息。
cd work-new/p100-ACKS2-water
tail -n 35 native.out
本次第一组的原生日志片段如下。
Step Temp Press Density Volume PotEng KinEng TotEng c_Q f_1
Loop time of 0.00508389 on 1 procs for 0 steps with 3000 atoms
Total wall time: 0:00:00
原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 atoms.dump, bonds.dump。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。
再次运行前,将已有的同名 work-new 条件目录改名保存。
本次输出示例#
第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。
Step Temp Press Density Volume PotEng KinEng TotEng c_Q f_1
20 294.73865 2502.7982 1 29915.273 -254850.49 2634.8012 -252215.69 -2.2827857e-09 0
Loop time of 0.00508389 on 1 procs for 0 steps with 3000 atoms
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。