| 3 | 1/1 | 返回列表 |
| 查看: 1652 | 回復(fù): 2 | ||||
| 【獎(jiǎng)勵(lì)】 本帖被評(píng)價(jià)2次,作者Bessel增加金幣 1.6 個(gè) | ||||
| 本帖產(chǎn)生 1 個(gè) 模擬EPI ,點(diǎn)擊這里進(jìn)行查看 | ||||
Bessel木蟲 (正式寫手)
|
[資源]
LAMMPS使用初體驗(yàn),Debian 6.0
|
|||
|
我是在Debian 6.0下編譯安裝的, 也在Ubuntu 10.04下編譯通過。首先介紹一下并行編譯的過程,然后以L-J相互作用勢(shì)的液體為例,給出了in文件的寫法。歡迎大家補(bǔ)充。 第一部分,安裝 《1》首先安裝所有依賴的包: sudo aptitude install mpich-bin libmpich1.0gf libmpich1.0-dev fftw2 fftw-dev libjpeg62 libjpeg62-dev libblas-dev liblapack-dev gfortran gcc make build-essential autoconf automake1.9 cvs subversion libsdl-dev libgl1-mesa-dev fakeroot libnss3-dev gdb libglib2.0-0 libglib-perl dh-make cdbs debhelper kernel-package lsb-release module-assistant 《2》取消SSH的密碼步驟 $ ssh-keygen -t dsa #中間提示輸入密碼,直接回車,會(huì)在生成文件~/.ssh/id_dsa.pub $ cat id_dsa.pub >> authorized_keys 這樣在運(yùn)行mpirun的時(shí)候就不會(huì)有密碼輸入提示了 《3》下載lammps最新的安裝包 http://lammps.sandia.gov/ 《4》開始編譯安裝 (1) go to ~/lammps/src: 運(yùn)行如下命令: make yes-all make no-gpu make no-user-atc (2) go to ~/lammps/lib/meam 運(yùn)行如下命令: make -f Makefile.gfortran (3) go to ~/lammps/lib/poems 運(yùn)行如下命令: make -f Makefile.g++ (4) go to ~/lammps/lib/reax make -f Makefile.gfortran (5) go to ~/lammps/lib/awpmd <5.1> go to ~/lammps/lib/awpmd/ivutils/include 在 logexc.h文件開頭補(bǔ)上 #include <5.2> go to the ~/lammps/lib/awpmd 修改 Makefile.openmpi文件, 把mpic++改為g++,修改完的樣子應(yīng)該是: # include any MPI settings needed for the ATC library to build with # the same MPI library that LAMMPS is built with CC = g++ ...... 修改完之后,運(yùn)行 make -f Makefile.openmpi (6) go to ~/lammps/src/MAKE 修改Makefile.g++文件,下面是修改之后的文件: # g++ = RedHat Linux box, g++4, gfortran, MPICH2, FFTW SHELL = /bin/sh # --------------------------------------------------------------------- # compiler/linker settings # specify flags and libraries needed for your compiler CC = g++ CCFLAGS = -g -O DEPFLAGS = -M LINK = g++ LINKFLAGS = -g -O LIB = ARCHIVE = ar ARFLAGS = -rc SIZE = size # --------------------------------------------------------------------- # LAMMPS-specific settings # specify settings for LAMMPS features you will use # LAMMPS ifdef options, see doc/Section_start.html LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG # MPI library, can be src/STUBS dummy lib # INC = path for mpi.h, MPI compiler settings # PATH = path for MPI library # LIB = name of MPI library MPI_INC = -I/usr/lib/mpich/include MPI_PATH = -I/usr/lib/mpich/lib MPI_LIB = /usr/lib/mpich/lib/libmpich.a # FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package # INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings # PATH = path for FFT library # LIB = name of FFT library FFT_INC = -I/usr/include -DFFT_FFTW FFT_PATH = -I/usr/lib FFT_LIB = /usr/lib/libfftw.a # JPEG library, only needed if -DLAMMPS_JPEG listed with LMP_INC # INC = path for jpeglib.h # PATH = path for JPEG library # LIB = name of JPEG library JPG_INC = -I/usr/include JPG_PATH = -I/usr/lib JPG_LIB = /usr/lib/libjpeg.a # additional system settings needed by LAMMPS package libraries # these settings are IGNORED if the corresponding LAMMPS package # (e.g. gpu, meam) is NOT included in the LAMMPS build # SYSINC = settings to compile with # SYSLIB = libraries to link with # SYSPATH = paths to libraries gpu_SYSINC = meam_SYSINC = reax_SYSINC = user-atc_SYSINC = user-awpmd_SYSINC = gpu_SYSLIB = -lcudart -lcuda meam_SYSLIB = -lgfortran reax_SYSLIB = -lgfortran user-atc_SYSLIB = -lblas -llapack user-awpmd_SYSLIB = -lblas -llapack gpu_SYSPATH = -L/usr/local/cuda/lib64 meam_SYSPATH = reax_SYSPATH = user-atc_SYSPATH = user-awpmd_SYSPATH = # --------------------------------------------------------------------- # build rules and dependencies # no need to edit this section include Makefile.package EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) (PKG_SYSINC) EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH) EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB) # Link target $(EXE): $(OBJ) $(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) (LIB) -o $(EXE) $(SIZE) $(EXE) # Library target lib: $(OBJ) $(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ) # Compilation rules %.o:%.cpp $(CC) $(CCFLAGS) $(EXTRA_INC) -c $< %.d:%.cpp $(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@ # Individual dependencies DEPENDS = $(OBJ:.o=.d) include $(DEPENDS) (7) go to src 運(yùn)行命令: make g++ 最后在src文件夾下找到lmp_g++可執(zhí)行文件,編輯就算是結(jié)束了?梢园裭mp_g++放到/usr/local/bin文件夾下,以后用著方便。 (8)L-J液體的in文件 in.lj, 具體命令的介紹可以參考lammps manual # LJ system with NVE ensemble units lj atom_style atomic lattice fcc 0.8442 region box block 0 5 0 5 0 5 create_box 1 box create_atoms 1 box mass 1 1.0 velocity all create 3.0 825577 dist gaussian pair_style lj/cut 2.5 pair_coeff * * 1.0 1.0 2.5 neighbor 0.3 bin neigh_modify every 20 delay 0 check no fix 1 all nve timestep 0.005 thermo 1000 run 10000 clear (9)最后運(yùn)行mpirun –np 2 /usr/local/bin/lmp_g++ |
資源收集 | condensed matter physics |
| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 295求調(diào)劑 +3 | 一志愿京區(qū)211 2026-03-18 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 0703化學(xué)調(diào)劑 +3 | 妮妮ninicgb 2026-03-17 | 3/150 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +6 | 困于星晨 2026-03-17 | 6/300 |
|
|
[考研] 265求調(diào)劑 +3 | 梁梁校校 2026-03-17 | 3/150 |
|
|
[基金申請(qǐng)] 被我言中:新模板不強(qiáng)調(diào)格式了,假專家開始管格式了 +4 | beefly 2026-03-14 | 4/200 |
|
|
[考研] 東南大學(xué)364求調(diào)劑 +5 | JasonYuiui 2026-03-15 | 5/250 |
|
|
[考研] 機(jī)械專碩325,尋找調(diào)劑院校 +3 | y9999 2026-03-15 | 5/250 |
|
|
[考研] 304求調(diào)劑 +4 | ahbd 2026-03-14 | 4/200 |
|
|
[考研] 318求調(diào)劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 26考研一志愿中國(guó)石油大學(xué)(華東)305分求調(diào)劑 +3 | 嘉年新程 2026-03-15 | 3/150 |
|
|
[考研] 265求調(diào)劑 +4 | 威化餅07 2026-03-12 | 4/200 |
|
|
[考研] 304求調(diào)劑 +6 | Mochaaaa 2026-03-12 | 7/350 |
|
|
[考研] [0860]321分求調(diào)劑,ab區(qū)皆可 +4 | 寶貴熱 2026-03-13 | 4/200 |
|
|
[考研] 考研調(diào)劑 +4 | 芬達(dá)46 2026-03-12 | 4/200 |
|
|
[考研] 一志愿211化學(xué)學(xué)碩310分求調(diào)劑 +8 | 努力奮斗112 2026-03-12 | 9/450 |
|
|
[考研] 一志愿山大07化學(xué) 332分 四六級(jí)已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-12 | 3/150 |
|
|
[論文投稿]
投稿問題
5+4
|
星光燦爛xt 2026-03-12 | 6/300 |
|
|
[考研] 321求調(diào)劑(食品/專碩) +3 | xc321 2026-03-12 | 6/300 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +3 | 崔wj 2026-03-12 | 4/200 |
|