官网
http://lammps.sandia.gov/ 。
简介
LAMMPS(Large-scale Atomic/Molecular Massively Parallel Simulator)是一款经典分子动力学软件。LAMMPS包含的势可用于固体材料(金属、半导体)、软物质(生物大分子,聚合物)、粗粒化或介观尺度模型体系。
算例 1 “3d Lennard-Jones melt”
准备工作
运行以下示例需要在创建集群时选择安装LAMMPS相关软件包。
同时还需选择所依赖的相关MPI库
操作步骤
1.运行 module avail,查看是否已安装 LAMMPS 软件。
- [backcolor=transparent]$ export MODULEPATH[backcolor=transparent]=/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]ehpcmodulefiles[backcolor=transparent]/
- [backcolor=transparent]$ module avail
- [backcolor=transparent]------------------------------[backcolor=transparent] [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]ehpcmodulefiles [backcolor=transparent]-------------------------------------
- [backcolor=transparent]lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]mpich lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]openmpi mpich[backcolor=transparent]/[backcolor=transparent]3.2[backcolor=transparent].[backcolor=transparent]2[backcolor=transparent] openmpi[backcolor=transparent]/[backcolor=transparent]1.10[backcolor=transparent].[backcolor=transparent]7
2.运行 module load 加载LAMMPS。
- [backcolor=transparent]$ module load lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]mpich
- [backcolor=transparent]$ module load mpich
- [backcolor=transparent]$ which lmp
- [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]mpich[backcolor=transparent]/[backcolor=transparent]lmp
3.进入算例目录,有以下作业提交方式。
- [backcolor=transparent]$ srun [backcolor=transparent]--[backcolor=transparent]mpi[backcolor=transparent]=[backcolor=transparent]pmi2 [backcolor=transparent]-[backcolor=transparent]N [backcolor=transparent]2[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]n [backcolor=transparent]4[backcolor=transparent] lmp [backcolor=transparent]-[backcolor=transparent]in[backcolor=transparent] [backcolor=transparent]in[backcolor=transparent].[backcolor=transparent]intel[backcolor=transparent].[backcolor=transparent]lj
- [backcolor=transparent]LAMMPS [backcolor=transparent]([backcolor=transparent]31[backcolor=transparent] [backcolor=transparent]Mar[backcolor=transparent] [backcolor=transparent]2017[backcolor=transparent])
- [backcolor=transparent]Lattice[backcolor=transparent] spacing [backcolor=transparent]in[backcolor=transparent] x[backcolor=transparent],[backcolor=transparent]y[backcolor=transparent],[backcolor=transparent]z [backcolor=transparent]=[backcolor=transparent] [backcolor=transparent]1.6796[backcolor=transparent] [backcolor=transparent]1.6796[backcolor=transparent] [backcolor=transparent]1.6796
- [backcolor=transparent]Created[backcolor=transparent] orthogonal box [backcolor=transparent]=[backcolor=transparent] [backcolor=transparent]([backcolor=transparent]0[backcolor=transparent] [backcolor=transparent]0[backcolor=transparent] [backcolor=transparent]0[backcolor=transparent])[backcolor=transparent] to [backcolor=transparent]([backcolor=transparent]134.368[backcolor=transparent] [backcolor=transparent]67.1838[backcolor=transparent] [backcolor=transparent]67.1838[backcolor=transparent])
- [backcolor=transparent]2[backcolor=transparent] by [backcolor=transparent]1[backcolor=transparent] by [backcolor=transparent]2[backcolor=transparent] MPI processor grid
- [backcolor=transparent]Created[backcolor=transparent] [backcolor=transparent]512000[backcolor=transparent] atoms
- [backcolor=transparent]...[backcolor=transparent] [backcolor=transparent]...
- [backcolor=transparent]$ cat job[backcolor=transparent].[backcolor=transparent]sh [backcolor=transparent]# 作业内容
- [backcolor=transparent]#!/usr/bin/env bash
- [backcolor=transparent]mpirun lmp [backcolor=transparent]-[backcolor=transparent]in[backcolor=transparent] [backcolor=transparent]./[backcolor=transparent]in[backcolor=transparent].[backcolor=transparent]intel[backcolor=transparent].[backcolor=transparent]lj
- [backcolor=transparent]$ sbatch [backcolor=transparent]-[backcolor=transparent]N [backcolor=transparent]2[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]n [backcolor=transparent]4[backcolor=transparent] [backcolor=transparent]./[backcolor=transparent]job[backcolor=transparent].[backcolor=transparent]sh [backcolor=transparent]# 提交作业
- [backcolor=transparent]Submitted[backcolor=transparent] batch job [backcolor=transparent]235
- [backcolor=transparent]$ squeue [backcolor=transparent]# 查看作业
- [backcolor=transparent] JOBID PARTITION NAME USER ST TIME NODES NODELIST[backcolor=transparent]([backcolor=transparent]REASON[backcolor=transparent])
- [backcolor=transparent] [backcolor=transparent]235[backcolor=transparent] comp job[backcolor=transparent].[backcolor=transparent]sh user R [backcolor=transparent]0[backcolor=transparent]:[backcolor=transparent]03[backcolor=transparent] [backcolor=transparent]2[backcolor=transparent] s[backcolor=transparent][[backcolor=transparent]02[backcolor=transparent]-[backcolor=transparent]03[backcolor=transparent]]
- [backcolor=transparent]$ salloc [backcolor=transparent]-[backcolor=transparent]N [backcolor=transparent]2[backcolor=transparent] mpirun [backcolor=transparent]-[backcolor=transparent]n [backcolor=transparent]4[backcolor=transparent] lmp [backcolor=transparent]-[backcolor=transparent]in[backcolor=transparent] [backcolor=transparent]in[backcolor=transparent].[backcolor=transparent]intel[backcolor=transparent].[backcolor=transparent]lj
- [backcolor=transparent]salloc[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]Granted[backcolor=transparent] job allocation [backcolor=transparent]236
- [backcolor=transparent]salloc[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]Waiting[backcolor=transparent] [backcolor=transparent]for[backcolor=transparent] resource configuration
- [backcolor=transparent]salloc[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]Nodes[backcolor=transparent] s[backcolor=transparent][[backcolor=transparent]02[backcolor=transparent]-[backcolor=transparent]03[backcolor=transparent]][backcolor=transparent] are ready [backcolor=transparent]for[backcolor=transparent] job
- [backcolor=transparent]LAMMPS [backcolor=transparent]([backcolor=transparent]31[backcolor=transparent] [backcolor=transparent]Mar[backcolor=transparent] [backcolor=transparent]2017[backcolor=transparent])
- [backcolor=transparent]$ cat [backcolor=transparent]>[backcolor=transparent] lammps_single_node[backcolor=transparent].[backcolor=transparent]pbs
- [backcolor=transparent]#!/bin/sh
- [backcolor=transparent]#PBS -l ncpus=28,mem=12gb
- [backcolor=transparent]#PBS -l walltime=00:10:00
- [backcolor=transparent]#PBS -o lammps_pbs.log
- [backcolor=transparent]#PBS -j oe
- [backcolor=transparent]cd [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]openmpi[backcolor=transparent]/[backcolor=transparent]src
- [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]openmpi[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]mpirun [backcolor=transparent]-[backcolor=transparent]np [backcolor=transparent]28[backcolor=transparent] [backcolor=transparent]/[backcolor=transparent]opt[backcolor=transparent]/[backcolor=transparent]lammps[backcolor=transparent]/[backcolor=transparent]31Mar17[backcolor=transparent]-[backcolor=transparent]openmpi[backcolor=transparent]/[backcolor=transparent]bin[backcolor=transparent]/[backcolor=transparent]lmp_mpi [backcolor=transparent]-[backcolor=transparent]sf gpu [backcolor=transparent]-[backcolor=transparent]pk gpu [backcolor=transparent]2[backcolor=transparent] [backcolor=transparent]-[backcolor=transparent]in[backcolor=transparent] [backcolor=transparent]./[backcolor=transparent]in[backcolor=transparent].[backcolor=transparent]intel[backcolor=transparent].[backcolor=transparent]lj [backcolor=transparent]-[backcolor=transparent]v m [backcolor=transparent]0.1
- [backcolor=transparent]$ qsub lammps_single_node[backcolor=transparent].[backcolor=transparent]pbs