Seems like part of the confusion is that this command isn’t “in python”, it’s a shell command that runs a python script. The only role python
has is interpreting your script script.py
. The rest of the command is calling mpiexec
with the options -f machinefile
and -n 4
; that part doesn’t care what command you’re trying to run, just how many processes and which hosts you’d like to run it on.
In particular, the option -f machinefile
, tells MPI what hosts (i.e. computers) you’d like the command to be run on (see here for more information in the case of openMPI; the other implementations are similar in behavior).
Examining the command you used to run your Julia script:
mpiexec -np 4 Julia script.jl
Note that the -f machinefile
part of the command is missing. The script is only running on the local node because you haven’t told it to do otherwise.