必威电竞|足球世界杯竞猜平台

LAMMPS
來源:互聯網

LAMMPS是Large-scale Atomic/Molecular Massively Parallel Simulator的簡稱,是Sandia國家實驗室開發的程序。以GPL license發布,即開放源代碼且可以免費獲取使用,這意味著使用者可以根據自己的需要自行修改源代碼。

簡介

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 xvzflammps.tar.gz

2 cdlammps**

3 cd src

4 VIM MAKE/Makefile.g++

修改mpich的安裝路徑

修改fftw的安裝路徑

(每個都有兩處,include前面和天秤座前面的部分)

# g++ = RedHat Linux box, g++, MPICH2, FFTW

殼層 = /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/天秤座

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

天秤座: $(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++

參考資料 >

生活家百科家居網