LAMMPS 专题

LAMMPS 角势曲线导出

用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。

更新于 2026-11-18约 19 分钟阅读按任务与环境选择适用配置
阅读本篇目录

下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 112 个已完成条件,按输入保留相互作用与操作参数。

选择条件#

解压并进入 lammps-angle-force-curves-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。

条件目录 主要样式 运行模式
v100-cosine-periodic-kk angle_style cosine/periodic/kk, pair_style lj/cut/kk kokkos
v100-quartic-kk angle_style quartic/kk, pair_style lj/cut/kk kokkos
v100-class2-kk angle_style class2/kk, pair_style lj/cut/kk kokkos
v100-cosine-kk-device angle_style cosine/kk/device, pair_style lj/cut/kk kokkos
v100-cross-kk-host angle_style cross/kk/host, pair_style lj/cut/kk kokkos
v100-fourier-simple-kk-host angle_style fourier/simple/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-squared-restricted-kk angle_style cosine/squared/restricted/kk, pair_style lj/cut/kk kokkos
v100-gaussian-kk-host angle_style gaussian/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-squared-kk-host angle_style cosine/squared/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-shift-exp-kk angle_style cosine/shift/exp/kk, pair_style lj/cut/kk kokkos
v100-cosine-squared-restricted-kk-device angle_style cosine/squared/restricted/kk/device, pair_style lj/cut/kk kokkos
v100-charmm-kk-host angle_style charmm/kk/host, pair_style lj/cut/kk kokkos
v100-class2-kk-device angle_style class2/kk/device, pair_style lj/cut/kk kokkos
v100-mm3-kk-device angle_style mm3/kk/device, pair_style lj/cut/kk kokkos
v100-cosine-squared-kk angle_style cosine/squared/kk, pair_style lj/cut/kk kokkos
v100-cosine-squared-kk-device angle_style cosine/squared/kk/device, pair_style lj/cut/kk kokkos
v100-mm3-kk-host angle_style mm3/kk/host, pair_style lj/cut/kk kokkos
v100-cross-kk angle_style cross/kk, pair_style lj/cut/kk kokkos
v100-gaussian-kk-device angle_style gaussian/kk/device, pair_style lj/cut/kk kokkos
v100-quartic-kk-host angle_style quartic/kk/host, pair_style lj/cut/kk kokkos
v100-mwlc-kk-host angle_style mwlc/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-kk angle_style cosine/kk, pair_style lj/cut/kk kokkos
v100-cosine-kk-host angle_style cosine/kk/host, pair_style lj/cut/kk kokkos
v100-mm3-kk angle_style mm3/kk, pair_style lj/cut/kk kokkos
v100-class2-kk-host angle_style class2/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-shift-exp-kk-device angle_style cosine/shift/exp/kk/device, pair_style lj/cut/kk kokkos
v100-cosine-shift-kk-host angle_style cosine/shift/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-delta-kk-host angle_style cosine/delta/kk/host, pair_style lj/cut/kk kokkos
v100-cross-kk-device angle_style cross/kk/device, pair_style lj/cut/kk kokkos
v100-mwlc-kk-device angle_style mwlc/kk/device, pair_style lj/cut/kk kokkos
v100-cosine-shift-exp-kk-host angle_style cosine/shift/exp/kk/host, pair_style lj/cut/kk kokkos
v100-fourier-simple-kk-device angle_style fourier/simple/kk/device, pair_style lj/cut/kk kokkos
v100-cosine-delta-kk angle_style cosine/delta/kk, pair_style lj/cut/kk kokkos
v100-fourier-kk angle_style fourier/kk, pair_style lj/cut/kk kokkos
v100-cosine-shift-kk angle_style cosine/shift/kk, pair_style lj/cut/kk kokkos
v100-cosine-shift-kk-device angle_style cosine/shift/kk/device, pair_style lj/cut/kk kokkos
v100-charmm-kk angle_style charmm/kk, pair_style lj/cut/kk kokkos
v100-cosine-periodic-kk-device angle_style cosine/periodic/kk/device, pair_style lj/cut/kk kokkos
v100-mwlc-kk angle_style mwlc/kk, pair_style lj/cut/kk kokkos
v100-cosine-periodic-kk-host angle_style cosine/periodic/kk/host, pair_style lj/cut/kk kokkos
v100-gaussian-kk angle_style gaussian/kk, pair_style lj/cut/kk kokkos
v100-cosine-delta-kk-device angle_style cosine/delta/kk/device, pair_style lj/cut/kk kokkos
v100-charmm-kk-device angle_style charmm/kk/device, pair_style lj/cut/kk kokkos
v100-fourier-simple-kk angle_style fourier/simple/kk, pair_style lj/cut/kk kokkos
v100-fourier-kk-device angle_style fourier/kk/device, pair_style lj/cut/kk kokkos
v100-fourier-kk-host angle_style fourier/kk/host, pair_style lj/cut/kk kokkos
v100-cosine-squared-restricted-kk-host angle_style cosine/squared/restricted/kk/host, pair_style lj/cut/kk kokkos
v100-quartic-kk-device angle_style quartic/kk/device, pair_style lj/cut/kk kokkos
p100-cosine-periodic-kk-host angle_style cosine/periodic/kk/host, pair_style lj/cut/kk kokkos
p100-cross-kk-device angle_style cross/kk/device, pair_style lj/cut/kk kokkos
p100-mm3-kk angle_style mm3/kk, pair_style lj/cut/kk kokkos
p100-mm3-kk-cpu-reference angle_style mm3, pair_style lj/cut gpu
p100-cosine-kk-host angle_style cosine/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-delta-kk angle_style cosine/delta/kk, pair_style lj/cut/kk kokkos
p100-cosine-delta-kk-cpu-reference angle_style cosine/delta, pair_style lj/cut gpu
p100-fourier-simple-kk-device angle_style fourier/simple/kk/device, pair_style lj/cut/kk kokkos
p100-gaussian-kk angle_style gaussian/kk, pair_style lj/cut/kk kokkos
p100-gaussian-kk-cpu-reference angle_style gaussian, pair_style lj/cut gpu
p100-charmm-kk angle_style charmm/kk, pair_style lj/cut/kk kokkos
p100-charmm-kk-cpu-reference angle_style charmm, pair_style lj/cut gpu
p100-cross-kk angle_style cross/kk, pair_style lj/cut/kk kokkos
p100-cross-kk-cpu-reference angle_style cross, pair_style lj/cut gpu
p100-cosine-shift-exp-kk-host angle_style cosine/shift/exp/kk/host, pair_style lj/cut/kk kokkos
p100-charmm-kk-host angle_style charmm/kk/host, pair_style lj/cut/kk kokkos
p100-quartic-kk-device angle_style quartic/kk/device, pair_style lj/cut/kk kokkos
p100-fourier-kk-host angle_style fourier/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-squared-restricted-kk-host angle_style cosine/squared/restricted/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-shift-exp-kk-device angle_style cosine/shift/exp/kk/device, pair_style lj/cut/kk kokkos
p100-fourier-kk-device angle_style fourier/kk/device, pair_style lj/cut/kk kokkos
p100-fourier-simple-kk angle_style fourier/simple/kk, pair_style lj/cut/kk kokkos
p100-fourier-simple-kk-cpu-reference angle_style fourier/simple, pair_style lj/cut gpu
p100-cosine-shift-kk angle_style cosine/shift/kk, pair_style lj/cut/kk kokkos
p100-cosine-shift-kk-cpu-reference angle_style cosine/shift, pair_style lj/cut gpu
p100-fourier-kk angle_style fourier/kk, pair_style lj/cut/kk kokkos
p100-fourier-kk-cpu-reference angle_style fourier, pair_style lj/cut gpu
p100-cosine-squared-kk-host angle_style cosine/squared/kk/host, pair_style lj/cut/kk kokkos
p100-charmm-kk-device angle_style charmm/kk/device, pair_style lj/cut/kk kokkos
p100-cosine-shift-exp-kk angle_style cosine/shift/exp/kk, pair_style lj/cut/kk kokkos
p100-cosine-shift-exp-kk-cpu-reference angle_style cosine/shift/exp, pair_style lj/cut gpu
p100-fourier-simple-kk-host angle_style fourier/simple/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-squared-restricted-kk angle_style cosine/squared/restricted/kk, pair_style lj/cut/kk kokkos
p100-cosine-squared-restricted-kk-cpu-reference angle_style cosine/squared/restricted, pair_style lj/cut gpu
p100-gaussian-kk-host angle_style gaussian/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-kk angle_style cosine/kk, pair_style lj/cut/kk kokkos
p100-cosine-kk-cpu-reference angle_style cosine, pair_style lj/cut gpu
p100-cosine-periodic-kk angle_style cosine/periodic/kk, pair_style lj/cut/kk kokkos
p100-cosine-periodic-kk-cpu-reference angle_style cosine/periodic, pair_style lj/cut gpu
p100-cosine-delta-kk-device angle_style cosine/delta/kk/device, pair_style lj/cut/kk kokkos
p100-cosine-squared-restricted-kk-device angle_style cosine/squared/restricted/kk/device, pair_style lj/cut/kk kokkos
p100-cosine-shift-kk-device angle_style cosine/shift/kk/device, pair_style lj/cut/kk kokkos
p100-mm3-kk-host angle_style mm3/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-kk-device angle_style cosine/kk/device, pair_style lj/cut/kk kokkos
p100-mm3-kk-device angle_style mm3/kk/device, pair_style lj/cut/kk kokkos
p100-mwlc-kk angle_style mwlc/kk, pair_style lj/cut/kk kokkos
p100-mwlc-kk-cpu-reference angle_style mwlc, pair_style lj/cut gpu
p100-cosine-delta-kk-host angle_style cosine/delta/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-shift-kk-host angle_style cosine/shift/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-periodic-kk-device angle_style cosine/periodic/kk/device, pair_style lj/cut/kk kokkos
p100-quartic-kk angle_style quartic/kk, pair_style lj/cut/kk kokkos
p100-quartic-kk-cpu-reference angle_style quartic, pair_style lj/cut gpu
p100-mwlc-kk-device angle_style mwlc/kk/device, pair_style lj/cut/kk kokkos
p100-quartic-kk-host angle_style quartic/kk/host, pair_style lj/cut/kk kokkos
p100-cross-kk-host angle_style cross/kk/host, pair_style lj/cut/kk kokkos
p100-mwlc-kk-host angle_style mwlc/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-squared-kk angle_style cosine/squared/kk, pair_style lj/cut/kk kokkos
p100-cosine-squared-kk-cpu-reference angle_style cosine/squared, pair_style lj/cut gpu
p100-class2-kk-device angle_style class2/kk/device, pair_style lj/cut/kk kokkos
p100-class2-kk angle_style class2/kk, pair_style lj/cut/kk kokkos
p100-class2-kk-cpu-reference angle_style class2, pair_style lj/cut gpu
p100-gaussian-kk-device angle_style gaussian/kk/device, pair_style lj/cut/kk kokkos
p100-class2-kk-host angle_style class2/kk/host, pair_style lj/cut/kk kokkos
p100-cosine-squared-kk-device angle_style cosine/squared/kk/device, pair_style lj/cut/kk kokkos

