open mpi安装
傻瓜式安裝openmpi:
安裝
1) 下載openmpi
2) tar -xzvf openmpi-1.4.3.tar.gz
3) cd openmpi-1.4.3
4) ./configure --prefix=/usr/local/openmpi | tee ../install.log
5) make all | tee ../make.log
6) make install | tee ../install2.log
?
配置環境
7) vi /etc/ld.so.conf? 最后增加一行
/usr/local/openmpi/lib
保存退出
8) /sbin/ldconfig?? 回車等待。
9) vi /etc/profile, 最后 增加一行:
PATH=${PATH}:/usr/local/openmpi/bin
保存退出
10)執行
. /etc/profile
測試
10)cd examples
11) make
12) mpirun? -np 4 ./hello_f90????????????? 可以得到類似ppt中的輸出
?mpi多機時, 需要有machines文件。文件內容如下:
tp1 1 /home/pact/mpich/examples/basic/cpi
tp2 1 /home/pact/mpich/examples/basic/cpi
tp3 1 /home/pact/mpich/examples/basic/cpi
分別表示機器名/ip,? 進程個數, 進程名(進程名可以沒有); 當使用機器名時, 則需要架設DNS服務器。
mpirun -machinefile ./machine.linux -np 4 ./hello_f90
?
?
?
?
?
?
?
安裝 mpiBlast.1.6.0
mkdir -p /usr/local/bio/mpiblast-1.6.0
tar -xzvf mpiBLAST-1.6.0.tgz
cd mpiblast-1.6.0
./ncbi/make/makedis.csh??????? #1.6.0自帶ncbi
./configure --prefix=/usr/local/bio/mpiblast-1.6.0/? --with-mpi=/usr/local/openmpi
make
make install?
?
然后配置。。。???http://wenku.baidu.com/view/f993570f76c66137ee061965.html
?
?
?
?
?
?
?
?
http://www.linuxdiyf.com/bbs/thread-68473-1-1.html
?
openmpi的安裝步驟參考www.openmpi.org的faq就能搞定了。稍記一下供以后參考:
1)從www.openmpi.org下載壓縮包openmpi-1.2.4-tar.bz2,放到/tmp下, 解壓縮tar jxf
2) cd openmpi-1.2.4, ./configure --prefix=/usr/local/openmpi, make all install
3) cd; vi .bashrc, 增加到最后一行 export LD_LIBRARY_TYPE=/usr/local/openmpi/lib,vi .profile,
? ?? ? PATH=/usr/local/openmpi/bin:"${PATH}"
到這里,開一個終端,cd /tmp/openmpi-1.2.4/examples; make。
下面為了用幾個節點或者在一個節點上算題,再對ssh作一下工作。
1) sudo apt-get install openssh
2) cd; ssh-keygen -t rsa, 也可以是 ssh-keygen -t dsa 碰見提示就回車和yes.
3) cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys, 完成無密碼登錄授權
最后,測試一下mpirun -np 2 /tmp/openmpi-1.2.4/examples/hello_f90, 沒有出問題應該結果是:
Hello, world, I am 1 of 2 Hello, world, I am 0 of 2
如果有問題,如./hello_f90: error while loading shared libraries: libmpi_f90.so.0: cannot open shared object file: No such file or directory 則要檢查一下是否$LD_LIBRARY_PATH是空的,執行export LD_LIBRARY_PATH=/usr/local/openmpi/lib以后就行了。或者不嫌麻煩的話,mpirun --prefix /usr/local/openmpi -np 2 /tmp/openmpi-1.2.4/examples/hello_f90也能執行。
?
?
?
?
?
?
?
?
?
?
?
?
?
http://blogold.chinaunix.net/u2/85704/showart_1964625.html
?
<1>Open-mpi的安裝:
?即? tar -xvzf openmpi-xxxx.gz
???? cd? openmpi-xxxx
???? ./configure --prefix=/usr/local/openmpi | tee cfg.log &
???? make all | tee make.log &
?????make install | tee makeinstall.log &
?末尾出現些subscripts too complex的警告, 但似乎正常結素了。???
結果出現??? Unfortunately, this installation of Open MPI was not compiled with Fortran 90 support. As such, the mpif90 compiler is non-functional.
結果錯誤在于沒有指定F77=IFORT FC=IFORT ,改正后重新編譯成功
可以到EXAMPLES里面測試,MAKE-----MPIRUN -N 4 hello_f90
?Hello, world, I am??????????? 0? of??????????? 4
?Hello, world, I am??????????? 2? of??????????? 4
?Hello, world, I am??????????? 3? of??????????? 4
?Hello, world, I am??????????? 1? of??????????? 4
表明編譯正確
-----------------------------------(以下與nwchem的編譯無關,與編譯好調用mpi有關)
然后把openmpi及其它的bin路徑添到.bashrc里。
注意使用它還用設置共享庫的位置?,用.bashrc里添加:
export LD_LIBRARY_PATH=$MPIDIR/lib:$LD_LIBRARY_PATH
或者每次運行mpirun時用 --prefix=/usr/local/openmpi 聽說也可以
?---------------------------------------------
初步適用了下,openmpi 和 mpich2的區別:
(1)openmpi繼承了初代mpi沒有系統守護模塊(如mpd)的特點,由作業自己隨時調用mpirun;感覺上比較方便。
(2)hostfile的寫法略有不同,比如mpich里習慣都是 <hostname>:<n>
而openmpi的對多路或多核心cpu的寫法是<hostname> slots=<n>
(3)其它,似乎不怎么明白openmpi用-mca btl(注意是字母L的小寫,不是數字1),最郁悶的是沒有user manual, 只是在tar包里原來的INSTALL里說明(或許是README,記不清了),btl其實適用面更廣,可以在同node里用sharememory,可以在不同nodes間用sockets,但不知為什么默認的通訊模塊不是它,好象是什么什么cm的選項,要試試加btl可否加速mpirun作業。
總結
以上是生活随笔為你收集整理的open mpi安装的全部內容,希望文章能夠幫你解決所遇到的問題。