24小时热门版块排行榜    

查看: 3861  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

Prettyswan

木虫 (小有名气)

[交流] 【求助】如何使用openmpi在多节点并行计算? 已有3人参与

集群上使用的是openmpi,PBS有点问题,所以我一直用命令“mpirun -np 8 vasp”提交任务。不知道如何使用命令进行多节点的并行计算(把一个任务分配到多个节点上)。
在《并行计算导论》上查到关于mpich的使用:
引用回帖:
5. 运行MPICH程序
多机环境中运行MPICH程序与单机环境类似,可以用mpirun来进行。运行程序前先创建一个machinefile文件,其中列出要使用的结点机名,然后用命令“mpirun -machinefile 文件名 ...”来在指定的结点上运行程序。例如,假设用户登录在结点node2上,文件mfile中包含下述内容:
node3
node4
则命令:
mpirun -machinefile mfile -np 3 cpi
将用node2,node3 和node4来运行程序cpi,每个结点一个进程,这是因为默认情况下mpirun总是将当前结点添加到程序的结点机列表中。如果不希望使用当前结点(node2),可以加上-nolocal选项:
mpirun -nolocal -machinefile mfile -np 3 cpi
选项-np给出的进程数与-machinefile给出的文件中的结点机数不一定要相等。如果进程数少于结点机数,则程序只使用其中的一部分结点。如果进程数多于结点机数,则一些结点上会运行多于一个进程。

我参考着使用了一下
CODE:
[zhuqx_hp@node3 Se]$ nohup /home/software/openmpi-1.2.2-intel9/bin/mpirun -machiefile INCAR KPOINTS POTCAR POSCAR -np 8 /home/bin/vasp.openmpi >out

结果报错了
引用回帖:
--------------------------------------------------------------------------
Open RTE detected a parse error in the hostfile:
    INCAR
It occured on line number 1 on token 3.
--------------------------------------------------------------------------
[node3:26677] [0,0,0] ORTE_ERROR_LOG: Error in file rmgr_urm.c at line 358
[node3:26677] mpirun: spawn failed with errno=-1

machinefile:
引用回帖:
node2
node4
node5
node6
node7

请教了。谢谢

