如何使用 MPI 执行 Julia 脚本?

How can I execute a Julia script using MPI?

我正在尝试使用 Julia 完成 this helloworld MPI 示例,但我收到以下错误消息:

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

这是否意味着 mpirun 无法将 helloworld.jl(这就是我对 Julia 脚本的称呼)识别为可执行文件?或者是 mpirun 无法将 julia 识别为可执行文件的问题?我正在执行的命令是mpirun -np 2 julia helloworld.jl。我也试过 mpiexec -n 2 julia helloworld.jl,但我得到了同样的错误信息。我在 Ubuntu 20.04.1 LTS 上安装了 Julia 1.5.2。有人能给我指出正确的方向吗?

要在评论中回答您的问题,默认情况下,mpiexecjl 命令不会像您遇到的那样起作用。您需要按照此处详述的步骤操作:https://juliaparallel.github.io/MPI.jl/stable/configuration/ in order to have use of those commands from the terminal. Specifically, you need to make sure you have installed MPI per these instructions: https://juliaparallel.github.io/MPI.jl/stable/configuration/#Building

即使在 Julia 中 运行 MPI.install_mpiexecjl() 之后,我也可以重现 mpiexecjl 命令无法正常工作。按照我上面链接的安装步骤在本地为我解决这个问题。