gpt4 book ai didi

linux - 如何在 `mpirun` 的命令行上指定节点?

转载 作者:太空狗 更新时间:2023-10-29 12:35:00 27 4
gpt4 key购买 nike

如何使用 mpirun-machine 标志?

要选择要在哪个集群节点上执行,我想出了像这样使用 mpirun-machinefile 选项

> mpirun -machinefile $HOME/utils/Host_file -np <integer> <executable-filename>

Host_file 包含一个节点列表,每行一个。

但我想提交一大堆具有不同参数的进程,我不希望它们在同一个节点上运行。也就是说,我想做类似的事情

> mpirun -machinefile $HOME/utils/Host_file -np 1 filename 1
nano Host_file % change the first node name
> mpirun -machinefile $HOME/utils/Host_file -np 1 filename 2
nano Host_file
> mpirun -machinefile $HOME/utils/Host_file -np 1 filename 3
nano Host_file
...

我可以使用 -machine 标志,然后为每次执行键入不同的节点。但我无法让它工作。例如

> mpirun -machine node21-ib -np 1 FPU
> mpirun -machine node21 -np 1 FPU

始终在主节点上执行。

我还尝试了 -nodes 选项

> mpirun -nodes node21-ib -np 1 FPU
> mpirun -nodes node21 -np 1 FPU

但这只是在我当前的节点上执行。

同样,我尝试了 -nolocal-exclude 选项但没有成功。

所以我有一个简单的问题:如何使用 -machine 选项?或者是否有更好的方法(对于 Linux 新手)?

我正在使用以下版本的 MPI,它在网络上的文档似乎少得惊人(到目前为止,我所有的文档都来自 > mpirun --help)。

> mpichversion
MPICH Version: 1.2.7
MPICH Release date: $Date: 2005/06/22 16:33:49$
MPICH Patches applied: none
MPICH configure: --with-device=ch_gen2 --with-arch=LINUX -prefix=/usr/local/mvapich-gcc --with-romio --without-mpe -lib=-L/usr/lib64 -Wl,-rpath=/usr/lib64 -libverbs -libumad -lpthread
MPICH Device: ch_gen2

感谢您的帮助。

最佳答案

你需要的是指定一个hosts文件

例如,在您的 mpirun 命令中尝试 mpirun -np 4 -hostfile hosts ./exec

其中 hosts 通常包含您的 ip 地址 192.168.1.201:8 其中最后一位是最大核心数,用换行符分隔每个节点。理想情况下,您应该安装一些集群管理软件,例如 torque 和 maui。

关于linux - 如何在 `mpirun` 的命令行上指定节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13999415/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com