| 3 | 1/1 | 返回列表 |
| 查看: 2173 | 回復(fù): 2 | |||
| 【獎(jiǎng)勵(lì)】 本帖被評(píng)價(jià)1次,作者Birdofwander增加金幣 0.6 個(gè) | |||
[資源]
使用gfortran和openmpi并行編譯SIESTA(原創(chuàng))
|
|||
|
使用gfortran和openmpi并行編譯SIESTA Openmpi安裝 1. ./configure --prefix=/home/chengxl/sourcecode/openmpi-gnu CC=gcc CXX=g++ F77=gfortran FC=gfortran 2. make all 3. make install4. 打開 ~/.bashrc 添加環(huán)境變量 export PATH=/usr/local/openmpi-1.4.3/bin:$PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/openmpi-1.4.3/lib5. source ~/.bashrc(重新打開終) 并驗(yàn)證 which mpicc which mpic++ which mpif77 which mpif90 安裝 lapack 下載:http://www.netlib.org/lapack cp make.example.inc make.inc 并修改以下幾行: BLASLIB = /your/path/to/lapack-3.4.2/librefblas.a # 將要?jiǎng)?chuàng)建一個(gè)librefblas.a LAPACKLIB = liblapack.a TMGLIB = libtmglib.a LAPACKELIB = liblapacke.a Make 安裝 BLACS http://www.netlib.org/blacs下載MPIBLACS 在BMAKES文件夾中拷出Bmake.MPI-LINUX Bmake.inc 參見:How do I build BLACS with Open MPI http://www.open-mpi.org/faq/?category=mpi-apps 修改Bmake.inc # Section 1: # Ensure to use MPI for the communication layer COMMLIB = MPI # The MPIINCdir macro is used to link in mpif.h and # must contain the location of Open MPI's mpif.h. # The MPILIBdir and MPILIB macros are irrelevant # and should be left empty. MPIdir = /path/to/openmpi-1.6.5 MPILIBdir = MPIINCdir = $(MPIdir)/include MPILIB = # Section 2: # Set these values: SYSINC = INTFACE = -Df77IsF2C SENDIS = BUFF = TRANSCOMM = -DUseMpi2 WHATMPI = SYSERRORS = # Section 3: # You may need to specify the full path to # mpif77 / mpicc if they aren't already in # your path. F77 = mpif77 F77LOADFLAGS = CC = mpicc CCLOADFLAGS = Make mpi 安裝 scalapack 參見:http://www.open-mpi.org/faq/?category=mpi-apps # Make sure you follow the instructions to build BLACS with Open MPI, # and put its location in the following. BLACSdir = <path where you installed BLACS> # The MPI section is commented out. Uncomment it. The wrapper # compiler will handle SMPLIB, so make it blank. The rest are correct # as is. USEMPI = -DUsingMpiBlacs SMPLIB = BLACSFINIT = $(BLACSdir)/blacsF77init_MPI-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_MPI-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_MPI-$(PLAT)-$(BLACSDBGLVL).a TESTINGdir = $(home)/TESTING # The PVMBLACS setup needs to be commented out. #USEMPI = #SMPLIB = $(PVM_ROOT)/lib/$(PLAT)/libpvm3.a -lnsl -lsocket #BLACSFINIT = #BLACSCINIT = #BLACSLIB = $(BLACSdir)/blacs_PVM-$(PLAT)-$(BLACSDBGLVL).a #TESTINGdir = $(HOME)/pvm3/bin/$(PLAT) # Make sure that the BLASLIB points to the right place. We built this # example on Solaris, hence the name below. The Linux version of the # library (as of this writing) is blas_LINUX.a. BLASLIB = $(LAPACKdir)/blas_solaris.a # You may need to specify the full path to mpif77 / mpicc if they # aren't already in your path. 我改的: BLACSdir = /path to/BLACS/LIB BLASLIB = -L/path to/lapack-3.4.2 -lrefblas LAPACKLIB = -L/path to/lapack-3.4.2 -llapack LIBS = $(LAPACKLIB) $(BLASLIB) USEMPI = -DUsingMpiBlacs SMPLIB = BLACSFINIT = $(BLACSdir)/blacsF77init_MPI-LINUX-0.a BLACSCINIT = $(BLACSdir)/blacsCinit_MPI-LINUX-0.a BLACSLIB = $(BLACSdir)/blacs_MPI-LINUX-0.a #TESTINGdir = $(home)/TESTING 編譯siesta 將Src/MPI中全部拷到 Obj/MPI中,make 在Obj文件夾中執(zhí)行: sh ../Src/obj_setup.sh ../Src/configure --enable-mpi(詳見--help) 修改 arch.make, 我的: FC=mpif90 FPPFLAGS= -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DMPI BLAS_LIBS= -L/path/lapack-3.4.2/ -lrefblas LAPACK_LIBS= -L/path/lapack-3.4.2/ -llapack -ltmglib BLACS_LIBS= -L/path/BLACS/LIB/blacs_MPI-LINUX-0.a SCALAPACK_LIBS= -L/path/scalapack-2.0.2/ -lscalapack COMP_LIBS= dc_lapack.a linalg.a MPI_INTERFACE=libmpi_f90.a MPI_INCLUDE=/home/feng/scisoft/openmpi-gnu/include 測(cè)試: mpirun -np <nproc> siesta < input.fdf > output |
科研小木蟲 |
禁蟲 (小有名氣)
|
本帖內(nèi)容被屏蔽 |
| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 化學(xué)調(diào)劑 +5 | yzysaa 2026-03-21 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +3 | 邱gl 2026-03-20 | 7/350 |
|
|
[基金申請(qǐng)] 山東省面上項(xiàng)目限額評(píng)審 +3 | 石瑞0426 2026-03-19 | 3/150 |
|
|
[考研] 317求調(diào)劑 +9 | 申子申申 2026-03-19 | 15/750 |
|
|
[考研] 求調(diào)劑 +3 | .m.. 2026-03-21 | 4/200 |
|
|
[考研] 0856材料專碩353求調(diào)劑 +3 | NIFFFfff 2026-03-20 | 3/150 |
|
|
[考研] 306求調(diào)劑 +4 | chuanzhu川燭 2026-03-18 | 4/200 |
|
|
[考研] 332求調(diào)劑 +4 | ydfyh 2026-03-17 | 4/200 |
|
|
[考研] 265求調(diào)劑 +9 | 梁梁校校 2026-03-17 | 9/450 |
|
|
[考研] 一志愿華南師大 070300(化學(xué))304分求調(diào)劑 +3 | 0703武芊慧雪304 2026-03-18 | 3/150 |
|
|
[考研] 287求調(diào)劑 +7 | 晨昏線與星海 2026-03-19 | 8/400 |
|
|
[考研] 295材料求調(diào)劑,一志愿武漢理工085601專碩 +5 | Charlieyq 2026-03-19 | 5/250 |
|
|
[考研] 求調(diào)劑 +3 | eation27 2026-03-20 | 3/150 |
|
|
[考研] 材料與化工專碩調(diào)劑 +7 | heming3743 2026-03-16 | 7/350 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +7 | 困于星晨 2026-03-17 | 9/450 |
|
|
[考研] 廣西大學(xué)家禽遺傳育種課題組2026年碩士招生(接收計(jì)算機(jī)專業(yè)調(diào)劑) +3 | 123阿標(biāo) 2026-03-17 | 3/150 |
|
|
[考研] 312求調(diào)劑 +8 | 陌宸希 2026-03-16 | 9/450 |
|
|
[碩博家園] 湖北工業(yè)大學(xué) 生命科學(xué)與健康學(xué)院-課題組招收2026級(jí)食品/生物方向碩士 +3 | 1喜春8 2026-03-17 | 5/250 |
|
|
[考研] 材料工程專碩274一志愿211求調(diào)劑 +6 | 薛云鵬 2026-03-15 | 6/300 |
|
|
[考研] 321求調(diào)劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|