输入与提交#

第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。

clear
units real
atom_style full
boundary f f f
read_data model.data
angle_style cosine/periodic/kk
angle_coeff 1 10.0 -1 3

pair_style lj/cut/kk 4.0
pair_coeff * * 0.0 1.0
neighbor 0.3 bin
neigh_modify every 1 delay 0 check yes
group moving id 3
displace_atoms moving move 0.7500000000000002 -0.2009618943233420 0.0 units box
thermo 1
thermo_style custom step atoms pe eangle
thermo_modify norm no format float %.16e
run 0
print "60.00000000 $(eangle:%.16e)" append energies.dat screen no
write_dump all custom forces-00.dump id type x y z fx fy fz modify sort id

clear
units real
atom_style full
boundary f f f
read_data model.data
angle_style cosine/periodic/kk
angle_coeff 1 10.0 -1 3

pair_style lj/cut/kk 4.0
pair_coeff * * 0.0 1.0
neighbor 0.3 bin
neigh_modify every 1 delay 0 check yes
group moving id 3
displace_atoms moving move 0.0000000000000001 0.0000000000000000 0.0 units box
thermo 1
thermo_style custom step atoms pe eangle
thermo_modify norm no format float %.16e
run 0
print "90.00000000 $(eangle:%.16e)" append energies.dat screen no
write_dump all custom forces-01.dump id type x y z fx fy fz modify sort id

