As mentioned earlier, in order to run a job on other nodes, we need to specify these nodes. The easiest way to do this is to create a file containing the names of the compute nodes we wish to use, along with optional parameters.
To allow us to use names for the nodes instead of IP addresses, we have to modify the operating system's host file first: for example, /etc/hosts on Linux:
192.168.0.1 master
192.168.0.2 node0
192.168.0.3 node1
Next we create a new file which will be the host file for use with MPI:
master
node0
node1
With this configuration, a job would be executed on both compute nodes, as well as the master node. We can take the master node out of this file to prevent this.
Without any optional parameter provided, the MPI runtime will use all available processors on the node. If it is desirable, we can limit this number:
node0 slots=2
node1 slots=4
Assuming that both nodes are quad-core CPUs, this would mean that only half the cores on node0 would be used, and all of them on node1.