Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I execute a Julia script using MPI?

Tags:

julia

mpi

I am trying to work through this helloworld MPI example using Julia, but I get the following error message:

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.

Does this mean that mpirun doesn't recognize helloworld.jl (this is what I called my Julia script) as the executable? Or is the problem that mpirun doesn't recognize julia as the executable? The command I am executing is mpirun -np 2 julia helloworld.jl. I have also tried mpiexec -n 2 julia helloworld.jl, but I get the same error message. I have Julia 1.5.2 installed on Ubuntu 20.04.1 LTS. Could somebody point me in the right direction?

like image 427
Erick Ruiz Avatar asked Apr 23 '26 19:04

Erick Ruiz


1 Answers

To answer your question in the comments, by default, the mpiexecjl command will not work as you are experiencing. You need to follow the steps detailed here: 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

I can reproduce the mpiexecjl command not working as well even after running the MPI.install_mpiexecjl() in Julia. Following the install steps I linked above resolves this for me locally.

like image 186
logankilpatrick Avatar answered Apr 27 '26 15:04

logankilpatrick