This is based on these tests, with some changes to adapt it to my goals at the moment.
It is necessary, among the usual things,
to configure MPI using MPIPreferences.use_system_binary()
,
and restart Julia (as suggested in the
docs).
tmux-mpi
is a super cool tool that allows to run multiple MPI processes
having each process in its own tmux window or pane.
It might require to memorize a few shortcuts to work with tmux,
but it is definitely worth the effort.
To set it up, follow the instructions
at its github repository,
creating a python virtual environment
using the requirement.txt
file provided.
If you have set up your environment as I have, you can launch it with, e.g.:
$ ./tmux-mpi/launch.sh 2 julia --project=.
In the launch.sh script the environment variables are set so that a pane is created for each MPI rank (in this case, 2 ranks) and that the standard input is broadcast to all the MPI processes.