LAMMPS Green 函数声子操作
用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。
阅读本篇目录
下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 3 个已完成条件,按输入保留相互作用与操作参数。
选择条件#
解压并进入 lammps-green-function-phonons-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。
| 条件目录 | 主要样式 | 运行模式 |
|---|---|---|
FCC-Cu |
pair_style eam/omp, fix npt, fix phonon |
gpu |
diatomic-chain |
bond_style harmonic, pair_style none, compute temp/partial, fix langevin, fix setforce, fix nve, fix phonon |
gpu |
monoatomic-chain |
bond_style harmonic, pair_style none, compute temp/partial, fix langevin, fix setforce, fix nve, fix phonon, dump atom |
gpu |
输入与提交#
第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。
# 3D copper block simulation
boundary p p p
units metal
atom_style atomic
# geometry
read_data data.pos
# EAM potential
pair_style eam/omp
pair_coeff * * cuu3.eam
neighbor 0.5 nsq
neigh_modify every 1 delay 0 check yes
#Langevin random seed
variable r equal 57085
variable t equal 300
variable d equal 1
# initialize
velocity all create $t 28459 rot yes dist gaussian mom yes
reset_timestep 0
# fixes
fix 1 all npt temp $t $t $d iso 1. 1. 1. pchain 8 drag 1.0
fix 2 all phonon 10 50000 100000 map.in CuPhonon
#
timestep 2e-3
# output
# 1 2 3 4 5 6 7 8 9 10 11 12
thermo_style custom step temp pe ke press vol lx ly lz xy xz yz
thermo 100
restart 200000 restart.one restart.two
# execution
run 1000000
write_restart Restart.final
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/FCC-Cu
tail -n 35 native.out
本次第一组的原生日志片段如下。
Step Temp PotEng KinEng Press Volume Lx Ly Lz Xy Xz Yz
Loop time of 200.213 on 8 procs for 1000000 steps with 512 atoms
Total wall time: 0:03:20
原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 final.data。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。
再次运行前,将已有的同名 work-new 条件目录改名保存。
本次输出示例#
第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。
Step Temp PotEng KinEng Press Volume Lx Ly Lz Xy Xz Yz
0 300 -1812.48 19.81558 3500.1579 6046.9291 20.449528 17.709811 16.69697 10.224764 10.224764 5.9032703
100 153.63448 -1802.7317 10.147854 9986.2625 6046.0365 20.448522 17.708939 16.696148 10.224261 10.224261 5.9029798
200 147.67118 -1802.0348 9.7539669 6250.7952 6065.0621 20.469948 17.727495 16.713643 10.234974 10.234974 5.9091651
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。