MD常用命令总结

Packmol + Moltemplate

packmol < packmol.inp
moltemplate.sh -pdb model_box.pdb system.lt
mpirun -np 16 lmp -in Layer.in

将Materials studio的文件转化为LAMMPS可用的data文件

.\msi2lmp.exe .\Layer -i -frc ..\frc_files\cvff.frc
.\msi2lmp.exe .\Layer -c 2 -frc ..\frc_files\pcff.frc
备注:powershell打开。其中Layer是文件名,注意没有后缀。

运行MS-MPI版的LAMMPS

mpiexec -n 8 lmp.exe -in Layer.in
mpiexec -n 8 lmp -in Layer.in -pk omp 2 -sf omp
备注: powershell打开。其中的8是指使用8个进程,Layer是in文件名称。第一行比较适用于8和8线程的cpu,第二行方案适用于希望榨干cpu性能,且cpu支持双线程的那种,并且lammps要有openmpi包。

停止运行MS-MPI版的LAMMPS

Ctrl + C
备注:在powershell中输入即可中断

Gaussian在Linux下运行的命令

Gaussian在Linux下的运行方法,常见有以下几种,test.gjf是输入文件
g09 < test.gjf > test.out (信息都输出到test.out里。末尾可以再加上&令任务在后台运行)
g09 < test.gjf |tee test.out (信息输出到test.out的同时也同时输出到屏幕上)
g09 test.gjf (输出文件将默认为当前目录下的test.log)

以上面第1种或第3种方式运行时,如果你又想把输出信息在屏幕上不断同步显示了,那么可以运行tail -f test.out。

使用SSH远程登录服务器时,如果提交了Gaussian任务,则与服务器连接中断后任务也相应地中断。为了能让任务在断开连接后也能一直在服务器上继续跑完,提交任务时应当写
nohup g09 < test.gjf > test.out &
并且退出时要用exit命令先优雅地断开连接,而不要直接关终端。这样任务就会在服务器上继续跑直到完成。

从G16开始,如果在gjf里没定义%nprocs、%cpu、%mem,也可以在运行命令里方便地直接指定,比如
g16 -p=16 -m="40GB" < love.gjf > love.out
相对于定义了%nprocs=16和%mem=40GB。再比如
g16 -c="0-47" < live.gjf > live.out
相对于定义了%cpu=0-47只在第0~47号CPU核心上计算。命令行里直接指定参数的优先级高于Default.Route。

posted @ 2026-04-18 20:35  sqzzfb  阅读(37)  评论(0)    收藏  举报