尝试在 julia 上使用 mpirun 时“找不到指定的可执行文件”

“unable to find the specified executable file” when trying to use mpirun on julia

我正在尝试 运行 我的 julia 代码在一个集群的多个节点上,它使用 Moab 和 Torque 作为调度程序和资源管理器。 在我请求 3 个节点的交互式会话中,我加载了 julia 和 openmpi 模块以及 运行:

mpirun -np 72 --hostfile $PBS_NODEFILE -display-allocation julia --project=.  "./estimation/test.jl"

mpi运行 确实成功识别了我的 3 个节点,因为它显示:


======================   ALLOCATED NODES   ======================
        comp-bc-0383: slots=24 max_slots=0 slots_inuse=0 state=UP
        comp-bc-0378: slots=24 max_slots=0 slots_inuse=0 state=UNKNOWN
        comp-bc-0372: slots=24 max_slots=0 slots_inuse=0 state=UNKNOWN
=================================================================

然而,在那之后 returns 一条错误消息

--------------------------------------------------------------------------
mpirun was unable to find the specified executable file, and therefore
did not launch the job.  This error was first reported for process
rank 48; it may have occurred for other processes as well.

NOTE: A common cause for this error is misspelling a mpirun command
      line parameter option (remember that mpirun interprets the first
      unrecognized command line token as the executable).

Node:       comp-bc-0372
Executable: /opt/aci/sw/julia/1.5.3_gcc-4.8.5-ips/bin/julia
--------------------------------------------------------------------------

这可能是什么原因造成的?是因为它从其他节点访问 julia 有问题吗? (我认为是这种情况,因为代码 运行s 只要 -np X 其中 x <= 24,这是一个节点的槽数;一旦 x >= 25,它就无法 运行)

这是一本关于如何使用模块和 mpirun 的好手册。使用 MPIstacksWithModules

总结一下手册上写的内容:

It should be highlighted that modules are nothing else than a structured way to manage your environment variables; so, whatever hurdles there are about modules, apply equally well about environment variables.

您需要使用 -x PATH -x LD_LIBRARY_PATHmpirun 命令中导出环境变量。要查看这是否有效,您可以 运行

mpirun -np 72 --hostfile $PBS_NODEFILE -display-allocation -x PATH -x LD_LIBRARY_PATH which julia

另外,你应该考虑给你想要的文件的完整路径 运行,所以 /path/to/estimation/test.jl 而不是 ./estimation/test.jl 因为你的工作目录在每个节点中都不相同. (一般来说,使用整个路径总是更安全)。 通过使用整个路径,您还应该能够使用 /path/to/julia(即 which julia 的输出)而不是仅使用 julia,这样您就不需要导出环境变量。