bash - 从 bash 脚本运行 mpi 作业,批处理模式

标签 bash mpich

我正在尝试构建一个在特定时间以批处理模式运行 mpi 作业的脚本。如果我在控制台 mpdallexitmpdbootmpirun 中运行,一切都会正常工作,并且并行作业会在 mpd.hosts 中的所有节点上启动。但是,如果我尝试从 bash 脚本运行(现在与 at 脚本一起发送 +1 分钟),mpd 就会崩溃并且不会启动任何作业。

这是脚本中的相关行

$path_mpi/mpdallexit 
$path_mpi/mpdboot -n 5 &
time $path_mpi/mpirun -n 21 ./rams60 -f RAMSIN.operatiu 
$path_mpi/mpdallexit

以及日志中的错误消息

mpiexec_ventus: cannot connect to local mpd (/tmp/mpd2.console_meteo); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)
In case 1, you can start an mpd on this host with:
    mpd &
and you will be able to run jobs just on this host.
For more details on starting mpds on a set of hosts, see
the MPICH2 Installation Guide.

我尝试了 mpdboot 的不同选项

--loccons says you do not want a console available on local mpd(s)
--remcons says you do not want consoles available on remote mpd(s)

mpdboot -n 5 &

但没有成功

Mpich 安装在/usr/local/mpich2-1.0.5p4/

编辑1:

在尝试了 @shellter 关于 sleep 的建议后,我无法运行并行作业,at 也无法运行 cron。发出批处理 mpirun 作业时,某些进程在主节点上启动,但不在其他集群节点中启动:

在主节点

ps -ef | grep rams
meteo    28043 26837  0 Apr21 ?        00:00:00 time /usr/bin/mpirun -n 50 -f machinefile ./rams60 -f RAMSIN.operatiu
meteo    28044 28043  0 Apr21 ?        00:00:00 /usr/bin/mpirun -n 50 -f machinefile ./rams60 -f RAMSIN.operatiu
meteo    28050 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28051 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28052 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28053 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28054 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28055 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28056 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28057 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28058 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28059 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28060 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu
meteo    28061 28045  0 Apr21 ?        00:00:00 ./rams60 -f RAMSIN.operatiu

此外,rams60 不会创建任何输出文件,而它所做的第一件事就是编写启动分析文件。

如果我在命令行中执行脚本,一切都会正常运行,但在批处理中,mpich 似乎无法与节点通信。

首先我在主节点安装了mpich2,并将NFS导出到其他节点。现在我已经在每个节点上安装了mpich2。

谢谢

提前致谢

最佳答案

错误信息非常清楚:

mpiexec_ventus: cannot connect to local mpd (/tmp/mpd2.console_meteo); possible causes:
  1. no mpd is running on this host
  2. an mpd is running but was started without a "console" (-n option)

我假设您正在运行 mpd,因此...检查其 -n 选项。

关于bash - 从 bash 脚本运行 mpi 作业,批处理模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23107758/

相关文章:

bash - 期望:将生成命令的输出存储到变量中

bash - 如何在 bash 中打印用法和缺少参数错误?

linux - 为什么 |不适用于查找?

代码解释(MPICH)

c - MPICH:如何发布_name 以便客户端应用程序可以查找_name 呢?

git - Init.d 脚本不更新 git 存储库

python - 通过 Pythons 子进程使用换行符和 Linux 邮件命令发送邮件

MPI:为什么我的 MPICH 程序因大号而失败。进程?

mpi - 确保混合 MPI/OpenMP 在不同的内核上运行每个 OpenMP 线程

c - 进入 NIT 参数编号 9 时有非法值