[ Last edited by Prettyswan on 2010-7-7 at 15:38 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Prettyswan

木虫 (小有名气)

引用回帖:
Originally posted by goldenfisher at 2010-07-07 22:41:35:
在-machinefile后面还要加上你命名的各个节点的文件。记住,-machinefile是一个命令,而后面跟上的才是其对应的节点。
比如命名文件为mf,其中内容为上面所说的内容,则运行
mpirun -n 8 -machinefile mf vasp即可

官方指南中写道:
引用回帖:
SYNOPSIS
       Single Process Multiple Data (SPMD) Model:

       mpirun [ options ] [ ]

       Multiple Instruction Multiple Data (MIMD) Model:

       mpirun [ global_options ]
              [ local_options1 ] [ ] :
              [ local_options2 ] [ ] :
              ... :
              [ local_optionsN ] [ ]

       Note  that in both models, invoking mpirun via an absolute path name is
       equivalent to specifying the --prefix option with a value equiva-
       lent  to  the  directory where mpirun resides, minus its last subdirec-
       tory.  For example:

           % /usr/local/bin/mpirun ...

       is equivalent to

           % mpirun --prefix /usr/local

QUICK SUMMARY
       If you are simply looking for how to run an MPI application, you proba-
       bly want to use a command line of the following form:

           % mpirun [ -np X ] [ --hostfile ]  

       This  will  run X copies of in your current run-time environ-
       ment (if running under a supported resource manager, Open MPI's  mpirun
       will  usually  automatically  use  the  corresponding  resource manager
       process starter, as opposed to, for example, rsh or ssh, which  require
       the  use  of a hostfile, or will default to running all X copies on the
       localhost), scheduling (by default) in a  round-robin  fashion  by  CPU
       slot.  See the rest of this page for more details.

我仿照着写了
CODE:
[zhuqx_hp@node2 Se]$ nohup /home/software/openmpi-1.2.2-intel9/bin/mpirun  -np 8 -hostfile mfile /home/bin/vasp.openmpi >out &

结果还是报错:
引用回帖:
--------------------------------------------------------------------------
Failed to find the following executable:

Host:       node2
Executable: mfile

Cannot continue.
--------------------------------------------------------------------------

[ Last edited by Prettyswan on 2010-7-8 at 11:16 ]
4楼2010-07-08 10:16:32
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

beyondstar

木虫 (正式写手)


lvjian8596(金币+1):感谢交流! 2010-07-07 22:16:45
并行命令
mpirun -n 8 -machinefile -mf vasp>log&
其中mf
node01
node02
........
........

node08
node08
2楼2010-07-07 18:44:42
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

goldenfisher

金虫 (著名写手)

★ ★
lvjian8596(金币+1):感谢交流! 2010-07-07 22:53:44
zzy870720z(金币+1):谢谢指点 2010-07-08 10:05:19
在-machinefile后面还要加上你命名的各个节点的文件。记住,-machinefile是一个命令,而后面跟上的才是其对应的节点。
比如命名文件为mf,其中内容为上面所说的内容,则运行
mpirun -n 8 -machinefile mf vasp即可
3楼2010-07-07 22:41:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

goldenfisher

金虫 (著名写手)

★ ★
zzy870720z(金币+2):谢谢指点 2010-07-08 17:18:55
节点的名称有可能不一样,你的集群的各个节点你要确认是以node命名的吗?
我们的就不是,是以compute-1命名的。
你的情况是找不到分节点,估计你的命名有问题
5楼2010-07-08 17:05:40
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 材料与化工304求B区调剂 +6 邱gl 2026-03-11 7/350 2026-03-17 01:27 by 学员FnSWZj
[考研] 东南大学364求调剂 +5 JasonYuiui 2026-03-15 5/250 2026-03-16 21:28 by 木瓜膏
[考研] 283求调剂 +10 小楼。 2026-03-12 14/700 2026-03-16 16:08 by 13811244083
[考研] 070303一志愿西北大学学硕310找调剂 +5 d如愿上岸 2026-03-12 8/400 2026-03-16 15:19 by peike
[考研] 材料与化工求调剂 +3 为学666 2026-03-16 3/150 2026-03-16 15:09 by 加号+
[考研] 277材料科学与工程080500求调剂 +3 自由煎饼果子 2026-03-16 3/150 2026-03-16 14:10 by 运气yunqi
[考研] 0703化学调剂 290分有科研经历,论文在投 +7 腻腻gk 2026-03-14 7/350 2026-03-16 10:12 by houyaoxu
[考研] 326求调剂 +3 mlpqaz03 2026-03-15 3/150 2026-03-16 07:33 by Iveryant
[考研] 0856专硕279求调剂 +5 加油加油!? 2026-03-15 5/250 2026-03-15 11:58 by 2020015
[考研] 294求调剂 +3 Zys010410@ 2026-03-13 4/200 2026-03-15 10:59 by zhq0425
[考研] 一志愿湖师大化学289求调剂 +6 XMCMM3.14159 2026-03-10 6/300 2026-03-14 00:28 by JourneyLucky
[考研] 279求调剂 +3 抓着星星的女孩 2026-03-10 3/150 2026-03-13 23:47 by userper
[考研] 一志愿西南交大,材料专硕317求调剂 +5 lx8568 2026-03-11 5/250 2026-03-13 21:43 by peike
[考研] 求调剂 +5 一定有学上- 2026-03-12 5/250 2026-03-13 18:31 by ms629
[考研] 0703化学求调剂 +7 绿豆芹菜汤 2026-03-12 7/350 2026-03-13 17:25 by njzyff
[考研] 土木第一志愿276求调剂,科研和技能十分丰富,求新兴方向的导师收留 +3 土木小天才 2026-03-12 3/150 2026-03-13 15:01 by JourneyLucky
[考研] 26考研求调剂 +5 丶宏Sir 2026-03-13 5/250 2026-03-13 13:05 by JourneyLucky
[考研] 08食品或轻工求调剂,本科发表3篇sci一区top论文,一志愿南师大食品科学与工程 +3 我是一个兵, 2026-03-10 3/150 2026-03-13 10:21 by Yuyi.
[考研] 298求调剂 +3 Vv呀! 2026-03-10 3/150 2026-03-10 22:40 by 剑诗杜康
[考研] 085602化工求调剂 +7 董boxing 2026-03-10 7/350 2026-03-10 17:07 by BruceLiu320
信息提示
请填处理意见