User guide

4Running MPI on QLogic Adapters
Open MPI
4-12 IB0054606-02 A
mpihosts File Details
As noted in “Create the mpihosts File” on page 4-3, a hostfile (also called
machines file, nodefile, or hostsfile) has been created in your current working
directory. This file names the nodes that the node programs may run.
The two supported formats for the hostfile are:
hostname1
hostname2
...
or
hostname1 slots=process_count
hostname2 slots=process_count
...
In the first format, if the -np count (number of processes to spawn in the mpirun
command) is greater than the number of lines in the machine file, the hostnames
will be repeated (in order) as many times as necessary for the requested number
of node programs.
Also in the first format, if the -np count is less than the number of lines in the
machine file, mpirun still processes the entire file and tries to pack processes to
use as few hosts as possible in the hostfile. This is a different behavior than
MVAPICH or the no-longer-supported QLogic MPI.
In the second format, process_count can be different for each host, and is
normally the number of available processors on the node. When not specified, the
default value is one. The value of process_count determines how many node
programs will be started on that host before using the next entry in the hostfile
file. When the full hostfile is processed, and there are additional processes
requested, processing starts again at the start of the file.
It is generally recommended to use the second format and various command line
options to schedule the placement of processes to nodes and cores. For example,
the mpirun option -npernode can be used to specify (similar to the Intel MPI
option -ppn) how many processes should be scheduled on each node on each
pass through the hostfile. In the case of nodes with 8 cores each, if the hostfile line
is specified as hostname1 slots=8 max-slots=8, then Open MPI will assign
a maximum of 8 processes to the node and there can be no over-subscription of
the 8 cores.
There are several alternative ways of specifying the hostfile: