LAMMPS 电子力场与系综设置
用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。
阅读本篇目录
下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 7 个已完成条件,按输入保留相互作用与操作参数。
选择条件#
解压并进入 lammps-eff-ensemble-dependencies-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。
| 条件目录 | 主要样式 | 运行模式 |
|---|---|---|
scalar-variable-history-consumer-v100-rescale-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix nve/eff, fix temp/rescale/eff |
gpu |
scalar-variable-history-consumer-v100-SLLOD-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix deform, compute temp/deform/eff, fix nvt/sllod/eff |
gpu |
scalar-variable-history-consumer-p100-NVT-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix nvt/eff |
gpu |
scalar-variable-history-consumer-p100-NPT-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix npt/eff |
gpu |
scalar-variable-history-consumer-p100-NPH-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix nph/eff |
gpu |
scalar-variable-history-consumer-p100-Langevin-eFF |
pair_style eff/cut, compute temp/eff, compute pressure, compute temp/region/eff, compute ke/atom/eff, compute reduce, compute property/atom, fix ave/time, dump custom, fix nve/eff, fix langevin/eff |
gpu |
producer-p100-H2-128-ground-geometry |
pair_style eff/cut, min_style cg, compute temp/eff, compute pressure |
gpu |
输入与提交#
第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。
units electron
newton on
boundary p p p
atom_style electron
read_data start.data
pair_style eff/cut 6.447968 pressure/evirials
pair_coeff * *
comm_modify vel yes
neighbor 1.0 bin
neigh_modify every 1 delay 0 check yes
compute Te all temp/eff
compute Pe all pressure Te
thermo 10
thermo_style custom step atoms pe ke etotal temp press vol
thermo_modify temp Te press Pe
timestep .001
velocity all create 300.0 4928459 rot yes mom yes dist gaussian
region half block INF 6.447968 INF INF INF INF units box
compute Tr all temp/region/eff half
compute Ka all ke/atom/eff
compute Ks all reduce sum c_Ka
compute er all property/atom spin eradius ervel
thermo_style custom step atoms pe ke etotal temp press vol c_Tr c_Ks
thermo_modify temp Te press Pe
variable Vhist equal vol
fix hist all ave/time 10 1 10 c_Te c_Tr c_Ks c_Pe v_Vhist file ensemble-history.dat
dump atom all custom 100 trajectory.lammpstrj id type q c_er[1] c_er[2] c_er[3] x y z vx vy vz fx fy fz c_Ka
dump_modify atom sort id
fix int all nve/eff
fix bath all temp/rescale/eff 10 300 300 .02 1.0
run 1000
write_data final.data nocoeff
write_restart final.restart
在附件根目录提交第一组或所选条件。
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/scalar-variable-history-consumer-v100-rescale-eFF
tail -n 35 native.out
本次第一组的原生日志片段如下。
Loop time of 0.202541 on 1 procs for 1000 steps with 128 atoms
Total wall time: 0:00:00
原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 ensemble-history.dat, final.data。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。
再次运行前,将已有的同名 work-new 条件目录改名保存。
本次输出示例#
第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。
Step Atoms PotEng KinEng TotEng Temp Press Volume c_Tr c_Ks
0 128 -29.402735 0.1809835 -29.221751 604.7619 5.9749969e+10 2144.6608 660.80732 0.1809835
10 128 -29.402721 0.089779215 -29.312942 300 5.8913656e+10 2144.6608 327.80247 0.089779215
20 128 -29.402695 0.089779215 -29.312916 300 5.8912175e+10 2144.6608 327.80406 0.089779215
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。