mpichインストール使用

10370 ワード

インストール

## 
wget http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
tar zxf mpich-3.2.tar.gz
cd mpich-3.2
./configure -prefix=/home/mpi/mpich-install/ --disable-fortran 2>&1 | tee c.txt
make 2>&1 | tee m.txt
make install PACKAGE=mpich-3.2 2>&1 | tee mi.txt

##    mpi PATH:
[mpi@shark1 ~]$ tail -3 ~/.bashrc 
## add mpi path
PATH=/home/mpi/mpich-install/bin:$PATH

##         
. ~/.bashrc  
which mpicc
~/mpich-install/bin/mpicc
which mpiexec
~/mpich-install/bin/mpiexec

テストmpichはexampleを持参します

[mpi@shark1 mpich-3.2]$ echo localhost > machinefile
[mpi@shark1 mpich-3.2]$ mpiexec -n 1 -f machinefile ./examples/cpi
Process 0 of 1 is on shark1
pi is approximately 3.1415926544231341, Error is 0.0000000008333410
wall clock time = 0.000621


[mpi@shark1 mpich-3.2]$ mpiexec -n 5 -f machinefile ./examples/cpi
Process 0 of 5 is on shark1
Process 3 of 5 is on shark1
Process 1 of 5 is on shark1
Process 2 of 5 is on shark1
Process 4 of 5 is on shark1
pi is approximately 3.1415926544231230, Error is 0.0000000008333298
wall clock time = 0.023467

##     machinefile        mpi      ssh,        cpi,          

テストMPIプログラム


欠落したライブラリを先にインストール


log 4 cppライブラリが見つかりません

[root@shark1 opt]# yum install log4cpp.x86_64
[root@shark1 opt]# yum install log4cpp-devel.x86_64

解決mpi_model.cpp:38: error: ‘memset’ was not declared in this scope

//      
include 

/usr/bin/ld:cannot find-lcryptoエラー1.
[root@shark1 opt]# ll /usr/lib64/libss*
lrwxrwxrwx. 1 root root     16 Jun  9  2014 /usr/lib64/libssh2.so.1 -> libssh2.so.1.0.1
-rwxr-xr-x. 1 root root 164504 Feb 22  2013 /usr/lib64/libssh2.so.1.0.1
-rwxr-xr-x. 1 root root 224328 Feb 23  2013 /usr/lib64/libssl3.so
lrwxrwxrwx. 1 root root     16 Jun 11  2014 /usr/lib64/libssl.so.10 -> libssl.so.1.0.1e
-rwxr-xr-x. 1 root root 444040 Jun  5  2014 /usr/lib64/libssl.so.1.0.1e
lrwxrwxrwx. 1 root root     21 Jun  9  2014 /usr/lib64/libsss_idmap.so.0 -> libsss_idmap.so.0.0.1
-rwxr-xr-x. 1 root root  17216 Feb 23  2013 /usr/lib64/libsss_idmap.so.0.0.1
[root@shark1 opt]# 
[root@shark1 opt]# ll /usr/lib64/libcryp*
lrwxrwxrwx. 1 root root      19 Jun 11  2014 /usr/lib64/libcrypto.so.10 -> libcrypto.so.1.0.1e
-rwxr-xr-x. 1 root root 1953536 Jun  5  2014 /usr/lib64/libcrypto.so.1.0.1e
lrwxrwxrwx. 1 root root      25 Jun 10  2014 /usr/lib64/libcrypt.so -> ../../lib64/libcrypt.so.1
lrwxrwxrwx. 1 root root      19 Jun  9  2014 /usr/lib64/libcryptui.so.0 -> libcryptui.so.0.0.0
-rwxr-xr-x. 1 root root   78312 Aug 23  2010 /usr/lib64/libcryptui.so.0.0.0


[root@shark1 opt]# ln -s /usr/lib64/libssl.so.1.0.1e /usr/lib64/libssl.so
[root@shark1 opt]# ln -s /usr/lib64/libcrypto.so.1.0.1e /usr/lib64/libcrypto.so

/usr/bin/ld:cannot find-lzエラー
[root@shark1 opt]# yum install zlib.x86_64  zlib-devel.x86_64

テストプログラム

// TODO: 

http://blog.csdn.net/yasi_xi/article/details/8658191. ↩