手机版
你好,游客 登录 注册
背景:
阅读新闻

高性能集群 并行计算 mpich hpc 及 torque作业调度系统

[日期:2012-06-04] 来源:Linux社区  作者:yejiankang [字体:大 中 小]

2.在每个节点上安装mpich2

  1. yum install mpich2 -y 
  2. su - yejk
  3. cd /home/yejk
创建.mpd.conf文件 (文件前加".")
  1. vim .mpd.conf 
  2. secretword=westos    #节点的密码,每台节点都得相同 
  3. chmod 600 .mpd.conf 

创建集群节点集合文件mpd.hosts

  1. vim mpd.hosts  
  2. desktop80.example.com  
  3. desktop83.example.com  

 

 

注:如果以root用户启动mpd服务, 把mpd.conf文件创建在/etc目录中(不加"."),mpd.hosts放在root主目录中

3.1测试mpich2:
启动mpich2
  1. mpd  
观看启动机器:
 
  1. mpdtrace 
  2. desktop80.example.com 
 
退出:
 
  1. mpdallexit 
3.2运行集群系统
  1. mpdboot -n 2 -f mpd.hosts    参数-n 2指定了要起动的机器个数,-f mpd.hosts指定了运行mpd.hosts文件中指定的节点。 
  2. mpdtrace 
  3. desktop80.example.com 
  4. desktop83.example.com 
  5. mpdallexit  

3.3单机测试  

  1. ./icpi-64
  2. Enter the number of intervals: (0 quits) 1000000000  
  3. pi is approximately 3.1415926535921401, Error is 0.0000000000023470  
  4. wall clock time = 46.571311  
  5. Enter the number of intervals: (0 quits) 10000  
  6. pi is approximately 3.1415926544231341, Error is 0.0000000008333410  
  7. wall clock time = 0.000542  
  8. Enter the number of intervals: (0 quits) 0   

3.4 集群测试

  1. mpdboot -n 2 -f mpd.hosts 
  2. mpiexec -n 2 /root/icpi-64
  3. Enter the number of intervals: (0 quits) 1000000000 
  4. pi is approximately 3.1415926535899761, Error is 0.0000000000001830 
  5. wall clock time = 15.530082 
  6. Enter the number of intervals: (0 quits) 10000 
  7. pi is approximately 3.1415926544231323, Error is 0.0000000008333392 
  8. wall clock time = 0.006318 
  9. Enter the number of intervals: (0 quits) 0 
  10. mpdallexit 

 

由上述测试的结果可以看出使用单机单进程运行,intervals设为1000000000,耗时46.571311秒,而用两台机器双进程则只有15.530082秒,明显快很多,并行运算还是
很有效果的。不过,如果我们把intervals改为10000,单机运行只用了0.000542秒,而两台机器却花了0.006318秒,这是因为并行运算过程中,参与运算的机器需要通过网
络传递一些消息,如果计算量不大的话,花在了这上面的时间影响会比较明显,因而反不如单机版的来得快
linux
相关资讯       集群 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款