clear
units real
atom_style full
boundary f f f
read_data model.data
angle_style cosine/periodic/kk
angle_coeff 1 10.0 -1 3

pair_style lj/cut/kk 4.0
pair_coeff * * 0.0 1.0
neighbor 0.3 bin
neigh_modify every 1 delay 0 check yes
group moving id 3
# 完整输入见附件

在附件根目录提交第一组或所选条件。

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/v100-cosine-periodic-kk
tail -n 35 native.out

本次第一组的原生日志片段如下。

Loop time of 5.7482e-05 on 1 procs for 0 steps with 3 atoms
Loop time of 4.3771e-05 on 1 procs for 0 steps with 3 atoms
Loop time of 3.7682e-05 on 1 procs for 0 steps with 3 atoms
Loop time of 3.7662e-05 on 1 procs for 0 steps with 3 atoms
Loop time of 3.8663e-05 on 1 procs for 0 steps with 3 atoms
Total wall time: 0:00:00

原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 energies.dat, forces-00.dump, forces-01.dump, forces-02.dump, forces-03.dump, forces-04.dump。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。

再次运行前,将已有的同名 work-new 条件目录改名保存。

本次输出示例#

第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。

   Step        Atoms        PotEng        E_angle    
         0           3  4.4444444444444446e+00 4.4444444444444446e+00
Loop time of 5.7482e-05 on 1 procs for 0 steps with 3 atoms

需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

放大后可滚动查看细节,按 Esc 关闭。

100%查看原图 ↗