Open MPI and Singularity deployment scripts.
First, log-in to your node that will be the manager. You can then clone this repository and cd into it:
ssh USER@MANAGER_IP
git clone https://github.com/ltetrel/mpi-deploy
cd mpi-deploy
Add all the hosts (manager and worker IP) into the list_hosts
file at the root of this repo, the first line should be the manager IP.
Still in the manager node, run ./install_manager.bash
.
This will configure a nfs storage for all nodes, install singularity
and Open MPI
on the manager machine.
To configure and install all workers, simply run ./install_workers.bash
.
Even after adding mpi
into the path (in the .bashrc
), the system still has trouble to find it.
To fix that, specify where it relies on the host(s) using the --prefix
.
If you are using a supported resource manager (like SLURM), Open MPI
will get the slot information from it.
In the other case you will need to maually add the nodes with --host
(or inside a file with --hostfile
) and specify the number of available slots.
For example, you can run the hello-world script that is provided in this repo:
mpirun --prefix $HOME/.local -np 20 --host 192.168.2.1:${NCPU_HOST_1},192.168.2.2:${NCPU_HOST_2} /dat/hello-world_mpi.bash
If you want to check the workload, use /dat/test_mpi.bash
. It will compute the hash from a random 100MB file.
To test singularity
, you can use /dat/hello-world_singularity.bash
.
Check the Open MPI tutorials if you are curious.