mpich2 install文件要点译文

1 篇文章 0 订阅

        内容为准备ASC14时根据官方文档所翻译,目的是为团队省去语言之苦快速了解相关配置。赛后发在CSDN上希望能帮助更多的人。如果有修改建议和其他好的帖子请留言,我会不断修改文章,方便大家了解MPICH2。备赛仓促,现在有新任务,所以没有重新维护,如有问题还请包涵。



MPICH2文档摘录

MPICH2 Installer’s Guide 

Version 0.4
(Download:http://pan.baidu.com/s/1jG2wtb4)

It is not necessary to have such privileges to build and install MPICH2.


安装需要

-mpich2.tar.gz & C compiler
-A fortran-77, Fortran-90, and/or C++ compiler if you wish to write MPI programs in any of these languages.(没有fortran仍然可以用MPICH2只是不能与fortran程序组合使用)
-Python 2.2 or later version(构建MPD,mpiexec会使用MPD)
-Linux系统


默认安装
需要c compiler-gcc;forran compiler-77
自己构建MPD
没有调试选项


安装过程

    1.解压tar xfz mpich2.tar.gz(一般在home/you/libraries)
    2.建立安装目录 mkdir /home/you/mpich2-install (the default is /usr/local/bin)如果目录是共享给所有运行程序的机器的,将会很方便。不然需要在安装后给每个机器做拷贝。
    3.建立构建build目录 mkdir /tmp/you/mpich2-1.0 (最好是在源目录?保留clean,而且可以方便的拷贝给其他机器去make)
    4.进入构建目录cd /tmp/you/mpich2-1.0
         配置:运行configure程序并且输出log文件/home/you/libraries/mpich2-1.0/configure -prefix=/home/you/mpich2-install |& tee configure.log
         查看 Check the configure.log file to make sure everything went well.
    5.构建mpich2程序:make |& tee make.log
    6.安装mpich2:make install |& tee install.log
    7.修改环境变量:
        bash:export PATH=/home/you/mpich2-install/bin:$PATH
        tchs:setenv PATH /home/you/mpich2-install/bin:$PATH
    8.验证成功
        which mpd
        which mpicc
        which mpiexec
        which mpirun
        都应该指向home/you/mpich2-install/bin
    9.移植,如果这个目录不在共享系统内,如NFS,需要目录拷贝到其他机器(磁盘挂载)
    10.0.配置MPD(Managing Process Managers)
         MPICH2不同于MPICH,MPICH利用外部进程管理for scalable startup of large MPI jobs(给大型MPI工作可扩展的启动)。MPICH2利用叫做MPD的进程管理。他是运行MPI程序的机器上守护进程组成的一个ring。More details on interacting with MPD can be found in the README file in mpich2/src/pm/mpd
    10.1.密码口令文件(MPD会查看在home~文件夹下.mpd.conf文件)并且使此文件只能被自己写600
         cd $HOME
         touch .mpd.conf
         chmod 600 .mpd.conf
         echo "secretword=mr45-j9z" >> .mpd.conf
    10.2.完整性检查
        bring up启动:mpd &
        test mpd command测试指令:mpdtrace
         #结果是运行mpd的主机名
         bring down关闭"ring":mpdallexit
    11.在一组机器上打开mpd
    11.1建立mpd.hosts文件(在~/下?),包含主机名,one per line,被用于ssh或rsh的目标。如果必要的话要包含域名domai name
    11.2确保可以用ssh无密码访问
          测试ssh othermachine date
          如果不能无密码执行,需要配置ssh或者解决方案,为了下一步的mpdboot
    12.在几个机器上启动守护进程,机器名在hosts文件中
          mpdboot -n <number to start> -f mpd.hosts
          无论运行mpdboot的机器是否在列表中都会被加入,要确保数量不大于总数。
          查看运行了mpd的机器 mpdtrace
          可以进行13
          *如果由于ssh的问题不能让mpdboot运行。
           可以“手动”启动守护进程
           mpd & # starts the local daemon
           mpdtrace -l # makes the local daemon print its host
           # and port in the form <host>_<port>(ip)
           登陆每个机器,将install/bin目录加入path,并且
           mpd -h <hostname> -p <port> &
           mpdtrace 再看哪个机器在序列中
         (其他介绍在mpich2-1.0/src/pm/mpd/README)
    13.测试建好的环境
          mpdtrace查看包含的机器
          mpdringtest测试一条信息用多长时间跑完组建好的这个ring
          很快,那么可以试验跑多次的程序
          mpdringtest 1000:跑1000次
    14.这样机器可以运行一个多进程工作
          mpdrun -n <number> hostname
          number不需要和ring中进程总数一致,如果有更多进程他们可以 wrap around(围包)
           你可以利用等级标签在标准输出看到这种效果。
           You can see the effect of this by getting rank labels on the stdout:
          mpdrun -l -n <number> hostname
          由于在本机运行,hostname可能不是全名。如果必要的时候hostname给出全名/bin/hostname ?
    15.利用mpiexec运行一个MPI工作。在mpich/examples中有例子
          经典的是cpi。计算pi
          mpiexec -n 5 cpi
          这个例子会显示那个host在运行
          By default, the processes are launched one after the other on the hosts in the mpd ring, so it is not necessary to specify hosts when running a job with mpiexec.(默认的,在ring上的进程被一个挨一个启动,所以在用mpiexec时不需要指定主机)
*mpiexec有一些选项可以向处理器传输指令
详见mpiexec --help
mpiexec -n 1 master : -n 19 slave
OR mpiexec -n 1 -host mymachine : -n 19 slave
在":"中间的语法称为argument sets 参数设置。详见USER GUIDE
有一个额外的参数:-default 适用于所有进程?
There is an extra argument set for arguments that apply to all the processes, introduced by the -default argument. For example, to get rank labels on standard output, use
mpiexec -default -l : -n 3 cpi
mpiexec的可选参数比mpirun多
===END===


常见的非默认配置选项
enable-g, enable-fast, devices, pms。。。




共享库Shared libraries
MPICH2共享库只支持gcc 和linux环境。
在MPICH2建立build的时候configure时
configure --enable-sharedlibs=gcc --disable-cxx
并且由于必须建立fortran库,确保不禁用f77。be sure not to configure with --disable-f77.


MPD

调用时详见 command --help
mpd: start an mpd daemon
mpdtrace: show all mpd's in ring
mpdboot: start a ring of daemons all at once
mpdringtest: test how long it takes for a message to circle the ring
mpdallexit: take down all daemons in ring
mpdcleanup: repair local Unix socket if ring crashed badly
mpdrun: start a parallel job
mpdlistjobs: list processes of jobs (-a or --all: all jobs for all users)
mpdkilljob: kill all processes of a single job
mpdsigjob: deliver a specific signal to the application processes of a job


在root下运行mpd
为了其他用户可以使用。
测试是否所有install step都需要root运行




=====MPD END=====


SMPD

(The sprocess manager)
在configuration时
加入--with-pm=smpd --with-pmi=smpd,来建立和安装smpd process manager。他会安装到bin的子文件夹
利用 --prefix option可以选择路径
smpd作为单机守护进程运行在每个节点,smpd进程管理者不相互联系,依赖已知的端口相互通信。如果多用户想使用同一个节点,必须配置每个用户自己的smpd且分别用自己的端口。
smpd用~/.smpd来保存配置信息,且权限600,不能被其他用户修改。至少包括the access passphrase口令,
phrase=<phrase>
且不要使用你自己的登陆密码


使用与实施
Usage and administration
在一个节点上运行 smpd -s
如果没有建立过配置文件,初次运行会提示用户建立~/.smpd文件
之后可以利用mpiexec启动MPI工作


smpd的选项
smpd -s 当前用户运行smpd,可以加入-p <port>制定监听端口。并且所有的相关smpd都需要用相同的端口。如果不用默认值,可以-p <port>也可以在.smpd文件中加入port=<port> 


smpd -r 在root(多用户)模式中启动smpd 服务(守护进程)This is not yet implemented.


smpd -shutdown [host] 关闭smpd。警告:这会引起smpd退出。并且mpiexec和smpd的命令直到再次启动smpd才会被获取be issued


=====SMPD END=====



测试集

=====TESTING=====
运行examples目录基本的测试


Intel测试集
测试顺序
1.检测模块cvs co IntelMPITEST
2.在IntelMPITEST源目录中建立测试目录
3.cd 到测试目录
4.确保mpd在运行
5.运行<ITS_SRC_DIR>/configure --with-mpich2=<MPICH2_INSTALL_DIR>
<ITS_SRC_DIR>=home/toonen/Projects/MPI-Tests/IntelMPITEST测试集源文件路径
<MPICH2_INSTALL_DIR>=directory containing your MPICH2 installation(MPICH2安装目录)
6.mkdir test;cd test;
7.% ( cd /home/toonen/Projects/MPI-Tests/IntelMPITEST/Test ; \
find {c,fortran} -name 'node.*' -print | grep 'MPI_Test' | sed -e 's-/node\..*$--' ) |& tee testlist
找到感兴趣的想测试的文件
例如结果中
Test/fortran/nonblocking/functional/MPI_Testsome


8.运行测试
../bin/mtest -testlist testlist -np 6 |& tee mtest.log
9.查看文件 寻找fail的地方


================

Terrence Zhou 2014.2


转载请注明文章出处:)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值