LAMMPS 其他加速实现的显式调用
用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。
阅读本篇目录
下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 6 个已完成条件,按输入保留相互作用与操作参数。
选择条件#
解压并进入 lammps-remaining-accelerator-implementations-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。
| 条件目录 | 主要样式 | 运行模式 |
|---|---|---|
p100-matched-peridynamic-lps-OMP |
pair_style peri/lps/omp, fix nve, fix indent, compute damage/atom, compute reduce, compute dilatation/atom, dump custom |
gpu |
p100-Ni108-Kokkos-GPU-dynamical-matrix |
pair_style eam/kk |
kokkos |
p100-matched-peridynamic-pmb-OMP |
pair_style peri/pmb/omp, fix nve, fix indent, compute damage/atom, compute reduce, dump custom |
gpu |
p100-matched-COMB-OMP-charge-equilibration |
pair_style comb/omp, fix qeq/comb/omp, compute pe/atom, compute reduce, compute property/atom |
gpu |
v100-Morse-dimer-Kokkos-GPU-third-order |
pair_style morse/kk |
kokkos |
v100-matched-polymer-OMP-RESPA |
pair_style lj/cut/omp, bond_style harmonic/omp, fix nve, dump custom |
gpu |
输入与提交#
第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。
# small Peridynamic cylinder hit by projectile
units si
boundary s s s
atom_style peri
atom_modify map array
neighbor 0.0010 bin
# small target
lattice sc 0.0005
region target cylinder y 0.0 0.0 0.0050 -0.0050 0.0 units box
create_box 1 target
create_atoms 1 region target
pair_style peri/lps/omp
pair_coeff * * 14.9e9 14.9e9 0.0015001 0.0005 0.25
set group all density 2200
set group all volume 1.25e-10
velocity all set 0.0 0.0 0.0 sum no units box
fix 1 all nve
# spherical indenter to shatter target
variable y0 equal 0.00155
variable vy equal -100
variable y equal "v_y0 + step*dt*v_vy"
fix 2 all indent 1e17 sphere 0.0000 v_y 0.0000 0.0015 units box
compute 1 all damage/atom
timestep 1.0e-7
thermo 100
#dump 1 all custom 100 dump.peri id type x y z c_1
#dump 2 all image 50 image.*.jpg type type &
# axes yes 0.8 0.02 view 80 -30 adiam 0.0006
#dump_modify 2 pad 4
#dump 3 all movie 50 movie.mpg type type &
# axes yes 0.8 0.02 view 80 -30 adiam 0.0006
#dump_modify 3 pad 4
# Own native time-resolved exports; source constitutive parameters unchanged.
compute avgdamage all reduce ave c_1
compute dilation all dilatation/atom
thermo_style custom step atoms ke pe etotal c_avgdamage
thermo 100
dump history all custom 100 atoms-history.dump id type x y z vx vy vz fx fy fz c_1 c_dilation
dump_modify history sort id format float %.16e
run 1000
write_data final.data
在附件根目录提交第一组或所选条件。
sbatch --array=0 run.slurm
# 按 CASES 的完整列表提交
sbatch run.slurm
脚本申请一个 MPI 任务、一个 CPU 核和一张 P100,根据 MODES 加载对应模块。实际调用保存在 cases.json,例如第一组的命令参数为:
lmp -k off -pk omp 1 -echo both -in in.lammps > native.out
查看输出#
结果写入 work-new/条件名。先查看日志中的实际热力学表与结束信息。
cd work-new/p100-matched-peridynamic-lps-OMP
tail -n 35 native.out
本次第一组的原生日志片段如下。
Loop time of 6.57509 on 4 procs for 1000 steps with 3487 atoms
Total wall time: 0:00:06
原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 final.data。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。
再次运行前,将已有的同名 work-new 条件目录改名保存。
本次输出示例#
第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。
Step Atoms KinEng PotEng TotEng c_avgdamage
0 3487 0 0 0 0
100 3487 21717905 2662435 24380340 0.001550126
200 3487 2.6323873e+08 24676526 2.8791526e+08 0.033712918
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。