[toc]
- Windows下Lammps安装
官网下载Windows版Lammps,和并行包mpich2 ; 2.下载完成后,直接双击LAMMPS-64bit-stable-MPI.exe
安装,可以自定义安装位置;
Similarly,接着安装MPICH2mpich2-1.4.1p1-win-x86-64.msi
;
完了之后,进入到Administrator
用户下操作,win+R
输入cmd
,调出cmd窗口;
cd
到MPICH2安装目录的bin
下,也即是D:\Program Files\MPICH2\bin
;
然后,输入命令:smpd.exe -install -phrase behappy
;
别忘记设置环境变量,即是将对应的Lammps@MPICH2路径加入到path中:D:\Program Files\LAMMPS 64-bit 7Aug2019-MPI\bin
,D:\Program Files\MPICH2\bin
怎么设置环境变量:
鼠标右键此电脑
;点开高级系统设置
;找到高级
;点开右下角环境变量(N)
;
在系统变量下path
中找找看,是否已经设置;若没有,点击新建,将路径复制过来,确定即可
至此,完成,可以进入lammps目录下Examples
中测试一下并行;例如:mpiexec -np 8 lmp_mpi -i inputfile.in
;具体看官网
- Linux下Lammps并行安装 1. 安装必要的编译器
安装/更新必要的C/C++编译器等:1 2 3 4 5 6 sudo apt-get upgrade sudo apt-get update sudo apt-get install gcc sudo apt-get install g++ sudo apt-get install gfortran sudo apt-get install make
2. 并行计算程序MIPCH安装 本地安装
官网MPICH安装包 ,或者https://src.fedoraproject.org/repo/pkgs/mpich/ 下载并解压:1 2 3 4 5 6 wget https://www.mpich.org/static/downloads/4.1.1/mpich-4.1.1.tar.gz tar -zxvf mpich-4.1.1.tar.gz cd mpich-4.1.1./configure --prefix=/opt/mpich 2>&1|tee c.txt make 2>&1|tee m.txt make install 2>&1|tee mi.txt
完成MPICH安装,接着把mpich的安装路径添加到环境变量中,参考这里
apt 安装 1 sudo apt-get install mpich
3. FFTW3安装
4. LAMMPS安装
下载安装包 , 解压:1 2 wget https://download.lammps.org/tars/lammps-3Mar2020.tar.gz tar -zxvf lammps-3Mar2020.tar.gz
进入解压文件夹内:
修改src/MAKE/Makefile.mpi中FFTW路径(可选,若默认安装FFTW路径则无需修改)
1 2 3 FFT_INC = -DFFT_FFTW3 -I/home/xxx/fftw/fftw3310/include FFT_PATH = -L/home/xxx/fftw/fftw3310/lib FFT_LIB = -lfftw3
1 2 make ps make package-status
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Installed NO: package ASPHERE Installed NO: package BODY Installed NO: package CLASS2 Installed NO: package COLLOID Installed NO: package COMPRESS Installed NO: package CORESHELL Installed NO: package DIPOLE Installed NO: package GPU Installed NO: package GRANULAR Installed NO: package KIM Installed NO: package KOKKOS Installed NO: package KSPACE Installed NO: package LATTE Installed NO: package MANYBODY Installed NO: package MC Installed NO: package MESSAGE Installed NO: package M ISC Installed NO: package MOLECULE Installed NO: package MPIIO Installed NO: package MSCG Installed NO: package OPT Installed NO: package PERI Installed NO: package POEMS Installed NO: package PYTHON Installed NO: package QEQ Installed NO: package REPLICA Installed NO: package RIGID Installed NO: package SHOCK Installed NO: package SNAP Installed NO: package SPIN Installed NO: package SRD Installed NO: package VORONOI
1 2 3 make yes-BODY yes-MANYBODY yes-CLASS2 yes-KSPACE yes-MISC yes-MOLECULE yes-RIGID
待编译完成后,LAMMPS就安装成功了。
注意如果提示mpicxx:command not found
的错误,是由于mpich的环境变量没有添加成功;
进入lammps-stable/examples
中任意测试一个例子;
运行lammps,例如:
1 2 3 mpirun -np 4 lmp_mpi -i in.atm mpiexec -np 4 lmp_mpi -i in.atm
注意 :记得在~/.bashrc
中设置/home/.../lammps-stable/src
环境变量
[1] https://cloud.tencent.com/developer/article/1484595