LAMMPS

LAMMPS

LAMMPS即Large-scale Atomic/Molecular Massively Parallel Simulator,可以翻譯為大規模原子分子並行模擬器,主要用於分子動力學相關的一些計算和模擬工作,一般來講,分子動力學所涉及到的領域,LAMMPS代碼也都涉及到了。

基本介紹

  • 中文名:LAMMPS
  • 外文名:Large-scale Atomic/Molecular Massively Parallel Simulator
  • 開發者:美國Sandia國家實驗室
  • 發布人:GPL license
  • 一般特點:支持並進行計算等
  • 性質:有良好的並行擴展性
簡介,一般特點,代碼開源,LAMMPS編譯安裝,安裝fftw,安裝mpich,編輯/etc/hosts.equiv檔案,安裝lammps,

簡介

LAMMPS由美國Sandia國家實驗室開發,以GPL license發布,即開放原始碼且可以免費獲取使用,這意味著使用者可以根據自己的需要自行修改原始碼。LAMMPS可以支持包括氣態,液態或者固態相形態下、各種系綜下、百萬級的原子分子體系,並提供支持多種勢函式。且LAMMPS有良好的並行擴展性。

一般特點

分散式記憶體MPI
spatial-decomposition of simulation domain for parallelism

代碼開源

C++可拓展性好
optional libraries used: MPI and single-processor FFT
easy to extend with new features and functionality
runs from an input script
syntax for defining and using variables and formulas
syntax for looping over runs and breaking out of loops
run one or multiple simulations simultaneously (in parallel) from one script

LAMMPS編譯安裝

切換到根目錄(root)
sudo -s

安裝fftw

1下載源碼包fftw-2.1.5.tar.gz,解壓 tar xvzf fftw-2.1.5.tar.gz
2 cd fftw-2.1.5.
3 ./configure --prefix=/opt/mathlib/fftw215-gnu --enable-float
其它選項:
4 make
5 make install

安裝mpich

1下載mpich.tar.gz
2 cd mpich-1.2.7**
3 ./configure --prefix=/opt/mpich-gnu
4 make
5 make install

編輯/etc/hosts.equiv檔案

,在其中加入本機主機名(用hostname可以得到),單獨一行!
前三步都在root下進行。
下面的步驟都在自己的用戶中進行

安裝lammps

1 tar xvzf lammps.tar.gz
2 cd lammps**
3 cd src
4 vim MAKE/Makefile.g++
修改mpich安裝路徑
修改fftw安裝路徑
(每個都有兩處,include前面和lib前面的部分)
# g++ = RedHat Linux box, g++, MPICH2, FFTW
SHELL = /bin/sh
# System-specific settings
CC = g++
CCFLAGS = -g -O -DFFT_FFTW -DLAMMPS_GZIP -
DMPICH_IGNORE_CXX_SEEK -I/opt/mathlib/fftw215-gnu/include -I/opt/mpich-
gnu/include
DEPFLAGS = -M
LINK = g++ -L/opt/mathlib/fftw215-gnu/lib -L/opt/mpich-
gnu/lib
LINKFLAGS = -g -O
USRLIB = -lfftw -lmpich
SYSLIB = -lpthread
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size
# Link target
$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(OBJ) $(USRLIB) $(SYSLIB) -o $(EXE)
$(SIZE) $(EXE)
# Library target
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# Individual dependencies
DEPENDS = $(OBJ:.o=.d)
include $(DEPENDS)
5 make g++ (在src目錄下)
生成lmp_g++
四 運行lammps
1 cd ../bench
2 /opt/mpich-gnu/bin/mpirun -np 16 ../src/lmp_g++ <in.chain

相關詞條

熱門詞條

聯絡我們