MPI_ hpcc基于zju-309虚拟化实验室_镜像

来源:互联网 发布:淘宝店铺装修免费软件 编辑:程序博客网 时间:2024/05/18 00:33

MPI基于zju-309虚拟化实验室_镜像 首先根据需要通过原始镜像(.img .swap  .cfg)复制需要的镜像个数。然后通过以下步骤镜像配置。  

1.物理文件配置(*.cfg)

  • 内存   memory=256
  • cpu  memory=256
  • 镜像地址

disk        = [

   8                   'file:/share/nfs04/xen/raw-img/node11.swap,xvda1,w',

   9 

  10                   'file:/share/nfs04/xen/raw-img/node11.img,xvda2,w',

  11               ]

  • name    name        = 'zlwnode11'
  • mac  不可以同名,根据需要修改注意前两位不能修改

         vif         = [ 'mac=00:16:3E:4F:F8:61,bridge=br0']

           注:br0为物理机网桥名

 

2.虚拟机内部

  • 修改所有节点的ip 地址;
  • 修改mpd的host配置文件

       root@zlwnode1:~# vim /root/mpd.hosts

        例:vc1_1为主机名

   1 vc1_1

   2 vc1_2          

  • 修改hosts

       root@zlwnode1:~# vim /etc/hosts

   例:

   1 10.214.15.71 vc2_1

   2 10.214.15.72 vc2_2

   3 10.214.15.73 vc2_3

   4 10.214.15.74 vc2_4

   5 10.214.15.75 vc2_5

   6 10.214.15.76 vc2_6

   7 10.214.15.77 vc2_7

   8 10.214.15.78 vc2_8

   9 

  10 # The following lines are desirable for IPv6 capable hosts

  11 ::1 localhost ip6-localhost ip6-loopback

  12 fe00::0 ip6-localnet

  13 ff00::0 ip6-mcastprefix

  14 ff02::1 ip6-allnodes

  15 ff02::2 ip6-allrouters

  16 ff02::3 ip6-allhosts

 

  • 拷贝mpd.hosts和hosts文件到对称节点。

 

 3.配置文件设置(hpccinf.txt)

 

8 device out (6=stdout,7=stderr,file)

6 # of problems sizes (N)

4000 4000 Ns (问题规模)

 

 

1 PMAP process mapping (0=Row-,1=Column-major)

8 # of process grids (P x Q) (线程个数)

8 1 4 Ps

1 8 2 Qs

 

 

 P × Q = 系统CPU数 = 进程数。

 P≤Q;一般来说,P的值尽量取得小一点,因为列向通信量(通信次数和通信数据量)要远大于横向通信。

P = 2n,即P最好选择2的幂。HPL中,L分解的列向通信采用二元交换法(Binary Exchange),当列向处理器个数P为2的幂时,性能最优。例如,当系统进程数为4的时候,P × Q选择为1 × 4的效果要比选择2 × 2好一些。


 

4.检查是否配置成功

        通过mpd.hosts文件查错
  mpdcheck -f mpd.hosts
  如果无错误
  mpdcheck -f mpd.hosts  -ssh

5。运行集群系统


  mpdboot -n 2 -f mpd.hosts
  参数-n 2指定了要起动的机器个数,-f mpd.hosts指定了通过mpd.hosts运行
  mpdtrace

       检查是否所有线程启动成功
  mpdallexit

        退出所有线程

 

正式运行:(切记,命令执行位置即hpccin.txt 和hppccout.txt位置)

启动线程

root@zlwnode1:~# mpdboot -n 8 -f mpd.hosts

root@zlwnode1:~# mpdtrace

运行:

root@zlwnode1:~/hpcc-1.3.1# mpirun -np 8 /root/hpcc-1.3.1/hpcc

 

运行过程中可在物理机上运行 :watch -d -n 2 xm list 监视虚拟机是否正常运行即状态 r---

 

 

附件:

  • 输入文件

hpccinf输入文件

HPLinpack benchmark input file

Innovative Computing Laboratory, University of Tennessee

HPL.out output file name (if any)

8 device out (6=stdout,7=stderr,file)

6 # of problems sizes (N)

4000 4000 Ns

2 # of NBs

80 100 NBs

1 PMAP process mapping (0=Row-,1=Column-major)

8 # of process grids (P x Q)

8 1 4 Ps

1 8 2 Qs

16.0 threshold

3 # of panel fact

0 1 2 PFACTs (0=left, 1=Crout, 2=Right)

2 # of recursive stopping criterium

2 4 NBMINs (>= 1)

1 # of panels in recursion

2 NDIVs

3 # of recursive panel fact.

0 1 2 RFACTs (0=left, 1=Crout, 2=Right)

1 # of broadcast

1 BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM)

1 # of lookahead depth

1 DEPTHs (>=0)

2 SWAP (0=bin-exch,1=long,2=mix)

64 swapping threshold

0 L1 in (0=transposed,1=no-transposed) form

0 U in (0=transposed,1=no-transposed) form

1 Equilibration (0=no,1=yes)

8 memory alignment in double (> 0)

##### This line (no. 32) is ignored (it serves as a separator). ######

0 Number of additional problem sizes for PTRANS

1200 10000 30000 values of N

0 number of additional blocking sizes for PTRANS

40 9 8 13 13 20 16 32 64 values of NB

 

 

  • 替换配置文件脚本编写

 

   1 conflist=`seq 1 16`

   2 for conffile in $conflist

   3 do

   4     confile=node1_$conffile

   5     nodename=vc1_$conffile

   6     ip=$((conffile+82))

   7     echo $ip

   8     ipaddress=10.214.15.$ip

   9     echo $confile

  10     memory_cof=512

  11     echo $confile

  12     sed -i "s/memory=.*/memory=$memory_cof/" ../$confile.cfg

  13     sed -i "s/node8.swap/$confile.swap/" ../$confile.cfg

  14     sed -i "s/node8.img/$confile.img/" ../$confile.cfg

  15     sed -i "s/name        =.*/name        = '$nodename'/" ../$confile.cfg

  16     sed -i "s/mac=.*/mac=00:16:3E:4F:F1:$ip,bridge=br0']/" ../$confile.cfg

  17     mount -o loop ../$confile.img /mnt

  18     sed -i "s/address.*/address $ipaddress/" /mnt/etc/network/interfaces

  19     sed -i "s/zlw.*/$nodename/" /mnt/etc/hostname

  20     cp mpd.hosts /mnt/root/mpd.hosts

  21     cp hosts /mnt/etc/hosts

  22     umount /mnt

  23 done

 


 

问题反馈:azhuliangwei@qq.com

 文档更新地址:http://note.sdo.com/u/1188891469#/n/6TgJd~jSiNFOwE0k4001Gd

 

 

 

 

 

 

 

 

 

原创粉丝点击