Let us allocate two nodes.
salloc -N2
If the cluster has idle nodes, you will get an allocation right away.
SLURM will populate the environment with information about the hosts involved and other information.
env |grep SLURM
Now you have two nodes at your disposal and you can run the mpirun
command from the previous section.
mpirun /home/ec2-user/hello
This time your job is executed on the two compute nodes.
Note that mpirun
is issues on the head node, but the ranks are executed on the compute node.
Afterwards we release the nodes so that it can run other jobs.
exit