构建局域网下并行计算(parallel computing)环境

1st: Here is a detailed document, record the process that how we establish the environment of parallel computing used with our local network. 

2nd: We have to generate the pub key and add it to the right directory to each other, then when use the ssh to login the machine in the ring, we need not to enter the password every time. Please do step by step as following:
    
         1.      
ssh_keygen -t rsa
this command will generate the public key and privacy key, then we can copy the public key to the remote machine, next time when we login in the remote machine, we just need enter the password one more time, but needn't for ever after that. note that, after type command 1, just hit the Enter, life will be easy.
        
         2.       scp ~/.ssh/id_rsa.pub (user)@(ip):~/.ssh/authorized_keys2
this command copy the public key to the remote machine, under the directory ~/.ssh, the file authorized_keys2 you can see that contains something exactly like that in your file: id_rsa.pub. note that, you have to enter the password the remote user holds.
       
         3.      ssh
user@ip
this step test that whether we did the right thing, of course, you have to  type the command 3 on the remote machine. Enter your password, then logout.let's ssh user@ip again, watch carefully, I'm sure this time you needn't to enter the password, god bless you.
       
3rd: Each node create a new directory /home/goodluck/mirror . note you can change the path as you like, but bear in mind, every node’s path should be the same. All the executed file, of course include the source file can be shared in this directory, and now we have a litter more work to do to reach this goal.
 
4th: we have to establish a fileserver.
     the fileserver should to modify the file: /etc/exports;
     add the line like this one exactly:
        /home/goodluck/mirror enzo(rw) fish(rw)
     Here is the first step that we are going to share the files in this directory.
 
5th: Except the server, other nodes have to add the one line append to the file: /etc/fstab as following:
         fish:/home/goodluck/mirror  /home/goodluck/mirror nfs rw,bg,soft 0 0
 
6th: change the file : /etc/hosts (for each node)
       add:
            222.201.175.106 fish
            222.201.175.55 enzo
 
7th: modify the file: /etc/hosts.equiv  (for each node)
        add the host names:
               fish
               enzo
Maybe everything has finished, it's so wonderful, We are waiting to see the result. But please be patient. The hosts should trust every node enough,and we are so closely this demand now. Follow me, it will give you a surprise soon.
  
8th: turn off every node's firewall.it's easy to do this job used with SUSE.
 
9th: turn on the fileserver's nfs server.(easily finished with SUSE, yast)
 
10th: if you are a normal node not a file server, you'd better to mount the remote directory to your home machine. Do it:
      mount fish:/home/goodluck/mirror  /home/goodluck/mirror
note that:bear in mind, two path is exactly the same, don't make it different,or,something get complex and I don't know how to solve it. you can cd the path to see weather you did the right thing.
 
11th: Any node can test it now, feel excitedly, do you ? 
      Under your /home/goodluck/mirror create a file, named mpd.hosts;
      add the nodes' hostnames to this file, one hostname one line.
 
12th: type the commands follow me:
    
         1. mpdboot -n <the number of nodes > -f mpd.hosts &
 
note: do you install mpich2 already ?  if it doesn't return any error message, then a ring should be established, if you want to make sure this, follow me:
 
          2. mpdtrace -l
and now you will to see the hostname, port and ip of all nodes which are in the ring. for example, the result we tested is:
 
          fish_2110 (222.201.175.106)
          enzo_32830 (222.201.175.55)   
but sometimes the system will promote that a file which named mpdroot couldn't find, easy, just create a  file named mpdroot, you can finish this job by typing these commands:
 
          touch mpdroot
          chmod 600 mpdroot  
I'm not sure for that why almost everytime when I want to execute the command mpdboot....., I have to reestablish the file mpdroot, oddness. 
 
13th: cd /home/goodluck/mirror  
      run:(my test)
               
mpirun -n 2 ./second
      I got:
                Processor 0 of 2: Hello World!
                Processor 1 of 2: Hello World!
maybe you will ask : well, sir when the ring had not be established, I can get this result,exactly the same. yes, we can simulate multiple CPU in a single machine, but this time it's really different, you can test it, follow me:
 
14th: please be sure of that you didn't type the command mpd&, and you just executed the command
    
          mpdboot -n 2 -f mpd.hosts            (review it)
   
      on any node, type this command:
          umount /home/goodluck/mirror
      run:(my test) again, the result I got as following:
          problem with execution of ./second  on  enzo:  [Errno 2] No such file or directory        
      it means that: when we run the command  mpirun -n 2 ./second, the node enzo had joined the computing.
 
Thank you, Good luck for you.
                                                                                               
             www.scut.edu.cn 
           Institute of SE
            MPI group
                                       Peter.chen(chen zhuochao)
                                        quick.chen@gmail.com
                                       2006-4-7  02:33
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值